Skip to content

Commit aae4b1f

Browse files
authored
Sync with latest pypi mobans (#7)
* 🤝 sync with latest pypi-mobans and 📚 show the slim example in readme * 📚 update slimish-jinja link * 💚 pass lint check * 🐛 isort shell script does not work in Makefile * 🔨 update isort configuration on slimish_jinja * 💄 address review feedback * ✨ enable github auto publishing to pypi
1 parent cbe4534 commit aae4b1f

File tree

18 files changed

+296
-193
lines changed

18 files changed

+296
-193
lines changed

.github/workflows/pythonpublish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Set up Python
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: '3.x'
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install setuptools wheel twine
20+
- name: Build and publish
21+
env:
22+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
24+
run: |
25+
python setup.py sdist bdist_wheel
26+
twine upload dist/*

.gitignore

Lines changed: 76 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ parts/
2525
sdist/
2626
var/
2727
wheels/
28+
share/python-wheels/
2829
*.egg-info/
2930
.installed.cfg
3031
*.egg
@@ -43,14 +44,17 @@ pip-delete-this-directory.txt
4344
# Unit test / coverage reports
4445
htmlcov/
4546
.tox/
47+
.nox/
4648
.coverage
4749
.coverage.*
4850
.cache
4951
nosetests.xml
5052
coverage.xml
5153
*.cover
54+
*.py,cover
5255
.hypothesis/
5356
.pytest_cache/
57+
cover/
5458

5559
# Translations
5660
*.mo
@@ -60,6 +64,7 @@ coverage.xml
6064
*.log
6165
local_settings.py
6266
db.sqlite3
67+
db.sqlite3-journal
6368

6469
# Flask stuff:
6570
instance/
@@ -72,16 +77,34 @@ instance/
7277
docs/_build/
7378

7479
# PyBuilder
80+
.pybuilder/
7581
target/
7682

7783
# Jupyter Notebook
7884
.ipynb_checkpoints
7985

86+
# IPython
87+
profile_default/
88+
ipython_config.py
89+
8090
# pyenv
81-
.python-version
91+
# For a library or package, you might want to ignore these files since the code is
92+
# intended to run in multiple environments; otherwise, check them in:
93+
# .python-version
94+
95+
# pipenv
96+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
97+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
98+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
99+
# install all needed dependencies.
100+
#Pipfile.lock
82101

83-
# celery beat schedule file
102+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
103+
__pypackages__/
104+
105+
# Celery stuff
84106
celerybeat-schedule
107+
celerybeat.pid
85108

86109
# SageMath parsed files
87110
*.sage.py
@@ -107,6 +130,17 @@ venv.bak/
107130

108131
# mypy
109132
.mypy_cache/
133+
.dmypy.json
134+
dmypy.json
135+
136+
# Pyre type checker
137+
.pyre/
138+
139+
# pytype static type analyzer
140+
.pytype/
141+
142+
# Cython debug symbols
143+
cython_debug/
110144

111145
# VirtualEnv rules
112146
# Virtualenv
@@ -140,6 +174,7 @@ pip-selfcheck.json
140174
# Windows rules
141175
# Windows thumbnail cache files
142176
Thumbs.db
177+
Thumbs.db:encryptable
143178
ehthumbs.db
144179
ehthumbs_vista.db
145180

@@ -238,16 +273,22 @@ flycheck_*.el
238273
# directory configuration
239274
.dir-locals.el
240275

276+
# network security
277+
/network-security.data
278+
279+
241280
# Vim rules
242281
# Swap
243282
[._]*.s[a-v][a-z]
283+
!*.svg # comment out if you don't need vector files
244284
[._]*.sw[a-p]
245285
[._]s[a-rt-v][a-z]
246286
[._]ss[a-gi-z]
247287
[._]sw[a-p]
248288

249289
# Session
250290
Session.vim
291+
Sessionx.vim
251292

252293
# Temporary
253294
.netrwhist
@@ -258,7 +299,7 @@ tags
258299
[._]*.un~
259300

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

264305
# User-specific stuff
@@ -268,6 +309,9 @@ tags
268309
.idea/**/dictionaries
269310
.idea/**/shelf
270311

312+
# Generated files
313+
.idea/**/contentModel.xml
314+
271315
# Sensitive or high-churn files
272316
.idea/**/dataSources/
273317
.idea/**/dataSources.ids
@@ -281,6 +325,19 @@ tags
281325
.idea/**/gradle.xml
282326
.idea/**/libraries
283327

328+
# Gradle and Maven with auto-import
329+
# When using Gradle or Maven with auto-import, you should exclude module files,
330+
# since they will be recreated, and may cause churn. Uncomment if using
331+
# auto-import.
332+
# .idea/artifacts
333+
# .idea/compiler.xml
334+
# .idea/jarRepositories.xml
335+
# .idea/modules.xml
336+
# .idea/*.iml
337+
# .idea/modules
338+
# *.iml
339+
# *.ipr
340+
284341
# CMake
285342
cmake-build-*/
286343

@@ -311,6 +368,9 @@ fabric.properties
311368
# Editor-based Rest Client
312369
.idea/httpRequests
313370

371+
# Android studio 3.1+ serialized cache file
372+
.idea/caches/build_file_checksums.ser
373+
314374
# SublimeText rules
315375
# Cache files for Sublime Text
316376
*.tmlanguage.cache
@@ -326,6 +386,7 @@ fabric.properties
326386

327387
# SFTP configuration file
328388
sftp-config.json
389+
sftp-config-alt*.json
329390

330391
# Package control specific files
331392
Package Control.last-run
@@ -363,6 +424,10 @@ tmtags
363424
!.vscode/tasks.json
364425
!.vscode/launch.json
365426
!.vscode/extensions.json
427+
*.code-workspace
428+
429+
# Local History for Visual Studio Code
430+
.history/
366431

367432
# Xcode rules
368433
# Xcode
@@ -389,8 +454,10 @@ DerivedData/
389454
*.perspectivev3
390455
!default.perspectivev3
391456

392-
# Eclipse rules
457+
## Gcc Patch
458+
/*.gcno
393459

460+
# Eclipse rules
394461
.metadata
395462
bin/
396463
tmp/
@@ -441,12 +508,17 @@ local.properties
441508

442509
# Annotation Processing
443510
.apt_generated/
511+
.apt_generated_test/
444512

445513
# Scala IDE specific (Scala & Java development for Eclipse)
446514
.cache-main
447515
.scala_dependencies
448516
.worksheet
449517

518+
# Uncomment this line if you wish to ignore the project description file.
519+
# Typically, this file would be tracked if it contains build/dependency configurations:
520+
#.project
521+
450522
# TortoiseGit rules
451523
# Project-level settings
452524
/.tgitconfig

.isort.cfg

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[settings]
2+
line_length=79
3+
# Ignore generated files
4+
skip=setup.py, moban/__init__.py
5+
known_third_party=slimish_jinja, moban, fs, lml, ruamel.yaml, mock, nose
6+
indent=' '
7+
multi_line_output=3
8+
length_sort=1
9+
include_trailing_comma=true
10+
default_section=FIRSTPARTY
11+
no_lines_before=LOCALFOLDER
12+
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER

.moban.d/CUSTOM_README.rst.jj2

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
{%endblock%}
55

66
{%block features%}
7-
With `slimish-jinja2 for Python 3 <slimish-jinja>=1.1.0>`_, this library allow moban users to
7+
With `slimish-jinja2 for Python 3 <https://pypi.org/project/slimish-jinja>`_, this library allow moban users to
88
have slim template in their next documentation endeavour.
9+
10+
Quick start
11+
============
12+
13+
{% include "slim_example.rst.jj2" %}
14+
915
{%endblock%}

.moban.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
requires:
2-
- pypi-mobans-pkg==0.0.2
31
configuration:
42
template_dir:
5-
- "pypi-mobans-pkg:templates"
3+
- "git://github.com/moremoban/pypi-mobans?submodule=true&branch=dev!/templates"
4+
- "git://github.com/moremoban/pypi-mobans?submodule=true&branch=dev!/statics"
65
- ".moban.d"
76
configuration: moban-slim.yml
87
targets:
@@ -15,4 +14,6 @@ targets:
1514
- .travis.yml: custom_travis.yml.jj2
1615
- output: CHANGELOG.rst
1716
configuration: changelog.yml
18-
template: CHANGELOG.rst.jj2
17+
template: CHANGELOG.rst.jj2
18+
- lint.sh: lint.script.jj2
19+
- ".github/workflows/pythonpublish.yml": "pythonpublish.yml"

.travis.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,51 @@
11
sudo: false
2+
dist: xenial
23
language: python
34
notifications:
45
email: false
56
python:
67
- 3.8
78
- 3.7
89
- 3.6
10+
11+
stages:
12+
- lint
13+
- moban
14+
- test
15+
16+
17+
.lint: &lint
18+
git:
19+
submodules: false
20+
python: 3.6
21+
env:
22+
- MINREQ=0
23+
stage: lint
24+
script: make lint
25+
26+
.moban: &moban
27+
python: 3.6
28+
env:
29+
- MINREQ=0
30+
stage: moban
31+
install: pip install moban>=0.0.4 gitfs2 pypifs
32+
script:
33+
- moban
34+
- git diff --exit-code
35+
36+
jobs:
37+
include:
38+
- *moban
39+
- *lint
40+
41+
stage: test
42+
943
before_install:
10-
- if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install flake8==2.6.2; fi
1144
- if [[ -f min_requirements.txt && "$MINREQ" -eq 1 ]]; then
1245
mv min_requirements.txt requirements.txt ;
1346
fi
14-
- test ! -f rnd_requirements.txt || pip install --no-deps -r rnd_requirements.txt
47+
- test ! -f rnd_requirements.txt ||
48+
pip install --no-deps -r rnd_requirements.txt
1549
- test ! -f rnd_requirements.txt || pip install -r rnd_requirements.txt ;
1650
- pip install -r tests/requirements.txt
1751
script:

CHANGELOG.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ Change log
44
0.0.2 - 16-06-2020
55
--------------------------------------------------------------------------------
66

7-
Updated
8-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7+
**Updated**
98

109
#. `#1 <https://github.com/moremoban/moban-slim/issues/1>`_: support moban
1110
v0.3.8
@@ -19,7 +18,6 @@ Updated
1918
0.0.1 - 30-11-2018
2019
--------------------------------------------------------------------------------
2120

22-
First release
23-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21+
**First release**
2422

2523
#. render slim files for moban

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ document:
77
bash document.sh
88

99
format:
10-
isort -y $(find moban_slim -name "*.py"|xargs echo) $(find tests -name "*.py"|xargs echo)
11-
black -l 79 moban_slim
12-
black -l 79 tests
10+
bash format.sh
11+
12+
lint:
13+
bash lint.sh
14+

0 commit comments

Comments
 (0)