Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
- id: check-yaml
- id: debug-statements
- repo: https://github.com/psf/black
rev: 21.9b0
rev: 21.6b0
hooks:
- id: black
language_version: python3.9
Expand All @@ -21,17 +21,18 @@ repos:
- id: autoflake
args: [ '--in-place', '--remove-all-unused-imports', '--remove-unused-variable' ]
- repo: https://github.com/PyCQA/isort
rev: 5.9.3
rev: 5.9.1
hooks:
- id: isort
args: ['--line-length=79']
language_version: python3.9
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910-1
rev: v0.902
hooks:
- id: mypy
additional_dependencies: [types-requests, types-PyYAML, types-Flask, types-Werkzeug]
- repo: https://github.com/asottile/pyupgrade
rev: v2.29.0
rev: v2.19.4
hooks:
- id: pyupgrade
args: [--py36-plus]
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exclude = '''
| \.mypy_cache
| \.tox
| \.venv
| \.direnv
| venv
| _build
| buck-out
Expand Down
48 changes: 48 additions & 0 deletions python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: python

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9, 3.10 ]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install -U black pylama wheel pip tox
pip install .
- name: Set build name
run: echo "::set-output name=${GITHUB_REPOSITORY}-$(python setup.py --version)"
- name: Lint
run: |
- name: Run Tox
# Run tox using the version of Python in `PATH`
run: tox -e py
- name: Build Package
if: matrix.python-version == 3.9 && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
python setup.py sdist bdist_wheel
- name: Publish package
if: matrix.python-version == 3.9 && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ deps=
commands=
pip install .[test]
black --verbose -l 79 --check --diff .
pylama --ignore E501,W503 --skip 'venv/*,.tox/*,.eggs/*'
pylama --ignore E501,W503,E203 --skip 'venv/*,.direnv/*,.tox/*,.eggs/*'
py.test