Skip to content

Commit d0dce31

Browse files
committed
Update template
1 parent eb781ce commit d0dce31

28 files changed

+294
-301
lines changed

Project/.circleci/config.yml renamed to .circleci/config.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,26 @@
33
version: 2
44

55
jobs:
6-
py38_tests:
6+
py39_tests:
77
docker:
8-
- image: circleci/python:3.8.2
8+
- image: circleci/python:3.9.0
99
steps:
1010
- checkout
11+
1112
- run:
1213
name: Install dependencies
1314
command: |
1415
make install-dependencies
1516
make install-dependencies-test
17+
1618
- run:
1719
name: Lint
1820
command: make lint
21+
1922
- run:
2023
name: Tests
2124
command: make test
25+
2226
- run:
2327
name: Coverage
2428
command: | # must define CODECOV_TOKEN enviroment variable in CircleCI
@@ -30,4 +34,4 @@ workflows:
3034
version: 2
3135
run_tests:
3236
jobs:
33-
- py38_tests
37+
- py39_tests

.github/workflows/workflow.yml

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
7+
tests:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
max-parallel: 4
11+
matrix:
12+
python-version: [3.6, 3.7, 3.8, 3.9]
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
make install-dependencies
26+
make install-dependencies-test
27+
28+
- name: Tests
29+
run: make test
30+
31+
code_quality:
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- uses: actions/checkout@v1
36+
37+
- name: Set up Python 3.9
38+
uses: actions/setup-python@v1
39+
with:
40+
python-version: '3.9'
41+
42+
- name: Install dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
make install-dependencies
46+
make install-dependencies-test
47+
48+
- name: Lint
49+
run: make lint
50+
51+
- name: Coverage (coverage)
52+
env:
53+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # must be defined in Github repository
54+
run: |
55+
make coverage
56+
python -m coverage xml
57+
bash <(curl -s https://codecov.io/bash)
58+
59+
publish:
60+
needs: [ tests, code_quality ]
61+
runs-on: ubuntu-latest
62+
63+
steps:
64+
- uses: actions/checkout@v1
65+
66+
- name: Set up Python 3.9
67+
uses: actions/setup-python@v1
68+
with:
69+
python-version: '3.9'
70+
71+
- name: Install dependencies
72+
run: |
73+
python -m pip install --upgrade pip
74+
make install-dependencies
75+
make install-dependencies-dev
76+
77+
- name: Build package
78+
run: |
79+
make build
80+
twine check dist/*
81+
82+
- name: Publish to Test PyPI
83+
if: github.ref == 'refs/heads/develop'
84+
uses: pypa/gh-action-pypi-publish@master
85+
with:
86+
password: ${{ secrets.TEST_PYPI_TOKEN }} # defined in Github repository
87+
repository_url: https://test.pypi.org/legacy/
88+
skip_existing: true
89+
90+
- name: Publish to PyPI
91+
if: startsWith(github.ref, 'refs/tags')
92+
uses: pypa/gh-action-pypi-publish@master
93+
with:
94+
password: ${{ secrets.PYPI_TOKEN }} # defined in Github repository

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# files/folders to be ignored by git
2+
*.pyc
3+
14
# Pycharm files
25
.idea/
36

File renamed without changes.
File renamed without changes.

LICENSE

+2-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,2 @@
1-
The MIT License (MIT)
2-
3-
Copyright (c) 2018, Pedro HC David (https://github.com/Kronopt)
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
1+
<usually GNU General Public License v3.0>
2+
<sometimes MIT License>
+74-74
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,74 @@
1-
.PHONY: help install-dependencies install-dependencies-dev test lint coverage docs-test build build-test release clean clean-pyc clean-tests clean-coverage clean-build
2-
3-
help:
4-
@echo ""
5-
@echo "install-dependencies installs dependencies"
6-
@echo "install-dependencies-dev installs dev dependencies"
7-
@echo ""
8-
@echo "test runs tests"
9-
@echo "lint runs linter"
10-
@echo "coverage runs coverage test"
11-
@echo "docs-test tests docs for build errors and serves them locally"
12-
@echo ""
13-
@echo "build builds python package (sdist)"
14-
@echo "build-test tests build for errors and uploads to test.pypi.org"
15-
@echo "release builds and uploads python package to pypi.org"
16-
@echo ""
17-
@echo "clean-tests removes temp test files and folders"
18-
@echo "clean-coverage removes coverage files"
19-
@echo "clean-build removes packaging artifacts"
20-
@echo "clean-pyc removes python file artifacts"
21-
@echo "clean runs all cleaning functions"
22-
@echo ""
23-
24-
install-dependencies:
25-
python -m pip install -r requirements.txt
26-
27-
install-dependencies-dev:
28-
python -m pip install -r requirements-dev.txt
29-
30-
test:
31-
# python -m unittest <tests folder>
32-
# python -m pytest tests -vv
33-
# nose2 -s ./tests -t .
34-
35-
lint:
36-
python -m pylint <project_folder_name> setup.py
37-
38-
coverage:
39-
# python -m coverage run --source <project_folder_name> -m unittest <tests folder>
40-
# python -m coverage run --source <project_folder_name> -m pytest tests -q
41-
# python -m coverage run --source <project_folder_name> nose2 -s ./tests -t .
42-
python -m coverage report -m
43-
44-
docs-test:
45-
mkdocs serve -s -f .mkdocs.yml
46-
47-
build: clean-pyc clean-build
48-
python setup.py sdist bdist_wheel
49-
50-
build-test:
51-
twine check dist/*
52-
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
53-
54-
release: build
55-
twine upload dist/*
56-
57-
clean-tests:
58-
rm -rf .pytest_cache/
59-
60-
clean-coverage:
61-
python -m coverage erase
62-
63-
clean-build:
64-
rm -rf build/
65-
rm -rf dist/
66-
rm -rf <project_folder_name>.egg-info/
67-
68-
clean-pyc:
69-
rm -rf <project_folder_name>/__pycache__ tests/__pycache__
70-
rm -f <project_folder_name>/*.pyc tests/*.pyc
71-
rm -f <project_folder_name>/*.pyo tests/*.pyo
72-
rm -f <project_folder_name>/*~ tests/*~
73-
74-
clean: clean-tests clean-coverage clean-build clean-pyc
1+
.PHONY: help install-dependencies install-dependencies-dev test lint coverage docs-test build build-test release clean clean-pyc clean-tests clean-coverage clean-build
2+
3+
help:
4+
@echo ""
5+
@echo "install-dependencies installs dependencies"
6+
@echo "install-dependencies-dev installs dev dependencies"
7+
@echo ""
8+
@echo "test runs tests"
9+
@echo "lint runs linter"
10+
@echo "coverage runs coverage test"
11+
@echo "docs-test tests docs for build errors and serves them locally"
12+
@echo ""
13+
@echo "build builds python package (sdist)"
14+
@echo "build-test tests build for errors and uploads to test.pypi.org"
15+
@echo "release builds and uploads python package to pypi.org"
16+
@echo ""
17+
@echo "clean-tests removes temp test files and folders"
18+
@echo "clean-coverage removes coverage files"
19+
@echo "clean-build removes packaging artifacts"
20+
@echo "clean-pyc removes python file artifacts"
21+
@echo "clean runs all cleaning functions"
22+
@echo ""
23+
24+
install-dependencies:
25+
python -m pip install -r requirements.txt
26+
27+
install-dependencies-dev:
28+
python -m pip install -r requirements-dev.txt
29+
30+
test:
31+
# python -m unittest <tests folder>
32+
# python -m pytest tests -vv
33+
# nose2 -s ./tests -t .
34+
35+
lint:
36+
python -m pylint <project_folder_name> setup.py
37+
38+
coverage:
39+
# python -m coverage run --source <project_folder_name> -m unittest <tests folder>
40+
# python -m coverage run --source <project_folder_name> -m pytest tests -q
41+
# python -m coverage run --source <project_folder_name> nose2 -s ./tests -t .
42+
python -m coverage report -m
43+
44+
docs-test:
45+
mkdocs serve -s -f .mkdocs.yml
46+
47+
build: clean-pyc clean-build
48+
python setup.py sdist bdist_wheel
49+
50+
build-test:
51+
twine check dist/*
52+
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
53+
54+
release: build
55+
twine upload dist/*
56+
57+
clean-tests:
58+
rm -rf .pytest_cache/
59+
60+
clean-coverage:
61+
python -m coverage erase
62+
63+
clean-build:
64+
rm -rf build/
65+
rm -rf dist/
66+
rm -rf <project_folder_name>.egg-info/
67+
68+
clean-pyc:
69+
rm -rf <project_folder_name>/__pycache__ tests/__pycache__
70+
rm -f <project_folder_name>/*.pyc tests/*.pyc
71+
rm -f <project_folder_name>/*.pyo tests/*.pyo
72+
rm -f <project_folder_name>/*~ tests/*~
73+
74+
clean: clean-tests clean-coverage clean-build clean-pyc

Project/.github/workflows/workflow.yml

-51
This file was deleted.

Project/.gitignore

-8
This file was deleted.

Project/LICENSE

-2
This file was deleted.

Project/README.md

-22
This file was deleted.

0 commit comments

Comments
 (0)