Skip to content

Commit fe9dab5

Browse files
🔨 Re-organize dependencies for local dev and CI
The 'hard' dependencies are now specified as extra groups in the setup.py package information. tox.ini points to these extras to install the required dependencies, and their supported version ranges. The dev requirements file is now documented in the contributing guidelines, and makes use of the extras to pull in the optional dependencies for a full-blown local installation. The remaining dependencies (such as sphinx) are not used in tox and are still in the requirements_dev.txt file. The linting dependencies (with upper bound versions) are now also specified as an extra group to prevent mismatching versions in tox env and local development envs.
1 parent 6f3bbd8 commit fe9dab5

File tree

5 files changed

+28
-27
lines changed

5 files changed

+28
-27
lines changed

CONTRIBUTING.rst

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ Contribute
1515
* Send a pull request with your changes.
1616
* Provide a translation using Transifex_.
1717

18+
Local installation
19+
------------------
20+
21+
Install the development dependencies, which also installs the package in editable mode
22+
for local development and additional development tools.
23+
24+
.. code-block:: console
25+
26+
pip install -r requirements_dev.txt
27+
1828
Running tests
1929
-------------
2030
This project aims for full code-coverage, this means that your code should be

docs/requirements.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ Requirements
33

44
Django
55
------
6-
Supported Django versions are supported. Currently this list includes Django 3.2, 4.0, 4.1, and 4.2.
6+
Supported Django versions are supported. Currently this list includes Django 3.2, 4.0,
7+
4.1, 4.2 and 5.0.
78

89
Python
910
------
10-
The following Python versions are supported: 3.8, 3.9, 3.10 and 3.11 with a
11+
The following Python versions are supported: 3.8, 3.9, 3.10, 3.11 and 3.12 with a
1112
limit to what Django itself supports. As support for older Django versions is
1213
dropped, the minimum version might be raised. See also `What Python version can
1314
I use with Django?`_.

requirements_dev.txt

+1-18
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,13 @@
11
# The app itself
22

3-
-e .
4-
5-
# Additional runtime dependencies
6-
7-
twilio
8-
phonenumberslite
3+
-e .[call,sms,webauthn,yubikey,phonenumberslite,tests,linting]
94

105
# Example app
116

127
django-debug-toolbar
138
django-bootstrap-form
149
django-user-sessions
1510

16-
# Example app (WebAuthn)
17-
18-
webauthn~=2.0.0
19-
20-
# Testing
21-
22-
coverage
23-
flake8
24-
tox
25-
isort
26-
freezegun
27-
2811
# Documentation
2912

3013
Sphinx

setup.py

+10
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@
2525
'yubikey': ['django-otp-yubikey'],
2626
'phonenumbers': ['phonenumbers>=7.0.9,<8.99'],
2727
'phonenumberslite': ['phonenumberslite>=7.0.9,<8.99'],
28+
# used internally for local development & CI
29+
'tests': [
30+
'coverage',
31+
'freezegun',
32+
'tox',
33+
],
34+
'linting': [
35+
'flake8<=6.99',
36+
'isort<=5.99',
37+
],
2838
},
2939
include_package_data=True,
3040
classifiers=[

tox.ini

+4-7
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,9 @@ deps =
4747
dj42: Django<5.0
4848
dj50: Django<5.1
4949
djmain: https://github.com/django/django/archive/main.tar.gz
50-
yubikey: django-otp-yubikey
51-
webauthn: webauthn>=2.0,<2.99
5250
webauthn: -rrequirements_e2e.txt
53-
coverage
54-
freezegun
5551
extras =
52+
tests
5653
call
5754
phonenumberslite
5855
yubikey: yubikey
@@ -65,10 +62,10 @@ commands =
6562

6663
[testenv:flake8]
6764
basepython = python3
68-
deps = flake8<=6.99
65+
extras = linting
6966
commands = flake8 example tests two_factor
7067

7168
[testenv:isort]
7269
basepython = python3
73-
deps = isort<=5.99
74-
commands = isort -rc -c --diff example tests two_factor
70+
extras = linting
71+
commands = isort -c --diff example tests two_factor

0 commit comments

Comments
 (0)