Skip to content

Commit d76e85a

Browse files
authored
Merge pull request #151 from moremoban/dev
release 0.1.0
2 parents 5c114e0 + 405157a commit d76e85a

20 files changed

+238
-5
lines changed

.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 moban-ansible
18+
make upstreaming
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

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ stages:
2727
env:
2828
- MINREQ=0
2929
stage: moban
30-
install: pip install moban>=0.0.4 gitfs2 pypifs
30+
install: pip install moban gitfs2 pypifs moban-jinja2-github moban-ansible
3131
script: make upstreaming git-diff-check
3232

3333
jobs:

CHANGELOG.rst

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

4+
0.1.0 - 13.09.20220
5+
--------------------------------------------------------------------------------
6+
7+
**added**
8+
9+
#. new project starter kits is relocated from yehua here
10+
411
0.0.12 - 26.08.20220
512
--------------------------------------------------------------------------------
613

changelog.yml

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: pypi-mobans
22
organisation: moremoban
33
releases:
4+
- changes:
5+
- action: added
6+
details:
7+
- "new project starter kits is relocated from yehua here"
8+
date: 13.09.20220
9+
version: 0.1.0
410
- changes:
511
- action: added
612
details:

new-project/static/CHANGELOG.rst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Change log
2+
===========

new-project/static/CUSTOM_README.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% extends 'README.rst.jj2' %}
2+
3+
{%block documentation_link%}
4+
.. image:: https://dev.azure.com/{{organisation}}/{{name}}/_apis/build/status/{{organisation}}.{{name}}?branchName=master
5+
:target: https://dev.azure.com/{{organisation}}/{{name}}/_build/latest?definitionId=2&branchName=master
6+
{%endblock%}

new-project/static/MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include README.rst
2+
include CHANGELOG.rst
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "setup.py.jj2" %}

new-project/static/setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[bdist_wheel]
2+
universal = 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% extends "tests/requirements.txt.jj2" %}
2+
3+
{%block extras %}
4+
moban
5+
black;python_version>="3.6"
6+
isort;python_version>="3.6"
7+
{%endblock%}

new-project/templates/Makefile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
all: test
2+
3+
test: lint
4+
bash test.sh
5+
6+
install_test:
7+
pip install -r tests/requirements.txt
8+
9+
git-diff-check:
10+
git diff --exit-code
11+
12+
lint:
13+
bash lint.sh
14+
15+
format:
16+
isort -y $(find {{project_name | replace('-', '_')}} -name "*.py"|xargs echo) $(find tests -name "*.py"|xargs echo)
17+
black -l 79 {{project_name | replace('-', '_')}}
18+
black -l 79 tests
19+
20+
git-diff-check:
21+
git diff --exit-code

new-project/templates/__init__.py.jj2

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# flake8: noqa
2+
from {{project_name | replace('-', '_')}}._version import __version__
3+
from {{project_name | replace('-', '_')}}._version import __author__
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: {{project_name}}
2+
organisation: {{organisation}}
3+
releases:
4+
- changes:
5+
- action: first release
6+
details:
7+
- what a feat!
8+
version: 0.0.1
9+
date: {{today}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
configuration:
2+
template_dir:
3+
- "pypi://pypi-mobans-pkg/resources/templates"
4+
- "pypi://pypi-mobans-pkg/resources/statics"
5+
- ".moban.d"
6+
configuration: {{ project_name }}.yml
7+
targets:
8+
- README.rst: CUSTOM_README.rst.jj2
9+
- setup.py: custom_setup.py.jj2
10+
- requirements.txt: requirements.txt.jj2
11+
- "tests/requirements.txt": "tests/custom_requirements.txt.jj2"
12+
- "docs/source/conf.py": "docs/conf.py_t"
13+
- test.sh: test.script.jj2
14+
- test.bat: test.script.jj2
15+
- "{{ project_name | replace('-', '_') }}/_version.py": "_version.py.jj2"
16+
- .gitignore: gitignore.jj2
17+
- .travis.yml: travis.yml.jj2
18+
- Pipfile: Pipfile.jj2
19+
- output: CHANGELOG.rst
20+
configuration: changelog.yml
21+
template: CHANGELOG.rst.jj2
22+
- lint.sh: lint.script.jj2
23+
- LICENSE: "{{ license|lower }}_license.jj2"
24+
- MANIFEST.in: MANIFEST.in.jj2
25+
- ".github/workflows/pythonpublish.yml": "pythonpublish.yml"
26+
- ".github/workflows/moban-update.yml": "moban-update.yml"
27+
- "azure-pipelines.yml": "azure/azure-pipelines.yml"
28+
- ".azure-pipelines-steps-macos.yml": "azure/pipelines-steps-macos.yml"
29+
- ".azure-pipelines-steps.yml": "azure/pipelines-steps.yml"
30+
- Makefile: Makefile.jj2
31+
- format.sh: format.sh.jj2
32+
- .isort.cfg: isort.cfg.jj2
33+
- CONTRIBUTORS.rst: CONTRIBUTORS.rst.jj2

new-project/templates/project.yml.jj2

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "{{project_name}}"
2+
organisation: "{{organisation}}"
3+
author: "{{author}}"
4+
contact: "{{contact}}"
5+
company: "{{company}}"
6+
version: "0.0.1"
7+
current_version: "0.0.1"
8+
release: "0.0.0"
9+
copyright_year: {{now.year}}
10+
{% if project_type == 'command line interface'%}
11+
command_line_interface: "{{cli}}"
12+
entry_point: "{{project_name | replace('-', '_')}}.main:main"
13+
{% endif %}
14+
{% if project_type == 'C extension'%}
15+
external_module_library: {{project_name}}
16+
sources:
17+
{% for source in sources: %}
18+
- '{{source}}'
19+
{% endfor %}
20+
{% endif %}
21+
license: {{license}}
22+
dependencies: []
23+
description: "{{description}}"
24+
lint_command: make install_test lint format git-diff-check

statics/moban-update.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
python-version: '3.7'
1515
- name: check changes
1616
run: |
17-
pip install moban gitfs2 pypifs
17+
pip install moban gitfs2 pypifs moban-jinja2-github moban-ansible
1818
moban
1919
git status
2020
git diff --exit-code

templates/travis.yml.jj2

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ stages:
6262
env:
6363
- MINREQ=0
6464
stage: moban
65-
install: pip install moban>=0.0.4 gitfs2 pypifs
65+
install: pip install moban gitfs2 pypifs moban-jinja2-github moban-ansible
6666
{% if moban_command.startswith('moban') and 'exit-code' not in moban_command %}
6767
script:
6868
- {{ moban_command }}

tests/requirements.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
gease
12
codecov
2-
moban>=0.6.4
3+
moban>=0.8.2
34
pytest~=3.6.1
45
flake8
5-
moban_jinja2_github
66
yamllint
7+
moban-jinja2-github
8+
moban-ansible
9+
gitfs2

tests/test_utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
# flake8: noqa
12
import os
23

4+
import moban_ansible.tests.files
5+
import moban_ansible.engines.line_in_file
36
from moban.plugins.jinja2.engine import Engine
47
from moban.externals import file_system
58

yehua.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
introduction: |+
2+
[info]Yehua /'jɛhwa/[/info] will walk you through.
3+
Press ^C to quit at any time.
4+
5+
configuration:
6+
template_path: ./new-project/templates
7+
static_path: ./new-project/static
8+
questions:
9+
- project_name: "project name [yehua-boilerplate]: "
10+
- description: "description [Moremoban organisation's best template]: "
11+
- license:
12+
- question: "license: "
13+
"1. mit": "N/A"
14+
"2. newbsd": "N/A"
15+
- author: "author: "
16+
- contact: "contact email: "
17+
- organisation: "github profile/organisation: "
18+
- company: "copyright owner [{{author}}]: "
19+
- project_type:
20+
- question: "project type: "
21+
"1. library": "N/A"
22+
"2. command line interface":
23+
- cli: "cli executable name: "
24+
layout:
25+
- "{{project_name|lower|replace('-', '_')}}"
26+
- tests
27+
- docs:
28+
- source
29+
- .moban.d:
30+
- tests
31+
- docs:
32+
- source
33+
templates:
34+
- "{{project_name}}.yml": project.yml.jj2
35+
- "{{project_name | replace('-', '_')}}/__init__.py": "__init__.py.jj2"
36+
- .moban.yml: project-moban.yml.jj2
37+
- changelog.yml: changelog.yml.jj2
38+
- Makefile: Makefile
39+
static:
40+
- ".moban.d/CUSTOM_README.rst.jj2": "CUSTOM_README.rst"
41+
- ".moban.d/custom_setup.py.jj2": custom_setup.py.jj2
42+
- ".moban.d/tests/custom_requirements.txt.jj2": "tests/requirements.txt.jj2"
43+
- CHANGELOG.rst: CHANGELOG.rst
44+
- setup.cfg: setup.cfg
45+
post-moban:
46+
git-repo-files:
47+
- "CHANGELOG.rst"
48+
- "MANIFEST.in"
49+
- "Makefile"
50+
- "README.rst"
51+
- "{{project_name}}.yml"
52+
- "{{project_name | replace('-', '_')}}"
53+
- "docs"
54+
- "requirements.txt"
55+
- "setup.cfg"
56+
- "setup.py"
57+
- "test.sh"
58+
- "tests"
59+
- ".gitignore"
60+
- ".github"
61+
- ".moban.d"
62+
- ".travis.yml"
63+
- ".moban.yml"
64+
- "Pipfile"
65+
- "changelog.yml"
66+
- "lint.sh"
67+
- "test.bat"
68+
- "azure-pipelines.yml"
69+
- ".azure-pipelines-steps-macos.yml"
70+
- ".azure-pipelines-steps.yml"
71+
- "LICENSE"
72+
- format.sh
73+
- lint.sh
74+
- .isort.cfg
75+
- CONTRIBUTORS.rst

0 commit comments

Comments
 (0)