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

Move lint dependencies to extras #8330

Merged
merged 8 commits into from
Sep 17, 2020
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
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]"
clokep marked this conversation as resolved.
Show resolved Hide resolved
# 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.
5 changes: 4 additions & 1 deletion synapse/python_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,16 @@
# 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", "flake8-comprehensions", "flake8"],
}

ALL_OPTIONAL_REQUIREMENTS = set() # type: Set[str]

for name, optional_deps in CONDITIONAL_REQUIREMENTS.items():
# Exclude systemd as it's a system-based requirement.
if name not in ["systemd"]:
# Exclude lint as it's a dev-based requirement.
if name not in ["systemd", "lint"]:
ALL_OPTIONAL_REQUIREMENTS = set(optional_deps) | ALL_OPTIONAL_REQUIREMENTS


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