Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 5 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
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ https://help.github.com/articles/using-pull-requests/) to ask us to pull your
changes into our repo.

Some other points to follow:

* Please base your changes on the `develop` branch.

* Please follow the [code style requirements](#code-style).

* Please include a [changelog entry](#changelog) with each PR.
Expand All @@ -46,7 +46,7 @@ locally. You'll need python 3.6 or later, and to install a number of tools:

```
# Install the dependencies
pip install -U black flake8 flake8-comprehensions isort
pip install -e ".[lint]"

# Run the linter script
./scripts-dev/lint.sh
Expand Down
1 change: 1 addition & 0 deletions changelog.d/8330.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Move lint-related dependencies to package-extra field, update CONTRIBUTING.md to utilise this.
7 changes: 7 additions & 0 deletions synapse/python_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@
# hiredis is not a *strict* dependency, but it makes things much faster.
# (if it is not installed, we fall back to slow code.)
"redis": ["txredisapi>=1.4.7", "hiredis"],
# We pin black so that our tests don't start failing on new releases.
"lint": [
"isort<=5.0.3",
'black==19.10b0;python_version>"3.5"',
"flake8-comprehensions",
"flake8",
],
}

ALL_OPTIONAL_REQUIREMENTS = set() # type: Set[str]
Expand Down
10 changes: 2 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,14 @@ commands =
check-manifest

[testenv:check_codestyle]
skip_install = True
deps =
flake8
flake8-comprehensions
# We pin so that our tests don't start failing on new releases of black.
black==19.10b0
extras = lint
commands =
python -m black --check --diff .
/bin/sh -c "flake8 synapse tests scripts scripts-dev contrib synctl {env:PEP8SUFFIX:}"
{toxinidir}/scripts-dev/config-lint.sh

[testenv:check_isort]
skip_install = True
deps = isort==5.0.3
extras = lint
commands = /bin/sh -c "isort -c --df --sp setup.cfg synapse tests scripts-dev scripts"

[testenv:check-newsfragment]
Expand Down