Skip to content

Commit 69dc924

Browse files
committed
Initial commit
0 parents  commit 69dc924

20 files changed

+766
-0
lines changed

.bumpversion.cfg

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[bumpversion]
2+
current_version = 0.0.3
3+
commit = True
4+
tag = True
5+
tag_name = {new_version}
6+
sign_tags = False
7+
message = "Upgrade: {current_version} → {new_version}"
8+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<build>\d+))?
9+
serialize =
10+
{major}.{minor}.{patch}.{release}{build}
11+
{major}.{minor}.{patch}
12+
13+
[bumpversion:part:release]
14+
optional_value = rc
15+
first_value = dev
16+
values =
17+
dev
18+
rc
19+
20+
[bumpversion:part:build]
21+
22+
[bumpversion:file:setup.cfg]
23+
search = version = {current_version}
24+
replace = version = {new_version}
25+
26+
[bumpversion:file:README.md]
27+
search = Version: "{current_version}"
28+
replace = Version: "{new_version}"
29+
30+
[bumpversion:file:templatepy/__init__.py]
31+
search = __version__ = "{current_version}"
32+
replace = __version__ = "{new_version}"

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Checklist
2+
**Please complete this checklist before submission**
3+
- [ ] All changes were made in a **separate** branch. (Branches **MUST** have descriptive names that start with either the `fix/` or `feature/` prefixes. Good examples are: `fix/some-bug-issue` or `feature/issue-templates`.
4+
- [ ] The PR commit has a descriptive commit message with a short title (first line).
5+
- [ ] The PR targets the `dev` branch, never the `main`.
6+
- [ ] Tests for the changes have been added where applicable (for bug fixes/features).
7+
- [ ] The documentation has been updated to reflect any changes.
8+
- [ ] The code has been linted and formatted locally (see `pre-commit-config.yaml`)
9+
- [ ] Add `closes #X` (where X is the issue number) in the comment to auto-close the issue that this PR fixes (if applicable).
10+
11+
12+
# Description template for PR
13+
## **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
14+
- [ ] Bug fix
15+
- [ ] New feature
16+
- [ ] Other:
17+
18+
19+
## What is the current behavior?
20+
Link any open issues or pull requests here.
21+
22+
23+
## What is the new behavior / fix / change?
24+
25+
26+
## Does this PR introduce a breaking change for backwards compatibility?
27+
In particular, what does the user have to consider due to this PR?
28+
29+
30+
## Has this PR been tested?
31+
Please explain (1) how has this PR been tested, and (2) if tests have been added to the code base.
32+
33+
34+
## Does this PR require an update to the documentation?
35+
If any features have changed, or have been added. Please explain how the documentation has been updated (and link to the associated PR).
36+
37+
38+
## Other information
39+
Add any further details here.
40+
41+
<!-- Closes #X -->

.github/workflows/CI.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CI
2+
3+
on: push
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up Python
11+
uses: actions/setup-python@v2
12+
with:
13+
python-version: 3.9
14+
- name: Install dependencies
15+
run: |
16+
python -m pip install --upgrade pip
17+
pip install .[dev]
18+
- name: Lint
19+
run: |
20+
black ./ --check --verbose
21+
flake8 --verbose
22+
# pre-commit install
23+
# pre-commit run --all
24+
25+
check-tag:
26+
needs: [lint]
27+
runs-on: ubuntu-latest
28+
if: contains(github.ref, 'tags') && (!contains(github.ref_name, 'dev')) && (!contains(github.ref_name, 'rc'))
29+
steps:
30+
- run: echo "Tag '${{ github.ref_name }}' is valid."
31+
32+
release:
33+
needs: [check-tag]
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v2
38+
- name: Create Release
39+
id: create_release
40+
uses: actions/create-release@v1
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
43+
with:
44+
tag_name: ${{ github.ref_name }}
45+
release_name: "${{ github.ref_name }}"
46+
body: "🚀 Release: ${{ github.event.repository.name }} @ ${{ github.ref_name }}"
47+
draft: false
48+
prerelease: false
49+
50+
deploy:
51+
needs: [release]
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v2
55+
- name: Set up Python
56+
uses: actions/setup-python@v1
57+
with:
58+
python-version: "3.x"
59+
- name: Install dependencies
60+
run: |
61+
python -m pip install --upgrade pip
62+
pip install -U setuptools setuptools_scm wheel twine
63+
- name: Build and publish
64+
env:
65+
TWINE_USERNAME: __token__
66+
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
67+
run: |
68+
python setup.py sdist bdist_wheel
69+
twine upload dist/* --verbose

.gitignore

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# IDE files
2+
.idea/
3+
.vscode/
4+
5+
# Ignored file types
6+
.DS_Store
7+
8+
# Custom config files
9+
*.conf.custom
10+
11+
# Byte-compiled / optimized / DLL files
12+
__pycache__/
13+
*.py[cod]
14+
*$py.class
15+
16+
# C extensions
17+
*.so
18+
19+
# Distribution / packaging
20+
.Python
21+
build/
22+
develop-eggs/
23+
dist/
24+
downloads/
25+
eggs/
26+
.eggs/
27+
lib/
28+
lib64/
29+
parts/
30+
sdist/
31+
var/
32+
wheels/
33+
pip-wheel-metadata/
34+
share/python-wheels/
35+
*.egg-info/
36+
.installed.cfg
37+
*.egg
38+
MANIFEST
39+
40+
# PyInstaller
41+
# Usually these files are written by a python script from a template
42+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
43+
*.manifest
44+
*.spec
45+
46+
# Installer logs
47+
pip-log.txt
48+
pip-delete-this-directory.txt
49+
50+
# Unit test / coverage reports
51+
htmlcov/
52+
.tox/
53+
.nox/
54+
.coverage
55+
.coverage.*
56+
.cache
57+
nosetests.xml
58+
coverage.xml
59+
*.cover
60+
*.py,cover
61+
.hypothesis/
62+
.pytest_cache/
63+
64+
# Translations
65+
*.mo
66+
*.pot
67+
68+
# Django stuff:
69+
*.log
70+
local_settings.py
71+
db.sqlite3
72+
db.sqlite3-journal
73+
74+
# Flask stuff:
75+
instance/
76+
.webassets-cache
77+
78+
# Scrapy stuff:
79+
.scrapy
80+
81+
# Sphinx documentation
82+
docs/_build/
83+
84+
# PyBuilder
85+
target/
86+
87+
# Jupyter Notebook
88+
.ipynb_checkpoints
89+
90+
# IPython
91+
profile_default/
92+
ipython_config.py
93+
94+
# pyenv
95+
.python-version
96+
97+
# pipenv
98+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
99+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
100+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
101+
# install all needed dependencies.
102+
#Pipfile.lock
103+
104+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
105+
__pypackages__/
106+
107+
# Celery stuff
108+
celerybeat-schedule
109+
celerybeat.pid
110+
111+
# SageMath parsed files
112+
*.sage.py
113+
114+
# Environments
115+
.env
116+
.venv
117+
env/
118+
venv/
119+
ENV/
120+
env.bak/
121+
venv.bak/
122+
123+
# Spyder project settings
124+
.spyderproject
125+
.spyproject
126+
127+
# Rope project settings
128+
.ropeproject
129+
130+
# mkdocs documentation
131+
/site
132+
133+
# mypy
134+
.mypy_cache/
135+
.dmypy.json
136+
dmypy.json
137+
138+
# Pyre type checker
139+
.pyre/

.pre-commit-config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
repos:
2+
- repo: https://github.com/asottile/reorder_python_imports
3+
rev: v2.6.0
4+
hooks:
5+
- id: reorder-python-imports
6+
- repo: https://github.com/ambv/black
7+
rev: 21.12b0
8+
hooks:
9+
- id: black
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v2.3.0
12+
hooks:
13+
- id: end-of-file-fixer
14+
exclude: '.bumpversion.cfg'
15+
- id: trailing-whitespace
16+
exclude: '.bumpversion.cfg'
17+
- id: check-case-conflict
18+
- id: check-merge-conflict
19+
- id: check-yaml
20+
args: [ '--unsafe' ]
21+
- id: detect-private-key
22+
- id: forbid-new-submodules
23+
- id: check-json
24+
- id: pretty-format-json
25+
args: ['--autofix', '--indent=4', '--no-ensure-ascii', ]
26+
- id: check-added-large-files
27+
- id: flake8

0 commit comments

Comments
 (0)