Skip to content

Commit f0688b6

Browse files
authored
Slim package for v0.8.0 (#397)
* 🔥 split up the non-essential utilities to moban extensions where they could grow bigger * 📰 add moban update action * 📰 update moban update command * This is an auto-commit, updating project meta data, such as changelog.rst, contributors.rst * 🐛 generate the template from the same environment so that custom jinja2 thingies are visible. fix #396 * 🔥 remove github tests * 🐛 apply temporary workaround for pypa/setuptools#2355 * 🔥 remove unused imports Co-authored-by: chfw <[email protected]>
1 parent 7fdc60e commit f0688b6

25 files changed

+91
-138
lines changed

.azure-pipelines-steps-macos.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ steps:
22
- task: UsePythonVersion@0
33
displayName: 'Use Python 3.x'
44
- script: |
5+
export SETUPTOOLS_USE_DISTUTILS="stdlib"
56
python -m pip install --upgrade pip setuptools wheel
67
test ! -f rnd_requirements.txt || pip install -r rnd_requirements.txt
78
pip install -r requirements.txt

.azure-pipelines-steps.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ steps:
22
- task: UsePythonVersion@0
33
displayName: 'Use Python 3.x'
44
- script: |
5+
set SETUPTOOLS_USE_DISTUTILS="stdlib"
56
python -m pip install --upgrade pip setuptools wheel
67
if exist rnd_requirements.txt pip install -r rnd_requirements.txt
78
pip install -r requirements.txt

.github/PULL_REQUEST_TEMPLATE.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ Before raising the PR, here is a check list:
44
- [ ] have you updated the change log?
55
- [ ] can someone else understand your changes without your explanation?
66
- [ ] are you proud of your code changes?
7-
- [ ] please add your name and github link to contributors.rst in alphabetical order.
87

.github/workflows/moban-update.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
on: [push]
2+
3+
jobs:
4+
run_moban:
5+
runs-on: ubuntu-latest
6+
name: synchronize templates via moban
7+
steps:
8+
- uses: actions/checkout@v2
9+
with:
10+
ref: ${{ github.head_ref }}
11+
- name: Set up Python
12+
uses: actions/setup-python@v1
13+
with:
14+
python-version: '3.7'
15+
- name: check changes
16+
run: |
17+
pip install moban gitfs2 pypifs moban-jinja2-github
18+
make update
19+
git status
20+
git diff --exit-code
21+
- name: Auto-commit
22+
if: failure()
23+
uses: docker://cdssnc/auto-commit-github-action
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
args: >-
28+
This is an auto-commit, updating project meta data,
29+
such as changelog.rst, contributors.rst

.moban.cd/changelog.yml

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: moban
22
organisation: moremoban
33
releases:
4+
- changes:
5+
- action: Removed
6+
details:
7+
- moban.plugins.jinja2.tests.files is moved to moban-ansible package
8+
- moban.plugins.jinja2.filters.github is moved to moban-jinja2-github package
9+
date: tbd
10+
version: 0.8.0
411
- changes:
512
- action: Updated
613
details:

.moban.cd/moban.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: moban
22
project: moban
33
organisation: moremoban
4-
author: C. W.
4+
author: chfw
55
66
license: MIT
7-
version: 0.7.10
8-
current_version: 0.7.10
7+
version: 0.8.0
8+
current_version: 0.8.0
99
release: 0.7.10
1010
branch: master
1111
master: index
@@ -27,6 +27,7 @@ dependencies:
2727
- crayons>= 0.1.0
2828
- fs>=2.4.11
2929
- jinja2-fsloader>=0.2.0
30+
- moban-jinja2-github
3031
description: General purpose static text generator
3132
scm_host: github.com
3233
lint_command: make install_test format git-diff-check lint

.moban.d/moban_readme.jj2

+8
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,21 @@ mó bǎn - 模板 General purpose static text generator
3434
Announcement
3535
================================================================================
3636

37+
38+
In version 0.8.0, `moban.plugins.jinja2.tests.files` is moved to moban-ansible
39+
package. `moban.plugins.jinja2.filters.github` is moved to moban-jinja2-github
40+
package Please install them for backward compatibility.
41+
42+
3743
From 2020 onwards, minimum requirement is Python 3.6
3844

3945

4046
For existing moban users, python 2 support has been dropped. Please stay with
4147
versions lower than 0.7.0 if you are still using python 2.
4248

4349

50+
51+
4452
Quick start
4553
================================================================================
4654

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ stages:
3030
env:
3131
- MINREQ=0
3232
stage: moban
33-
install: pip install moban>=0.0.4 gitfs2 pypifs
33+
install: pip install moban>=0.0.4 gitfs2 pypifs moban-jinja2-github
3434
script: make update git-diff-check
3535

3636
jobs:

CHANGELOG.rst

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Change log
22
================================================================================
33

4+
0.8.0 - tbd
5+
--------------------------------------------------------------------------------
6+
7+
**Removed**
8+
9+
#. moban.plugins.jinja2.tests.files is moved to moban-ansible package
10+
#. moban.plugins.jinja2.filters.github is moved to moban-jinja2-github package
11+
412
0.7.10 - 16.08.2020
513
--------------------------------------------------------------------------------
614

CONTRIBUTORS.rst

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
Contributors
1+
2+
8 contributors
23
================================================================================
34

45
In alphabetical order:
56

6-
* `Ayan Banerjee <https://github.com/ayan-b>`_
7-
* `Charlie Liu <https://github.com/CLiu13>`_
8-
* `John Vandenberg <https://github.com/jayvdb>`_
9-
* `Joshua Chung <https://github.com/seeeturtle>`_
10-
* `PRAJWAL M <https://github.com/PrajwalM2212>`_
11-
* `salotz <https://github.com/salotz>`_
12-
* `SerekKiri <https://github.com/SerekKiri>`_
7+
* `Andrew Scheller <https://api.github.com/users/lurch>`_
8+
* `Ayan Banerjee <https://api.github.com/users/ayan-b>`_
9+
* `Charlie Liu <https://api.github.com/users/CLiu13>`_
10+
* `John Vandenberg <https://api.github.com/users/jayvdb>`_
11+
* `Joshua Chung <https://api.github.com/users/seeeturtle>`_
12+
* `PRAJWAL M <https://api.github.com/users/PrajwalM2212>`_
13+
* `salotz <https://api.github.com/users/salotz>`_
14+
* `SerekKiri <https://api.github.com/users/SerekKiri>`_

README.rst

+8
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,21 @@ mó bǎn - 模板 General purpose static text generator
3434
Announcement
3535
================================================================================
3636

37+
38+
In version 0.8.0, `moban.plugins.jinja2.tests.files` is moved to moban-ansible
39+
package. `moban.plugins.jinja2.filters.github` is moved to moban-jinja2-github
40+
package Please install them for backward compatibility.
41+
42+
3743
From 2020 onwards, minimum requirement is Python 3.6
3844

3945

4046
For existing moban users, python 2 support has been dropped. Please stay with
4147
versions lower than 0.7.0 if you are still using python 2.
4248

4349

50+
51+
4452
Quick start
4553
================================================================================
4654

docs/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323

2424
project = 'moban'
2525
copyright = '2017-2020 Onni Software Ltd.'
26-
author = 'C. W.'
26+
author = 'chfw'
2727
# The short X.Y version
28-
version = '0.7.10'
28+
version = '0.8.0'
2929
# The full version, including alpha/beta/rc tags
3030
release = '0.7.10'
3131

min_requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ appdirs==1.4.3
77
crayons== 0.1.0
88
fs==2.4.11
99
jinja2-fsloader==0.2.0
10+
moban-jinja2-github

moban/_version.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.7.10"
2-
__author__ = "C. W."
1+
__version__ = "0.8.0"
2+
__author__ = "chfw"

moban/constants.py

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
# Command line options
2626
LABEL_CONFIG = "configuration"
2727
LABEL_CONFIG_DIR = "configuration_dir"
28-
LABEL_PLUGIN_DIRS = "plugin_dir"
2928
LABEL_TEMPLATE = "template"
3029
POSITIONAL_LABEL_TEMPLATE = "template_in_string"
3130
LABEL_TMPL_DIRS = "template_dir"

moban/core/mobanfile/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def handle_moban_file_v1(moban_file_configurations, command_line_options):
4545
merged_options = merge(command_line_options, constants.DEFAULT_OPTIONS)
4646

4747
plugins_dirs = merged_options.get(constants.LABEL_PLUGIN_DIRS)
48+
4849
if plugins_dirs:
4950
handle_plugin_dirs(plugins_dirs)
5051

moban/plugins/jinja2/engine.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from importlib import import_module
55

66
import fs.errors
7-
from jinja2 import Template, Environment
7+
from jinja2 import Environment
88
from lml.loader import scan_plugins_regex
99
from lml.plugin import PluginInfo, PluginManager
1010
from jinja2_fsloader import FSLoader
@@ -16,9 +16,7 @@
1616
JINJA2_LIBRARIES = "^moban_jinja2_.+$"
1717
JINJA2_EXTENSIONS = [
1818
"moban.plugins.jinja2.filters.repr",
19-
"moban.plugins.jinja2.filters.github",
2019
"moban.plugins.jinja2.filters.text",
21-
"moban.plugins.jinja2.tests.files",
2220
]
2321
JINJA2_THIRD_PARTY_EXTENSIONS = ["jinja2.ext.do", "jinja2.ext.loopcontrols"]
2422
LOG = logging.getLogger(__name__)
@@ -135,7 +133,7 @@ def get_template(self, template_file):
135133
raise exceptions.PassOn(str(e))
136134

137135
def get_template_from_string(self, string):
138-
return Template(string)
136+
return self.jj2_environment.from_string(string)
139137

140138
def apply_template(self, template, data, output):
141139
"""

moban/plugins/jinja2/filters/github.py

-43
This file was deleted.

moban/plugins/jinja2/tests/__init__.py

Whitespace-only changes.

moban/plugins/jinja2/tests/files.py

-27
This file was deleted.

moban/plugins/jinja2/tests/win32.py

-5
This file was deleted.

mobanfile

+2
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ targets:
2525
template: CHANGELOG.rst.jj2
2626
- min_requirements.txt: min_requirements.txt.jj2
2727
- ".github/workflows/pythonpublish.yml": "pythonpublish.yml"
28+
- "CONTRIBUTORS.rst": "CONTRIBUTORS.rst.jj2"
29+

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ appdirs>=1.4.3
77
crayons>= 0.1.0
88
fs>=2.4.11
99
jinja2-fsloader>=0.2.0
10+
moban-jinja2-github

setup.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
4141

4242
NAME = "moban"
43-
AUTHOR = "C. W."
44-
VERSION = "0.7.10"
43+
AUTHOR = "chfw"
44+
VERSION = "0.8.0"
4545
4646
LICENSE = "MIT"
4747
ENTRY_POINTS = {
@@ -85,6 +85,7 @@
8585
"crayons>= 0.1.0",
8686
"fs>=2.4.11",
8787
"jinja2-fsloader>=0.2.0",
88+
"moban-jinja2-github",
8889
]
8990
SETUP_COMMANDS = {}
9091

tests/jinja2/test_github.py

-39
This file was deleted.

0 commit comments

Comments
 (0)