-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bernát Gábor <[email protected]>
- Loading branch information
1 parent
36e4e42
commit 0ad22b2
Showing
24 changed files
with
206 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,32 +10,22 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-python@v1 | ||
- uses: pre-commit/[email protected] | ||
|
||
test: | ||
name: test ${{ matrix.py }} - ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }}-latest | ||
name: test ${{ matrix.py }} | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- Ubuntu | ||
py: | ||
- 3.9 | ||
- 3.8 | ||
- 3.7 | ||
- 3.6 | ||
- pypy3 | ||
- "3.10" | ||
- "3.9" | ||
- "3.8" | ||
- "3.7" | ||
steps: | ||
- name: setup python for tox | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
python-version: "3.10" | ||
- name: install tox | ||
run: python -m pip install tox | ||
- uses: actions/checkout@v2 | ||
|
@@ -45,47 +35,31 @@ jobs: | |
python-version: ${{ matrix.py }} | ||
- name: pick environment to run | ||
run: | | ||
import subprocess; import json; import os | ||
major, minor, impl = json.loads(subprocess.check_output(["python", "-c", "import json; import sys; import platform; print(json.dumps([sys.version_info[0], sys.version_info[1], platform.python_implementation()]));"], universal_newlines=True)) | ||
import os | ||
with open(os.environ['GITHUB_ENV'], 'a') as file_handler: | ||
file_handler.write('TOXENV=' + ("py" if impl == "CPython" else "pypy") + ("{}{}".format(major, minor) if impl == "CPython" else ("3" if major == 3 else "")) + "\n") | ||
file_handler.write('TOXENV=py${{matrix.py}}'.replace('.', '')) | ||
shell: python | ||
- name: setup test suite | ||
run: tox -vv --notest | ||
- name: run test suite | ||
run: tox --skip-pkg-install | ||
env: | ||
PYTEST_ADDOPTS: "-vv --durations=20" | ||
CI_RUN: "yes" | ||
DIFF_AGAINST: HEAD | ||
- name: rename coverage report file | ||
run: | | ||
import os; os.rename('.tox/coverage.{}.xml'.format(os.environ['TOXENV']), '.tox/coverage.xml') | ||
shell: python | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./.tox/coverage.xml | ||
flags: tests | ||
name: ${{ matrix.py }} - ${{ matrix.os }} | ||
|
||
check: | ||
name: check ${{ matrix.tox_env }} - ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }}-latest | ||
name: tox env ${{ matrix.tox_env }} | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- Ubuntu | ||
tox_env: | ||
- type | ||
- dev | ||
- pkg_check | ||
- readme | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: setup Python 3.8 | ||
- name: setup Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
python-version: "3.10" | ||
- name: install tox | ||
run: python -m pip install tox | ||
- name: run check for ${{ matrix.tox_env }} | ||
|
@@ -95,18 +69,18 @@ jobs: | |
|
||
publish: | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
needs: [check, test, pre-commit] | ||
runs-on: ubuntu-latest | ||
needs: [check, test] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: setup python to build package | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: install pep517 | ||
run: python -m pip install pep517 | ||
python-version: "3.10" | ||
- name: install build | ||
run: python -m pip install build | ||
- uses: actions/checkout@v2 | ||
- name: build package | ||
run: python -m pep517.build -s -b . -o dist | ||
run: python -m build --sdist --wheel . -o dist | ||
- name: publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,59 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.1.0 | ||
rev: v4.0.1 | ||
hooks: | ||
- id: check-ast | ||
- id: check-builtin-literals | ||
- id: check-docstring-first | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
- id: check-toml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v2.29.1 | ||
rev: v2.30.0 | ||
hooks: | ||
- id: pyupgrade | ||
args: [ "--py36-plus" ] | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.10.1 | ||
rev: 5.9.3 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/psf/black | ||
rev: 21.12b0 | ||
rev: 21.9b0 | ||
hooks: | ||
- id: black | ||
args: [--safe] | ||
- repo: https://github.com/asottile/setup-cfg-fmt | ||
rev: v1.20.0 | ||
args: [ --safe ] | ||
- repo: https://github.com/asottile/blacken-docs | ||
rev: v1.11.0 | ||
hooks: | ||
- id: setup-cfg-fmt | ||
- id: blacken-docs | ||
additional_dependencies: [ black==21.9b0 ] | ||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: v1.9.0 | ||
hooks: | ||
- id: rst-backticks | ||
- repo: https://github.com/tox-dev/tox-ini-fmt | ||
rev: "0.5.1" | ||
hooks: | ||
- id: tox-ini-fmt | ||
- id: tox-ini-fmt | ||
args: [ "-p", "fix" ] | ||
- repo: https://github.com/asottile/setup-cfg-fmt | ||
rev: v1.17.0 | ||
hooks: | ||
- id: setup-cfg-fmt | ||
args: [ --min-py3-version, "3.7", "--max-py-version", "3.10" ] | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: "4.0.1" | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: ["flake8-bugbear == 21.9.2"] | ||
additional_dependencies: | ||
- flake8-bugbear==21.9.1 | ||
- flake8-comprehensions==3.6.1 | ||
- flake8-pytest-style==1.5 | ||
- flake8-spellcheck==0.24 | ||
- flake8-unused-arguments==0.0.6 | ||
- flake8-noqa==1.1.0 | ||
- flake8-eradicate==1.1.0 | ||
- pep8-naming==0.12.1 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
from setuptools import setup | ||
|
||
setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
from .version import __version__ | ||
|
||
__all__ = ("__version__",) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.