Removed requirements txt files from project.#9842
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates dependency management from multiple requirements/*.txt files to a centralized pyproject.toml configuration, organizing dependencies into optional dependency groups (testing, optional, documentation, packaging). This modernizes the project's dependency management approach using PEP 621 standards.
Key Changes
- Migrated all dependencies from 5 requirements files into pyproject.toml optional-dependencies groups
- Updated tox.ini to use pyproject.toml optional dependencies instead of requirements files
- Updated installation instructions in documentation and CI workflows
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Added four optional-dependencies groups (documentation, optional, packaging, testing) with migrated dependencies |
| tox.ini | Updated all test environments to install dependencies using .[group] syntax instead of -r requirements/*.txt |
| docs/community/contributing.md | Updated installation instructions to use pyproject.toml optional dependencies |
| .github/workflows/main.yml | Updated CI workflow to install dependencies from pyproject.toml |
| requirements.txt | Removed root requirements file |
| requirements/requirements-*.txt | Removed all requirements directory files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0699662 to
54a17b2
Compare
browniebroke
left a comment
There was a problem hiding this comment.
Using optional-dependencies for that is IMO the wrong way to solve this.
c87972b to
2f2086d
Compare
2f2086d to
e5a1a57
Compare
e5a1a57 to
70b7949
Compare
70b7949 to
c847be5
Compare
|
I think there is still a mention here: django-rest-framework/docs/community/project-management.md Lines 84 to 88 in c847be5 This one should be removed: And this one should be changed to pyproject.toml: Also this: |
* 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.
Thanks for catching this. |
Project's URLs should be in the [project] table
|
Looking at the logs more closely, I think something isn't right: The |
may be bcs of this step |
|
Right so tox does:
So I initially assumed step 3 overrides the version from step 1, but it's actually overridden in step 2 (by running So one of our testing or optional dependency is requesting a Django version newer than 4.2, causing it to upgrade. It's a bit annoying that the incompatibility is not flagged more loudly 😞 |
peterthomassen
left a comment
There was a problem hiding this comment.
I'm not familiar enough with the various ways of managing requirements so that I don't feel competent to do a proper review. I'll be OK with what the other maintainers decide. Thank you!
browniebroke
left a comment
There was a problem hiding this comment.
I've checked the various CI jobs and they run with the right Python and Django versions. Docs job works as expected as well
* Bump the optional group with 4 updates Updates the requirements on [coreapi](https://github.com/core-api/python-client), [django-guardian](https://github.com/django-guardian/django-guardian), [pygments](https://github.com/pygments/pygments) and [pyyaml](https://github.com/yaml/pyyaml) to permit the latest version. Updates `coreapi` from 2.3.1 to 2.3.3 - [Commits](core-api/python-client@2.3.1...2.3.3) Updates `django-guardian` to 3.2.0 - [Release notes](https://github.com/django-guardian/django-guardian/releases) - [Commits](django-guardian/django-guardian@v2.4.0...3.2.0) Updates `pygments` to 2.19.2 - [Release notes](https://github.com/pygments/pygments/releases) - [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES) - [Commits](pygments/pygments@2.17.0...2.19.2) Updates `pyyaml` to 6.0.3 - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/6.0.3/CHANGES) - [Commits](yaml/pyyaml@5.3.1...6.0.3) --- updated-dependencies: - dependency-name: coreapi dependency-version: 2.3.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: optional - dependency-name: django-guardian dependency-version: 3.2.0 dependency-type: direct:development dependency-group: optional - dependency-name: pygments dependency-version: 2.19.2 dependency-type: direct:development dependency-group: optional - dependency-name: pyyaml dependency-version: 6.0.3 dependency-type: direct:development dependency-group: optional ... Signed-off-by: dependabot[bot] <support@github.com> * Add back setuptools Was added to testing requirements in #9818 But that was lost in: #9842 Moving to optional dep group as it's only needed for coreapi --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Asif Saif Uddin {"Auvi":"অভি"} <auvipy@gmail.com> Co-authored-by: Bruno Alla <alla.brunoo@gmail.com>
we have migrated to pyproject.toml so now I think it is safe to remove requirements folder and requirements.txt file bcs pyproject.toml could take care of those installations. I have shifted those all dependencies in pyproject.toml.