Skip to content

Commit

Permalink
Merge pull request #151 from moremoban/dev
Browse files Browse the repository at this point in the history
release 0.1.0
  • Loading branch information
chfw authored Sep 13, 2020
2 parents 5c114e0 + 405157a commit d76e85a
Show file tree
Hide file tree
Showing 20 changed files with 238 additions and 5 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/moban-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on: [push]

jobs:
run_moban:
runs-on: ubuntu-latest
name: synchronize templates via moban
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: check changes
run: |
pip install moban gitfs2 pypifs moban-jinja2-github moban-ansible
make upstreaming
git status
git diff --exit-code
- name: Auto-commit
if: failure()
uses: docker://cdssnc/auto-commit-github-action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: >-
This is an auto-commit, updating project meta data,
such as changelog.rst, contributors.rst
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ stages:
env:
- MINREQ=0
stage: moban
install: pip install moban>=0.0.4 gitfs2 pypifs
install: pip install moban gitfs2 pypifs moban-jinja2-github moban-ansible
script: make upstreaming git-diff-check

jobs:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Change log
================================================================================

0.1.0 - 13.09.20220
--------------------------------------------------------------------------------

**added**

#. new project starter kits is relocated from yehua here

0.0.12 - 26.08.20220
--------------------------------------------------------------------------------

Expand Down
6 changes: 6 additions & 0 deletions changelog.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: pypi-mobans
organisation: moremoban
releases:
- changes:
- action: added
details:
- "new project starter kits is relocated from yehua here"
date: 13.09.20220
version: 0.1.0
- changes:
- action: added
details:
Expand Down
2 changes: 2 additions & 0 deletions new-project/static/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Change log
===========
6 changes: 6 additions & 0 deletions new-project/static/CUSTOM_README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% extends 'README.rst.jj2' %}

{%block documentation_link%}
.. image:: https://dev.azure.com/{{organisation}}/{{name}}/_apis/build/status/{{organisation}}.{{name}}?branchName=master
:target: https://dev.azure.com/{{organisation}}/{{name}}/_build/latest?definitionId=2&branchName=master
{%endblock%}
2 changes: 2 additions & 0 deletions new-project/static/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include README.rst
include CHANGELOG.rst
1 change: 1 addition & 0 deletions new-project/static/custom_setup.py.jj2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends "setup.py.jj2" %}
2 changes: 2 additions & 0 deletions new-project/static/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bdist_wheel]
universal = 1
7 changes: 7 additions & 0 deletions new-project/static/tests/requirements.txt.jj2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "tests/requirements.txt.jj2" %}

{%block extras %}
moban
black;python_version>="3.6"
isort;python_version>="3.6"
{%endblock%}
21 changes: 21 additions & 0 deletions new-project/templates/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
all: test

test: lint
bash test.sh

install_test:
pip install -r tests/requirements.txt

git-diff-check:
git diff --exit-code

lint:
bash lint.sh

format:
isort -y $(find {{project_name | replace('-', '_')}} -name "*.py"|xargs echo) $(find tests -name "*.py"|xargs echo)
black -l 79 {{project_name | replace('-', '_')}}
black -l 79 tests

git-diff-check:
git diff --exit-code
3 changes: 3 additions & 0 deletions new-project/templates/__init__.py.jj2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# flake8: noqa
from {{project_name | replace('-', '_')}}._version import __version__
from {{project_name | replace('-', '_')}}._version import __author__
9 changes: 9 additions & 0 deletions new-project/templates/changelog.yml.jj2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: {{project_name}}
organisation: {{organisation}}
releases:
- changes:
- action: first release
details:
- what a feat!
version: 0.0.1
date: {{today}}
33 changes: 33 additions & 0 deletions new-project/templates/project-moban.yml.jj2
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
configuration:
template_dir:
- "pypi://pypi-mobans-pkg/resources/templates"
- "pypi://pypi-mobans-pkg/resources/statics"
- ".moban.d"
configuration: {{ project_name }}.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
- test.bat: test.script.jj2
- "{{ project_name | replace('-', '_') }}/_version.py": "_version.py.jj2"
- .gitignore: gitignore.jj2
- .travis.yml: travis.yml.jj2
- Pipfile: Pipfile.jj2
- output: CHANGELOG.rst
configuration: changelog.yml
template: CHANGELOG.rst.jj2
- lint.sh: lint.script.jj2
- LICENSE: "{{ license|lower }}_license.jj2"
- MANIFEST.in: MANIFEST.in.jj2
- ".github/workflows/pythonpublish.yml": "pythonpublish.yml"
- ".github/workflows/moban-update.yml": "moban-update.yml"
- "azure-pipelines.yml": "azure/azure-pipelines.yml"
- ".azure-pipelines-steps-macos.yml": "azure/pipelines-steps-macos.yml"
- ".azure-pipelines-steps.yml": "azure/pipelines-steps.yml"
- Makefile: Makefile.jj2
- format.sh: format.sh.jj2
- .isort.cfg: isort.cfg.jj2
- CONTRIBUTORS.rst: CONTRIBUTORS.rst.jj2
24 changes: 24 additions & 0 deletions new-project/templates/project.yml.jj2
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "{{project_name}}"
organisation: "{{organisation}}"
author: "{{author}}"
contact: "{{contact}}"
company: "{{company}}"
version: "0.0.1"
current_version: "0.0.1"
release: "0.0.0"
copyright_year: {{now.year}}
{% if project_type == 'command line interface'%}
command_line_interface: "{{cli}}"
entry_point: "{{project_name | replace('-', '_')}}.main:main"
{% endif %}
{% if project_type == 'C extension'%}
external_module_library: {{project_name}}
sources:
{% for source in sources: %}
- '{{source}}'
{% endfor %}
{% endif %}
license: {{license}}
dependencies: []
description: "{{description}}"
lint_command: make install_test lint format git-diff-check
2 changes: 1 addition & 1 deletion statics/moban-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
python-version: '3.7'
- name: check changes
run: |
pip install moban gitfs2 pypifs
pip install moban gitfs2 pypifs moban-jinja2-github moban-ansible
moban
git status
git diff --exit-code
Expand Down
2 changes: 1 addition & 1 deletion templates/travis.yml.jj2
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ stages:
env:
- MINREQ=0
stage: moban
install: pip install moban>=0.0.4 gitfs2 pypifs
install: pip install moban gitfs2 pypifs moban-jinja2-github moban-ansible
{% if moban_command.startswith('moban') and 'exit-code' not in moban_command %}
script:
- {{ moban_command }}
Expand Down
7 changes: 5 additions & 2 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
gease
codecov
moban>=0.6.4
moban>=0.8.2
pytest~=3.6.1
flake8
moban_jinja2_github
yamllint
moban-jinja2-github
moban-ansible
gitfs2
3 changes: 3 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# flake8: noqa
import os

import moban_ansible.tests.files
import moban_ansible.engines.line_in_file
from moban.plugins.jinja2.engine import Engine
from moban.externals import file_system

Expand Down
75 changes: 75 additions & 0 deletions yehua.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
introduction: |+
[info]Yehua /'jɛhwa/[/info] will walk you through.
Press ^C to quit at any time.
configuration:
template_path: ./new-project/templates
static_path: ./new-project/static
questions:
- project_name: "project name [yehua-boilerplate]: "
- description: "description [Moremoban organisation's best template]: "
- license:
- question: "license: "
"1. mit": "N/A"
"2. newbsd": "N/A"
- author: "author: "
- contact: "contact email: "
- organisation: "github profile/organisation: "
- company: "copyright owner [{{author}}]: "
- project_type:
- question: "project type: "
"1. library": "N/A"
"2. command line interface":
- cli: "cli executable name: "
layout:
- "{{project_name|lower|replace('-', '_')}}"
- tests
- docs:
- source
- .moban.d:
- tests
- docs:
- source
templates:
- "{{project_name}}.yml": project.yml.jj2
- "{{project_name | replace('-', '_')}}/__init__.py": "__init__.py.jj2"
- .moban.yml: project-moban.yml.jj2
- changelog.yml: changelog.yml.jj2
- Makefile: Makefile
static:
- ".moban.d/CUSTOM_README.rst.jj2": "CUSTOM_README.rst"
- ".moban.d/custom_setup.py.jj2": custom_setup.py.jj2
- ".moban.d/tests/custom_requirements.txt.jj2": "tests/requirements.txt.jj2"
- CHANGELOG.rst: CHANGELOG.rst
- setup.cfg: setup.cfg
post-moban:
git-repo-files:
- "CHANGELOG.rst"
- "MANIFEST.in"
- "Makefile"
- "README.rst"
- "{{project_name}}.yml"
- "{{project_name | replace('-', '_')}}"
- "docs"
- "requirements.txt"
- "setup.cfg"
- "setup.py"
- "test.sh"
- "tests"
- ".gitignore"
- ".github"
- ".moban.d"
- ".travis.yml"
- ".moban.yml"
- "Pipfile"
- "changelog.yml"
- "lint.sh"
- "test.bat"
- "azure-pipelines.yml"
- ".azure-pipelines-steps-macos.yml"
- ".azure-pipelines-steps.yml"
- "LICENSE"
- format.sh
- lint.sh
- .isort.cfg
- CONTRIBUTORS.rst

0 comments on commit d76e85a

Please sign in to comment.