Skip to content

Commit cb876ba

Browse files
authored
🐛 fix upload_failed_msg cannot be formatted. fix #122 (#123)
* 🐛 fix upload_failed_msg cannot be formatted. fix #122 * 💚 fix broken unit tests * 👕 more trace log in travis build * 📚 update moban configurations * 🐛 replace pytest with nosetests because pytest fails always * 💚 found the problem
1 parent ee917ce commit cb876ba

File tree

9 files changed

+11
-7
lines changed

9 files changed

+11
-7
lines changed

.moban.dt/local-travis.yml.jj2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ before_script:
2020

2121
{% block script %}
2222
- moban -c config/data.yml -t test.file -td templates .
23+
- pip freeze
2324
- {{ test_command }}
2425
{% endblock %}

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ before_script:
6363
sed -e "s/templates\//{%include \"/" -e "s/$/\" %}/" > test.file
6464
script:
6565
- moban -c config/data.yml -t test.file -td templates .
66+
- pip freeze
6667
- pytest
6768
after_success:
6869
codecov

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Change log
1010
gets default console_scripts entry always
1111
#. `#120 <https://github.com/moremoban/pypi-mobans/issues/120>`_: changelog rst
1212
syntax cause 400 error
13+
#. `#122 <https://github.com/moremoban/pypi-mobans/issues/122>`_:
14+
UPLOAD_FAILED_MSG cannot be formatted
1315

1416
**Updated**
1517

changelog.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ releases:
66
details:
77
- "`#114`: setup.py.jj2 gets default console_scripts entry always"
88
- "`#120`: changelog rst syntax cause 400 error"
9+
- "`#122`: UPLOAD_FAILED_MSG cannot be formatted"
910
- action: Updated
1011
details:
1112
- "`moban#295`: limit publish command in setup.py to be less than 79"

mobanfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
requires:
2-
- https://github.com/sphinx-doc/sphinx.git
31
configuration:
42
configuration: config/data.yml
53
template_dir:
64
- .moban.dt
75
- templates
8-
- sphinx:sphinx/templates/quickstart
6+
- "git://github.com/sphinx-doc/sphinx.git!/sphinx/templates/quickstart"
97
targets:
108
- .gitignore: gitignore.jj2
119
- .travis.yml: local-travis.yml.jj2

templates/setup.py.jj2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ class PublishCommand(Command):
298298
self.status(NO_GS_MESSAGE)
299299
if run_status:
300300
if os.system(PUBLISH_COMMAND) != 0:
301-
self.status(UPLOAD_FAILED_MSG % PUBLISH_COMMAND)
301+
self.status(UPLOAD_FAILED_MSG)
302302

303303
sys.exit()
304304

tests/fixtures/setup.py.output

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class PublishCommand(Command):
111111
self.status(NO_GS_MESSAGE)
112112
if run_status:
113113
if os.system(PUBLISH_COMMAND) != 0:
114-
self.status(UPLOAD_FAILED_MSG % PUBLISH_COMMAND)
114+
self.status(UPLOAD_FAILED_MSG)
115115

116116
sys.exit()
117117

tests/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
codecov
2-
moban>=0.0.4
2+
moban>=0.6.4
33
pytest~=3.6.1
44
flake8
55
yamllint

tests/test_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import os
22

33
from moban.jinja2.engine import Engine
4+
from moban.externals import file_system
45

56
PATH_TO_TEMPLATES = './templates'
67

78

89
def get_rendered_file(filename, context):
9-
engine = Engine([PATH_TO_TEMPLATES])
10+
engine = Engine(file_system.get_multi_fs([PATH_TO_TEMPLATES]))
1011
template = engine.get_template(filename)
1112
rendered = engine.apply_template(template, context, '')
1213
return rendered

0 commit comments

Comments
 (0)