-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
596 additions
and
342 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 |
---|---|---|
@@ -1,48 +1,90 @@ | ||
name: Tests | ||
|
||
name: Testing | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
paths: | ||
- "flake8_isort.py" | ||
- "test_flake8_isort.py" | ||
- "setup.py" | ||
- ".github/workflows/tests.yml" | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
jobs: | ||
tests: | ||
test: | ||
name: py-${{ matrix.python-version }}/isort-${{ matrix.isort }}/flake8-${{ matrix.flake8 }} | ||
runs-on: ubuntu-latest | ||
name: Python ${{ matrix.python-version }} x isort ${{ matrix.isort }} x flake8 ${{ matrix.flake8 }} | ||
|
||
strategy: | ||
matrix: | ||
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy3'] | ||
isort: [4.3.21, 5.10.1] | ||
flake8: [3.9.2, 4.0.1, 5.0.4] | ||
|
||
python-version: ["3.10", 3.9, 3.8, 3.7, pypy-3.9] | ||
isort: [5.10.1] | ||
flake8: [5.0.4] | ||
include: | ||
- python-version: 3.9 | ||
isort: 4.3.21 | ||
flake8: 3.9.2 | ||
qa: 'true' | ||
- python-version: 3.9 | ||
isort: 4.3.21 | ||
flake8: 3.9.2 | ||
- python-version: 3.9 | ||
isort: 4.3.21 | ||
flake8: 4.0.1 | ||
- python-version: 3.9 | ||
isort: 5.10.1 | ||
flake8: 3.9.2 | ||
- python-version: 3.9 | ||
isort: 5.10.1 | ||
flake8: 4.0.1 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
- name: Install matrix dependencies | ||
run: pip install 'isort==${{ matrix.isort }}' 'flake8==${{ matrix.flake8 }}' | ||
- name: Cache packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}- | ||
- name: pip version | ||
run: pip --version | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install -r requirements.txt | ||
pip install 'isort==${{ matrix.isort }}' 'flake8==${{ matrix.flake8 }}' | ||
# isort 4.x requires `toml` to be able to read pyproject.toml, so install it... | ||
- name: Install toml if required | ||
run: pip install toml | ||
if: matrix.isort == '4.3.21' | ||
- name: Install dependencies | ||
run: pip install .[test] | ||
- name: flake8 | ||
run: flake8 *.py | ||
- name: pytest | ||
run: pytest -v --cov flake8_isort --cov-report term-missing | ||
- name: Upload coverage | ||
# formatters | ||
- name: Run pyupgrade | ||
if: matrix.qa == 'true' | ||
run: pyupgrade --py37-plus *.py | ||
- name: Run isort | ||
if: matrix.qa == 'true' | ||
run: isort --check-only *.py | ||
- name: Run black | ||
if: matrix.qa == 'true' | ||
run: black --check --skip-string-normalization *.py | ||
# linters | ||
- name: Lint with bandit | ||
if: matrix.qa == 'true' | ||
run: bandit --skip B101 *.py # B101 is assert statements | ||
- name: Lint with codespell | ||
if: matrix.qa == 'true' | ||
run: codespell *.rst *.py | ||
- name: Lint with flake8 | ||
if: matrix.qa == 'true' | ||
run: flake8 *.py --count --max-complexity=18 --max-line-length=88 --show-source --statistics | ||
- name: Lint with mypy | ||
if: matrix.qa == 'true' | ||
run: | | ||
python -m pip install coveralls | ||
coveralls --service=github | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
mkdir --parents --verbose .mypy_cache | ||
mypy --ignore-missing-imports --install-types --non-interactive *.py || true | ||
- name: Lint with safety | ||
if: matrix.qa == 'true' | ||
run: safety check || true | ||
# tests and coverage | ||
- name: Test | ||
run: pytest run_tests.py --cov --cov-report term-missing | ||
- name: Coverage | ||
run: coveralls --service=github |
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,8 +1,10 @@ | ||
*.egg-info | ||
*.pyc | ||
|
||
.cache | ||
.coverage | ||
.installed.cfg | ||
.hypothesis | ||
bin | ||
develop-eggs | ||
include | ||
|
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
include MANIFEST.in LICENSE *.rst *.py *.cfg *.ini | ||
exclude .installed.cfg .coveragerc *.pyc | ||
include MANIFEST.in | ||
include LICENSE | ||
include setup.cfg | ||
include *.rst | ||
include *.py | ||
include *requirements.txt | ||
|
||
exclude .installed.cfg | ||
exclude .coveragerc | ||
exclude *.pyc | ||
exclude *.in |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
bandit | ||
black | ||
codespell | ||
coveralls | ||
flake8-blind-except | ||
flake8-bugbear | ||
flake8-comprehensions | ||
flake8-debugger | ||
flake8-deprecated | ||
flake8-isort | ||
flake8-pep3101 | ||
flake8-print | ||
flake8-quotes | ||
flake8-todo | ||
importlib-metadata; python_version < '3.8' | ||
isort | ||
mypy | ||
pytest | ||
pytest-cov | ||
pyupgrade | ||
safety | ||
typed-ast; python_version < '3.8' # dependency of black and mypy | ||
zipp; python_version < '3.8' # dependency of importlib-metadata |
Oops, something went wrong.