Skip to content

Commit

Permalink
Merge pull request #8 from moremoban/dev
Browse files Browse the repository at this point in the history
release 0.0.2
  • Loading branch information
chfw authored Jun 16, 2020
2 parents 62e5f71 + aae4b1f commit f04c198
Show file tree
Hide file tree
Showing 28 changed files with 484 additions and 226 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=slimish_jinja, moban, fs, lml, ruamel.yaml, 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
10 changes: 8 additions & 2 deletions .moban.d/CUSTOM_README.rst.jj2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
{%endblock%}

{%block features%}
With `slimish-jinja2 for Python 3 <git+https://github.com/cliu13/slimish-jinja2@python3>`_, this library allow moban users to
have slim template in their next documentation endeavour.
With `slimish-jinja2 for Python 3 <https://pypi.org/project/slimish-jinja>`_, this library allow moban users to
have slim template in their next documentation endeavour.

Quick start
============

{% include "slim_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.8
- 3.7
- 3.6
{%endblock%}
20 changes: 20 additions & 0 deletions .moban.d/slim_example.rst.jj2
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Given a data.json file with the following content

.. code-block::

{
"person": {
"firstname": "Smith",
"lastname": "Jones",
},
}

.. code-block:: bash

{% raw %}
$ moban --template-type slim -c data.json "{{person.firstname}} {{person.lastname}}"
Slimming <p>{{first... to moban.output
Slimmed 1 file.
$ cat moban.output
Smith Jones
{% endraw %}
2 changes: 2 additions & 0 deletions .moban.d/tests/custom_requirements.txt.jj2
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
moban
black;python_version>="3.6"
isort;python_version>="3.6"
slimish-jinja>=1.1.0
jinja2-fsloader>=0.2.0
{%endblock%}
15 changes: 8 additions & 7 deletions .moban.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
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-slim.yml
targets:
- README.rst: CUSTOM_README.rst.jj2
- setup.py: custom_setup.py.jj2
- requirements.txt: requirements.txt.jj2
- "tests/requirements.txt": "tests/custom_requirements.txt.jj2"
- "docs/source/conf.py": "docs/conf.py_t"
- test.sh: test.script.jj2
- "moban_slim/_version.py": "_version.py.jj2"
- .gitignore: gitignore.jj2
- .travis.yml: travis.yml.jj2
- Pipfile: Pipfile.jj2
- .travis.yml: custom_travis.yml.jj2
- output: CHANGELOG.rst
configuration: changelog.yml
template: CHANGELOG.rst.jj2
- lint.sh: lint.script.jj2
- ".github/workflows/pythonpublish.yml": "pythonpublish.yml"
45 changes: 38 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,51 @@
sudo: false
dist: xenial
language: python
notifications:
email: false
python:
- pypy-5.3.1
- 3.7-dev
- 3.8
- 3.7
- 3.6
- 3.5
- 3.4
- 2.7

stages:
- lint
- moban
- test


.lint: &lint
git:
submodules: false
python: 3.6
env:
- MINREQ=0
stage: lint
script: make lint

.moban: &moban
python: 3.6
env:
- MINREQ=0
stage: moban
install: pip install moban>=0.0.4 gitfs2 pypifs
script:
- moban
- git diff --exit-code

jobs:
include:
- *moban
- *lint

stage: test

before_install:
- if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install flake8==2.6.2; fi
- if [[ -f min_requirements.txt && "$MINREQ" -eq 1 ]]; then
mv min_requirements.txt requirements.txt ;
fi
- test ! -f rnd_requirements.txt || pip install --no-deps -r rnd_requirements.txt
- test ! -f rnd_requirements.txt ||
pip install --no-deps -r rnd_requirements.txt
- test ! -f rnd_requirements.txt || pip install -r rnd_requirements.txt ;
- pip install -r tests/requirements.txt
script:
Expand Down
Loading

0 comments on commit f04c198

Please sign in to comment.