-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from moremoban/dev
release 0.0.2
- Loading branch information
Showing
27 changed files
with
436 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[settings] | ||
line_length=79 | ||
# Ignore generated files | ||
skip=setup.py, moban/__init__.py | ||
known_third_party=airspeed, moban, lml,§ mock, nose | ||
indent=' ' | ||
multi_line_output=3 | ||
length_sort=1 | ||
include_trailing_comma=true | ||
default_section=FIRSTPARTY | ||
no_lines_before=LOCALFOLDER | ||
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{% extends 'travis.yml.jj2' %} | ||
|
||
{%block custom_python_versions%} | ||
python: | ||
- 3.7 | ||
- 3.6 | ||
- 3.8 | ||
{%endblock%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
{% extends "tests/requirements.txt.jj2" %} | ||
|
||
{%block extras %} | ||
moban | ||
black;python_version>="3.6" | ||
isort;python_version>="3.6" | ||
{%endblock%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Given the following data.json: | ||
|
||
.. code-block:: | ||
|
||
{"people": | ||
[ | ||
{"name": "Bill", "age": 100}, | ||
{"name": "Bob", "age": 90}, | ||
{"name": "Mark", "age": 25} | ||
] | ||
} | ||
|
||
And given the following velocity.template: | ||
|
||
.. code-block:: | ||
|
||
Old people: | ||
#foreach ($person in $people) | ||
#if($person.age > 70) | ||
$person.name | ||
#end | ||
#end | ||
|
||
Third person is $people[2].name | ||
|
||
**moban** can do the template: | ||
|
||
.. code-block:: bash | ||
|
||
$ moban --template-type velocity -c data.json -t velocity.template | ||
Velocity-templating vo.t to moban.output | ||
Velocity-templated 1 file. | ||
$ cat moban.output | ||
Old people: | ||
|
||
Bill | ||
|
||
Bob | ||
|
||
|
||
Third person is Mark | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.