-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Removed requirements txt files from project. #9842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
pyproject.toml
Outdated
| "twine>=3.4.2,<4.0.2", | ||
|
|
||
| # Wheel for PyPI installs. | ||
| "wheel>=0.36.2,<0.40", |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version specification has been changed from wheel>=0.36.2,<0.40.0 (in requirements-packaging.txt) to wheel>=0.36.2,<0.40. The trailing .0 should be preserved to match the original upper bound. Change to "wheel>=0.36.2,<0.40.0".
| "wheel>=0.36.2,<0.40", | |
| "wheel>=0.36.2,<0.40.0", |
tox.ini
Outdated
| django<6.1 | ||
| -rrequirements/requirements-testing.txt | ||
| -rrequirements/requirements-optionals.txt | ||
| .[testing, optional] |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation: this line uses 7 spaces while line 25 uses 8 spaces. The indentation should be consistent across all deps entries. Use the same indentation as line 25.
| .[testing, optional] | |
| .[testing, optional] |
tox.ini
Outdated
| deps = | ||
| -rrequirements/requirements-testing.txt | ||
| -rrequirements/requirements-documentation.txt | ||
| .[testing, documentation] |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax for specifying multiple optional dependencies should use a comma without space: .[testing,documentation] instead of .[testing, documentation]. The space after the comma may cause issues with some pip versions.
| .[testing, documentation] | |
| .[testing,documentation] |
tox.ini
Outdated
|
|
||
|
|
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary trailing whitespace on this line. Remove the trailing spaces.
.github/workflows/main.yml
Outdated
|
|
||
| - name: Install dependencies | ||
| run: pip install -r requirements/requirements-documentation.txt | ||
| run: pip install -e .[testing] |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect optional dependencies specified. This workflow step should install documentation dependencies to run mkdocs, not testing dependencies. Change to pip install -e .[documentation] to match the original requirements-documentation.txt installation.
| run: pip install -e .[testing] | |
| run: pip install -e .[documentation] |
tox.ini
Outdated
| djangomain: https://github.com/django/django/archive/main.tar.gz | ||
| -rrequirements/requirements-testing.txt | ||
| -rrequirements/requirements-optionals.txt | ||
| .[testing, optional] |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax for specifying multiple optional dependencies should use a comma without space: .[testing,optional] instead of .[testing, optional]. The space after the comma may cause issues with some pip versions.
0699662 to
54a17b2
Compare
browniebroke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using optional-dependencies for that is IMO the wrong way to solve this.
c87972b to
2f2086d
Compare
browniebroke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nearly there
tox.ini
Outdated
| [testenv] | ||
| commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning runtests.py --coverage {posargs} | ||
| commands = | ||
| pip install --group test --group optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tox supports dependency-groups natively too: https://tox.wiki/en/stable/config.html#dependency_groups
You can specify them like we specify deps:
dependency_groups =
test
optional(I would put this just before the existing deps)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow thanks again Bruno, How do you do this everytime ? I'm really curious literally almost 2 to 3 times i went through https://tox.wiki/en/stable/config.html, trust me i remember i saw dependency_groups but i didn't understand what it was doing .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, tox is quite powerful and supports a ton of options, and it sometimes tricky to find the right knob in the documentation. This one is quite recent I imagine as PEP 735 is fairly new.
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. |
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.