Skip to content

Commit edba7ad

Browse files
Removed requirements txt files from project. (#9842)
* removed requirements txt files * Updated Testing section from Contributing.md * updated command to install dependencies for documentation in CI * updated tox.ini * build: Adopt PEP 735 for development dependency management * Update installation commands for dependency groups in tox.ini and main.yml * update installation command in testing section of contributing docs * Clean up old `requirements text files` references in workflows and docs * Removed references to `requirements.txt` in GitHub Actions workflows. * Updated `mkdocs-deploy.yml` and `main.yml` to install dependencies using `pyproject.toml`. * Cleaned up documentation to remove mentions of the `requirements` folder. * Fix invalid pyproject.toml Project's URLs should be in the [project] table * Keep full versions in package groups * Specify all tox deps as dependency groups --------- Co-authored-by: Bruno Alla <[email protected]>
1 parent 055c422 commit edba7ad

File tree

11 files changed

+69
-80
lines changed

11 files changed

+69
-80
lines changed

β€Ž.github/workflows/main.ymlβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
python-version: ${{ matrix.python-version }}
2929
allow-prereleases: true
3030
cache: 'pip'
31-
cache-dependency-path: 'requirements/*.txt'
3231

3332
- name: Upgrade packaging tools
3433
run: python -m pip install --upgrade pip setuptools virtualenv wheel
@@ -60,7 +59,7 @@ jobs:
6059
python-version: '3.13'
6160

6261
- name: Install dependencies
63-
run: pip install -r requirements/requirements-documentation.txt
62+
run: pip install --group docs
6463

6564
# Start mkdocs server and wait for it to be ready
6665
- run: mkdocs serve &

β€Ž.github/workflows/mkdocs-deploy.ymlβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
paths:
88
- docs/**
99
- docs_theme/**
10-
- requirements/requirements-documentation.txt
10+
- pyproject.toml
1111
- mkdocs.yml
1212
- .github/workflows/mkdocs-deploy.yml
1313

@@ -25,5 +25,5 @@ jobs:
2525
- uses: actions/setup-python@v6
2626
with:
2727
python-version: 3.x
28-
- run: pip install -r requirements/requirements-documentation.txt
28+
- run: pip install --group docs
2929
- run: mkdocs gh-deploy

β€Ždocs/community/contributing.mdβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ To run the tests, clone the repository, and then:
7575
# Setup the virtual environment
7676
python3 -m venv env
7777
source env/bin/activate
78-
pip install -e .
79-
pip install -r requirements.txt
78+
pip install -e . --group dev
8079

8180
# Run the tests
8281
./runtests.py

β€Ždocs/community/project-management.mdβ€Ž

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,6 @@ When pushing the release to PyPI ensure that your environment has been installed
8181

8282
---
8383

84-
## Project requirements
85-
86-
All our test requirements are pinned to exact versions, in order to ensure that our test runs are reproducible. We maintain the requirements in the `requirements` directory. The requirements files are referenced from the `tox.ini` configuration file, ensuring we have a single source of truth for package versions used in testing.
87-
88-
Package upgrades should generally be treated as isolated pull requests. You can check if there are any packages available at a newer version, by using the `pip list --outdated`.
89-
90-
---
91-
9284
## Project ownership
9385

9486
The PyPI package is owned by `@tomchristie`. As a backup `@j4mie` also has ownership of the package.

β€Žpyproject.tomlβ€Ž

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,57 @@ classifiers = [
3131
"Topic :: Internet :: WWW/HTTP",
3232
]
3333
dynamic = [ "version" ]
34-
3534
dependencies = [ "django>=4.2" ]
3635
urls.Changelog = "https://www.django-rest-framework.org/community/release-notes/"
3736
urls.Funding = "https://fund.django-rest-framework.org/topics/funding/"
3837
urls.Homepage = "https://www.django-rest-framework.org"
3938
urls.Source = "https://github.com/encode/django-rest-framework"
4039

40+
[dependency-groups]
41+
dev = [
42+
{ include-group = "docs" },
43+
{ include-group = "optional" },
44+
{ include-group = "test" },
45+
]
46+
test = [
47+
# temporary pin of attrs
48+
"attrs==22.1.0",
49+
"importlib-metadata<5.0",
50+
51+
# Pytest for running the tests.
52+
"pytest>=7.0.1,<8",
53+
"pytest-cov>=4.0.0,<5.0",
54+
"pytest-django>=4.5.2,<5",
55+
56+
# Remove when dropping support for Django<5.0
57+
"pytz",
58+
]
59+
docs = [
60+
# MkDocs to build our documentation.
61+
"mkdocs==1.6.0",
62+
# pylinkvalidator to check for broken links in documentation.
63+
"pylinkvalidator==0.3",
64+
]
65+
optional = [
66+
# Optional packages which may be used with REST framework.
67+
"coreapi==2.3.1",
68+
"coreschema==0.0.4",
69+
"django-filter",
70+
"django-guardian>=2.4.0,<2.5",
71+
"inflection==0.5.1",
72+
"legacy-cgi; python_version>='3.13'",
73+
"markdown>=3.3.7",
74+
"psycopg[binary]>=3.1.8",
75+
"pygments~=2.17.0",
76+
"pyyaml>=5.3.1,<5.4",
77+
]
78+
django42 = [ "django>=4.2,<5.0" ]
79+
django50 = [ "django>=5.0,<5.1" ]
80+
django51 = [ "django>=5.1,<5.2" ]
81+
django52 = [ "django>=5.2,<6.0" ]
82+
django60 = [ "django>=6.0,<6.1" ]
83+
djangomain = [ "django @ https://github.com/django/django/archive/main.tar.gz" ]
84+
4185
[tool.setuptools]
4286

4387
[tool.setuptools.dynamic]
@@ -68,6 +112,7 @@ ignore-words-list = "fo,malcom,ser"
68112

69113
[tool.pyproject-fmt]
70114
max_supported_python = "3.14"
115+
keep_full_version = true
71116

72117
[tool.pytest.ini_options]
73118
addopts = "--tb=short --strict-markers -ra"

β€Žrequirements.txtβ€Ž

Lines changed: 0 additions & 13 deletions
This file was deleted.

β€Žrequirements/requirements-documentation.txtβ€Ž

Lines changed: 0 additions & 5 deletions
This file was deleted.

β€Žrequirements/requirements-optionals.txtβ€Ž

Lines changed: 0 additions & 11 deletions
This file was deleted.

β€Žrequirements/requirements-packaging.txtβ€Ž

Lines changed: 0 additions & 8 deletions
This file was deleted.

β€Žrequirements/requirements-testing.txtβ€Ž

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
Β (0)