Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Run lints under poetry in CI; remove lint tox jobs (#12434)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Callahan <danc@element.io>
  • Loading branch information
David Robertson and callahad committed Apr 12, 2022
1 parent aa28110 commit 58c6573
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 46 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,13 @@ jobs:
- run: scripts-dev/config-lint.sh

lint:
runs-on: ubuntu-latest
strategy:
matrix:
toxenv:
- "check_codestyle"
- "check_isort"
- "mypy"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install tox
- run: tox -e ${{ matrix.toxenv }}
# This does a vanilla `poetry install` - no extras. I'm slightly anxious
# that we might skip some typechecks on code that uses extras. However,
# I think the right way to fix this is to mark any extras needed for
# typechecking as development dependencies. To detect this, we ought to
# turn up mypy's strictness: disallow unknown imports and be accept fewer
# uses of `Any`.
uses: "matrix-org/backend-meta/.github/workflows/python-poetry-ci.yml@v1"

lint-crlf:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions changelog.d/12434.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Run lints under poetry in CI, and remove corresponding tox lint jobs.
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 1 addition & 30 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py37, py38, py39, py310, check_codestyle, check_isort
envlist = py37, py38, py39, py310

# we require tox>=2.3.2 for the fix to https://github.com/tox-dev/tox/issues/208
minversion = 2.3.2
Expand Down Expand Up @@ -32,20 +32,6 @@ deps =
# install the "enum34" dependency of cryptography.
pip>=10

# directories/files we run the linters on.
# TODO: this is now out of date; we will remove as part of poetry migration.
lint_targets =
setup.py
synapse
tests
# annoyingly, black doesn't find these so we have to list them
scripts-dev
stubs
contrib
synmark
.ci
docker

# default settings for all tox environments
[testenv]
deps =
Expand Down Expand Up @@ -116,18 +102,3 @@ setenv =
commands =
python -m synmark {posargs:}

[testenv:check_codestyle]
extras = lint
commands =
python -m black --check --diff {[base]lint_targets}
flake8 {[base]lint_targets} {env:PEP8SUFFIX:}

[testenv:check_isort]
extras = lint
commands = isort -c --df {[base]lint_targets}

[testenv:mypy]
deps =
{[base]deps}
extras = all,mypy
commands = mypy

0 comments on commit 58c6573

Please sign in to comment.