mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-12-23 10:02:54 +03:00
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 <alla.brunoo@gmail.com>
This commit is contained in:
parent
055c422b34
commit
edba7ad774
3
.github/workflows/main.yml
vendored
3
.github/workflows/main.yml
vendored
|
|
@ -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
|
||||
|
|
@ -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 &
|
||||
|
|
|
|||
4
.github/workflows/mkdocs-deploy.yml
vendored
4
.github/workflows/mkdocs-deploy.yml
vendored
|
|
@ -7,7 +7,7 @@ on:
|
|||
paths:
|
||||
- docs/**
|
||||
- docs_theme/**
|
||||
- requirements/requirements-documentation.txt
|
||||
- pyproject.toml
|
||||
- mkdocs.yml
|
||||
- .github/workflows/mkdocs-deploy.yml
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -31,13 +31,57 @@ classifiers = [
|
|||
"Topic :: Internet :: WWW/HTTP",
|
||||
]
|
||||
dynamic = [ "version" ]
|
||||
|
||||
dependencies = [ "django>=4.2" ]
|
||||
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"
|
||||
urls.Source = "https://github.com/encode/django-rest-framework"
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
{ include-group = "docs" },
|
||||
{ include-group = "optional" },
|
||||
{ include-group = "test" },
|
||||
]
|
||||
test = [
|
||||
# temporary pin of attrs
|
||||
"attrs==22.1.0",
|
||||
"importlib-metadata<5.0",
|
||||
|
||||
# Pytest for running the tests.
|
||||
"pytest>=7.0.1,<8",
|
||||
"pytest-cov>=4.0.0,<5.0",
|
||||
"pytest-django>=4.5.2,<5",
|
||||
|
||||
# Remove when dropping support for Django<5.0
|
||||
"pytz",
|
||||
]
|
||||
docs = [
|
||||
# MkDocs to build our documentation.
|
||||
"mkdocs==1.6.0",
|
||||
# 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.0,<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",
|
||||
]
|
||||
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 = [ "django @ https://github.com/django/django/archive/main.tar.gz" ]
|
||||
|
||||
[tool.setuptools]
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
|
|
@ -68,6 +112,7 @@ ignore-words-list = "fo,malcom,ser"
|
|||
|
||||
[tool.pyproject-fmt]
|
||||
max_supported_python = "3.14"
|
||||
keep_full_version = true
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
addopts = "--tb=short --strict-markers -ra"
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
# The base set of requirements for REST framework is actually
|
||||
# just Django and pytz, but for the purposes of development
|
||||
# and testing there are a number of packages that are useful
|
||||
# to install.
|
||||
|
||||
# Laying these out as separate requirements files, allows us to
|
||||
# only included the relevant sets when running tox, and ensures
|
||||
# we are only ever declaring our dependencies in one place.
|
||||
|
||||
-r requirements/requirements-optionals.txt
|
||||
-r requirements/requirements-testing.txt
|
||||
-r requirements/requirements-documentation.txt
|
||||
-r requirements/requirements-packaging.txt
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
# MkDocs to build our documentation.
|
||||
mkdocs==1.6.0
|
||||
|
||||
# pylinkvalidator to check for broken links in documentation.
|
||||
pylinkvalidator==0.3
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# Optional packages which may be used with REST framework.
|
||||
coreapi==2.3.1
|
||||
coreschema==0.0.4
|
||||
django-filter
|
||||
django-guardian>=2.4.0,<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
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# Wheel for PyPI installs.
|
||||
wheel>=0.36.2,<0.40.0
|
||||
|
||||
# Twine for secured PyPI uploads.
|
||||
twine>=3.4.2,<4.0.2
|
||||
|
||||
# Transifex client for managing translation resources.
|
||||
transifex-client
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# Pytest for running the tests.
|
||||
pytest>=7.0.1,<8.0
|
||||
pytest-cov>=4.0.0,<5.0
|
||||
pytest-django>=4.5.2,<5.0
|
||||
importlib-metadata<5.0
|
||||
# temporary pin of attrs
|
||||
attrs==22.1.0
|
||||
pytz # Remove when dropping support for Django<5.0
|
||||
setuptools>=77.0.3
|
||||
38
tox.ini
38
tox.ini
|
|
@ -15,35 +15,35 @@ envdir = {toxworkdir}/venvs/{envname}
|
|||
setenv =
|
||||
PYTHONDONTWRITEBYTECODE=1
|
||||
PYTHONWARNINGS=once
|
||||
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
|
||||
dependency_groups =
|
||||
test
|
||||
optional
|
||||
django42: django42
|
||||
django50: django50
|
||||
django51: django51
|
||||
django52: django52
|
||||
django60: django60
|
||||
djangomain: djangomain
|
||||
|
||||
[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}
|
||||
deps =
|
||||
django<6.1
|
||||
-rrequirements/requirements-testing.txt
|
||||
-rrequirements/requirements-optionals.txt
|
||||
dependency_groups =
|
||||
test
|
||||
optional
|
||||
|
||||
[testenv:docs]
|
||||
skip_install = true
|
||||
commands = mkdocs build
|
||||
deps =
|
||||
-rrequirements/requirements-testing.txt
|
||||
-rrequirements/requirements-documentation.txt
|
||||
commands =
|
||||
mkdocs build
|
||||
dependency_groups =
|
||||
test
|
||||
docs
|
||||
|
||||
[testenv:py312-djangomain]
|
||||
ignore_outcome = true
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user