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

Run lints under poetry in CI; remove lint tox jobs #12434

Merged
merged 4 commits into from
Apr 12, 2022
Merged
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
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
H-Shay marked this conversation as resolved.
Show resolved Hide resolved
# uses of `Any`.
uses: "matrix-org/backend-meta/.github/workflows/python-poetry-ci.yml@v1"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


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}
H-Shay marked this conversation as resolved.
Show resolved Hide resolved
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