Skip to content
Open
Show file tree
Hide file tree
Changes from 8 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
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: 'pip'
cache-dependency-path: 'requirements/*.txt'

- name: Upgrade packaging tools
run: python -m pip install --upgrade pip setuptools virtualenv wheel
Expand Down Expand Up @@ -60,7 +59,7 @@ jobs:
python-version: '3.13'

- name: Install dependencies
run: pip install -r requirements/requirements-documentation.txt
run: pip install --group docs

# Start mkdocs server and wait for it to be ready
- run: mkdocs serve &
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mkdocs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
paths:
- docs/**
- docs_theme/**
- requirements/requirements-documentation.txt
- pyproject.toml
- mkdocs.yml
- .github/workflows/mkdocs-deploy.yml

Expand All @@ -25,5 +25,5 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: 3.x
- run: pip install -r requirements/requirements-documentation.txt
- run: pip install --group docs
- run: mkdocs gh-deploy
3 changes: 1 addition & 2 deletions docs/community/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ To run the tests, clone the repository, and then:
# Setup the virtual environment
python3 -m venv env
source env/bin/activate
pip install -e .
pip install -r requirements.txt
pip install -e . --group dev

# Run the tests
./runtests.py
Expand Down
8 changes: 0 additions & 8 deletions docs/community/project-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,6 @@ When pushing the release to PyPI ensure that your environment has been installed

---

## Project requirements

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.

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`.

---

## Project ownership

The PyPI package is owned by `@tomchristie`. As a backup `@j4mie` also has ownership of the package.
Expand Down
40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,46 @@ classifiers = [
dynamic = [ "version" ]

dependencies = [ "django>=4.2" ]

[dependency-groups]
dev = [
{ include-group = "docs" },
{ include-group = "optional" },
{ include-group = "test" },
]

test = [
# temporary pin of attrs
"attrs==22.1",
"importlib-metadata<5",

# Pytest for running the tests.
"pytest>=7.0.1,<8",
"pytest-cov>=4,<5",
"pytest-django>=4.5.2,<5",

# Remove when dropping support for Django<5.0
"pytz",
]
docs = [
# MkDocs to build our documentation.
"mkdocs==1.6",
# pylinkvalidator to check for broken links in documentation.
"pylinkvalidator==0.3",
]
optional = [
# Optional packages which may be used with REST framework.
"coreapi==2.3.1",
"coreschema==0.0.4",
"django-filter",
"django-guardian>=2.4,<2.5",
"inflection==0.5.1",
"legacy-cgi; python_version>='3.13'",
"markdown>=3.3.7",
"psycopg[binary]>=3.1.8",
"pygments~=2.17.0",
"pyyaml>=5.3.1,<5.4",
]
urls.Changelog = "https://www.django-rest-framework.org/community/release-notes/"
urls.Funding = "https://fund.django-rest-framework.org/topics/funding/"
urls.Homepage = "https://www.django-rest-framework.org"
Expand Down
13 changes: 0 additions & 13 deletions requirements.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements/requirements-documentation.txt

This file was deleted.

11 changes: 0 additions & 11 deletions requirements/requirements-optionals.txt

This file was deleted.

8 changes: 0 additions & 8 deletions requirements/requirements-packaging.txt

This file was deleted.

9 changes: 0 additions & 9 deletions requirements/requirements-testing.txt

This file was deleted.

35 changes: 19 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,38 @@ envdir = {toxworkdir}/venvs/{envname}
setenv =
PYTHONDONTWRITEBYTECODE=1
PYTHONWARNINGS=once
dependency_groups =
test
optional
deps =
django42: Django>=4.2,<5.0
django50: Django>=5.0,<5.1
django51: Django>=5.1,<5.2
django52: Django>=5.2,<6.0
django60: Django>=6.0,<6.1
djangomain: https://github.com/django/django/archive/main.tar.gz
-rrequirements/requirements-testing.txt
-rrequirements/requirements-optionals.txt
django42: Django>=4.2,<5.0
django50: Django>=5.0,<5.1
django51: Django>=5.1,<5.2
django52: Django>=5.2,<6.0
django60: Django>=6.0,<6.1
djangomain: https://github.com/django/django/archive/main.tar.gz

[testenv:base]
; Ensure optional dependencies are not required
dependency_groups =
test
deps =
django<6.1
-rrequirements/requirements-testing.txt

[testenv:dist]
commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning runtests.py --no-pkgroot --staticfiles {posargs}
dependency_groups =
test
optional
deps =
django<6.1
-rrequirements/requirements-testing.txt
-rrequirements/requirements-optionals.txt

[testenv:docs]
skip_install = true
commands = mkdocs build
commands =
mkdocs build
dependency_groups =
test
docs
deps =
-rrequirements/requirements-testing.txt
-rrequirements/requirements-documentation.txt

[testenv:py312-djangomain]
ignore_outcome = true
Expand Down
Loading