Skip to content

Commit

Permalink
🔨 Re-organize dependencies for local dev and CI
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sergei-maertens authored and claudep committed Feb 3, 2024
1 parent 6f3bbd8 commit 13a0f80
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 27 deletions.
10 changes: 10 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ Contribute
* Send a pull request with your changes.
* Provide a translation using Transifex_.

Local installation
------------------

Install the development dependencies, which also installs the package in editable mode
for local development and additional development tools.

.. code-block:: console
pip install -r requirements_dev.txt
Running tests
-------------
This project aims for full code-coverage, this means that your code should be
Expand Down
5 changes: 3 additions & 2 deletions docs/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ Requirements

Django
------
Supported Django versions are supported. Currently this list includes Django 3.2, 4.0, 4.1, and 4.2.
Supported Django versions are supported. Currently this list includes Django 3.2, 4.0,
4.1, 4.2 and 5.0.

Python
------
The following Python versions are supported: 3.8, 3.9, 3.10 and 3.11 with a
The following Python versions are supported: 3.8, 3.9, 3.10, 3.11 and 3.12 with a
limit to what Django itself supports. As support for older Django versions is
dropped, the minimum version might be raised. See also `What Python version can
I use with Django?`_.
Expand Down
19 changes: 1 addition & 18 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
# The app itself

-e .

# Additional runtime dependencies

twilio
phonenumberslite
-e .[call,sms,webauthn,yubikey,phonenumberslite,tests,linting]

# Example app

django-debug-toolbar
django-bootstrap-form
django-user-sessions

# Example app (WebAuthn)

webauthn~=2.0.0

# Testing

coverage
flake8
tox
isort
freezegun

# Documentation

Sphinx
Expand Down
10 changes: 10 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
'yubikey': ['django-otp-yubikey'],
'phonenumbers': ['phonenumbers>=7.0.9,<8.99'],
'phonenumberslite': ['phonenumberslite>=7.0.9,<8.99'],
# used internally for local development & CI
'tests': [
'coverage',
'freezegun',
'tox',
],
'linting': [
'flake8<=6.99',
'isort<=5.99',
],
},
include_package_data=True,
classifiers=[
Expand Down
11 changes: 4 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,9 @@ deps =
dj42: Django<5.0
dj50: Django<5.1
djmain: https://github.com/django/django/archive/main.tar.gz
yubikey: django-otp-yubikey
webauthn: webauthn>=2.0,<2.99
webauthn: -rrequirements_e2e.txt
coverage
freezegun
extras =
tests
call
phonenumberslite
yubikey: yubikey
Expand All @@ -65,10 +62,10 @@ commands =

[testenv:flake8]
basepython = python3
deps = flake8<=6.99
extras = linting
commands = flake8 example tests two_factor

[testenv:isort]
basepython = python3
deps = isort<=5.99
commands = isort -rc -c --diff example tests two_factor
extras = linting
commands = isort -c --diff example tests two_factor

0 comments on commit 13a0f80

Please sign in to comment.