Skip to content

Commit

Permalink
Merge pull request #4 from moremoban/dev
Browse files Browse the repository at this point in the history
release 0.0.2
  • Loading branch information
chfw authored Jun 4, 2020
2 parents b6ec4ca + 07c34c8 commit 90dda6c
Show file tree
Hide file tree
Showing 27 changed files with 436 additions and 220 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/pythonpublish.yml
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/*
80 changes: 76 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
Expand All @@ -43,14 +44,17 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -60,6 +64,7 @@ coverage.xml
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -72,16 +77,34 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py
Expand All @@ -107,6 +130,17 @@ venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# VirtualEnv rules
# Virtualenv
Expand Down Expand Up @@ -140,6 +174,7 @@ pip-selfcheck.json
# Windows rules
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

Expand Down Expand Up @@ -238,16 +273,22 @@ flycheck_*.el
# directory configuration
.dir-locals.el

# network security
/network-security.data


# Vim rules
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

# Session
Session.vim
Sessionx.vim

# Temporary
.netrwhist
Expand All @@ -258,7 +299,7 @@ tags
[._]*.un~

# JetBrains rules
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
Expand All @@ -268,6 +309,9 @@ tags
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
Expand All @@ -281,6 +325,19 @@ tags
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

Expand Down Expand Up @@ -311,6 +368,9 @@ fabric.properties
# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

# SublimeText rules
# Cache files for Sublime Text
*.tmlanguage.cache
Expand All @@ -326,6 +386,7 @@ fabric.properties

# SFTP configuration file
sftp-config.json
sftp-config-alt*.json

# Package control specific files
Package Control.last-run
Expand Down Expand Up @@ -363,6 +424,10 @@ tmtags
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

# Xcode rules
# Xcode
Expand All @@ -389,8 +454,10 @@ DerivedData/
*.perspectivev3
!default.perspectivev3

# Eclipse rules
## Gcc Patch
/*.gcno

# Eclipse rules
.metadata
bin/
tmp/
Expand Down Expand Up @@ -441,12 +508,17 @@ local.properties

# Annotation Processing
.apt_generated/
.apt_generated_test/

# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet

# Uncomment this line if you wish to ignore the project description file.
# Typically, this file would be tracked if it contains build/dependency configurations:
#.project

# TortoiseGit rules
# Project-level settings
/.tgitconfig
Expand Down
12 changes: 12 additions & 0 deletions .isort.cfg
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
5 changes: 4 additions & 1 deletion .moban.d/CUSTOM_README.rst.jj2
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@

{% block features %}
With `airspeed` for Python 3, this library allows moban users to have velocity
template in their next documentation endeavour.
template in their next documentation endeavour.

{%include "velocity_example.rst.jj2" %}

{% endblock %}
8 changes: 8 additions & 0 deletions .moban.d/custom_travis.yml.jj2
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%}
3 changes: 3 additions & 0 deletions .moban.d/tests/custom_requirements.txt.jj2
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%}
43 changes: 43 additions & 0 deletions .moban.d/velocity_example.rst.jj2
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


13 changes: 8 additions & 5 deletions .moban.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
requires:
- pypi-mobans-pkg==0.0.2
configuration:
template_dir:
- "pypi-mobans-pkg:templates"
- "git://github.com/moremoban/pypi-mobans?submodule=true&branch=dev!/templates"
- "git://github.com/moremoban/pypi-mobans?submodule=true&branch=dev!/statics"
- ".moban.d"
configuration: moban-velocity.yml
targets:
Expand All @@ -14,8 +13,12 @@ targets:
- test.sh: test.script.jj2
- "moban_velocity/_version.py": "_version.py.jj2"
- .gitignore: gitignore.jj2
- .travis.yml: travis.yml.jj2
- .travis.yml: custom_travis.yml.jj2
- Pipfile: Pipfile.jj2
- output: CHANGELOG.rst
configuration: changelog.yml
template: CHANGELOG.rst.jj2
template: CHANGELOG.rst.jj2
- lint.sh: lint.script.jj2
- LICENSE: "mit_license.jj2"
- MANIFEST.in: MANIFEST.in.jj2
- ".github/workflows/pythonpublish.yml": "pythonpublish.yml"
Loading

0 comments on commit 90dda6c

Please sign in to comment.