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

Commit 58c6573

Browse files
David Robertsoncallahad
David Robertson
andauthored
Run lints under poetry in CI; remove lint tox jobs (#12434)
Co-authored-by: Dan Callahan <danc@element.io>
1 parent aa28110 commit 58c6573

File tree

4 files changed

+12
-46
lines changed

4 files changed

+12
-46
lines changed

.github/workflows/tests.yml

+7-13
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,13 @@ jobs:
2020
- run: scripts-dev/config-lint.sh
2121

2222
lint:
23-
runs-on: ubuntu-latest
24-
strategy:
25-
matrix:
26-
toxenv:
27-
- "check_codestyle"
28-
- "check_isort"
29-
- "mypy"
30-
31-
steps:
32-
- uses: actions/checkout@v2
33-
- uses: actions/setup-python@v2
34-
- run: pip install tox
35-
- run: tox -e ${{ matrix.toxenv }}
23+
# This does a vanilla `poetry install` - no extras. I'm slightly anxious
24+
# that we might skip some typechecks on code that uses extras. However,
25+
# I think the right way to fix this is to mark any extras needed for
26+
# typechecking as development dependencies. To detect this, we ought to
27+
# turn up mypy's strictness: disallow unknown imports and be accept fewer
28+
# uses of `Any`.
29+
uses: "matrix-org/backend-meta/.github/workflows/python-poetry-ci.yml@v1"
3630

3731
lint-crlf:
3832
runs-on: ubuntu-latest

changelog.d/12434.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Run lints under poetry in CI, and remove corresponding tox lint jobs.

poetry.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tox.ini

+1-30
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py37, py38, py39, py310, check_codestyle, check_isort
2+
envlist = py37, py38, py39, py310
33

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

35-
# directories/files we run the linters on.
36-
# TODO: this is now out of date; we will remove as part of poetry migration.
37-
lint_targets =
38-
setup.py
39-
synapse
40-
tests
41-
# annoyingly, black doesn't find these so we have to list them
42-
scripts-dev
43-
stubs
44-
contrib
45-
synmark
46-
.ci
47-
docker
48-
4935
# default settings for all tox environments
5036
[testenv]
5137
deps =
@@ -116,18 +102,3 @@ setenv =
116102
commands =
117103
python -m synmark {posargs:}
118104

119-
[testenv:check_codestyle]
120-
extras = lint
121-
commands =
122-
python -m black --check --diff {[base]lint_targets}
123-
flake8 {[base]lint_targets} {env:PEP8SUFFIX:}
124-
125-
[testenv:check_isort]
126-
extras = lint
127-
commands = isort -c --df {[base]lint_targets}
128-
129-
[testenv:mypy]
130-
deps =
131-
{[base]deps}
132-
extras = all,mypy
133-
commands = mypy

0 commit comments

Comments
 (0)