Skip to content

Conversation

@p-r-a-v-i-n
Copy link
Contributor

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.

@p-r-a-v-i-n p-r-a-v-i-n marked this pull request as draft December 7, 2025 13:56
@p-r-a-v-i-n p-r-a-v-i-n marked this pull request as ready for review December 7, 2025 14:10
@auvipy auvipy requested review from auvipy and Copilot December 7, 2025 15:03
Copy link

Copilot AI left a 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",
Copy link

Copilot AI Dec 7, 2025

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

Suggested change
"wheel>=0.36.2,<0.40",
"wheel>=0.36.2,<0.40.0",

Copilot uses AI. Check for mistakes.
tox.ini Outdated
django<6.1
-rrequirements/requirements-testing.txt
-rrequirements/requirements-optionals.txt
.[testing, optional]
Copy link

Copilot AI Dec 7, 2025

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.

Suggested change
.[testing, optional]
.[testing, optional]

Copilot uses AI. Check for mistakes.
tox.ini Outdated
deps =
-rrequirements/requirements-testing.txt
-rrequirements/requirements-documentation.txt
.[testing, documentation]
Copy link

Copilot AI Dec 7, 2025

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.

Suggested change
.[testing, documentation]
.[testing,documentation]

Copilot uses AI. Check for mistakes.
tox.ini Outdated
Comment on lines 42 to 43


Copy link

Copilot AI Dec 7, 2025

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.

Suggested change

Copilot uses AI. Check for mistakes.

- name: Install dependencies
run: pip install -r requirements/requirements-documentation.txt
run: pip install -e .[testing]
Copy link

Copilot AI Dec 7, 2025

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.

Suggested change
run: pip install -e .[testing]
run: pip install -e .[documentation]

Copilot uses AI. Check for mistakes.
tox.ini Outdated
djangomain: https://github.com/django/django/archive/main.tar.gz
-rrequirements/requirements-testing.txt
-rrequirements/requirements-optionals.txt
.[testing, optional]
Copy link

Copilot AI Dec 7, 2025

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.

Copilot uses AI. Check for mistakes.
@p-r-a-v-i-n p-r-a-v-i-n force-pushed the remove-requirements branch 2 times, most recently from 0699662 to 54a17b2 Compare December 7, 2025 15:37
Copy link
Member

@browniebroke browniebroke left a 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.

@p-r-a-v-i-n p-r-a-v-i-n force-pushed the remove-requirements branch 2 times, most recently from c87972b to 2f2086d Compare December 8, 2025 06:09
Copy link
Member

@browniebroke browniebroke left a 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
Copy link
Member

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)

Copy link
Contributor Author

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 .

Copy link
Member

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.

@browniebroke
Copy link
Member

I think there is still a mention here:

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

This one should be removed:

cache-dependency-path: 'requirements/*.txt'

And this one should be changed to pyproject.toml:

- requirements/requirements-documentation.txt

Also this:

- run: pip install -r requirements/requirements-documentation.txt

* 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.
@p-r-a-v-i-n
Copy link
Contributor Author

I think there is still a mention here:

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

This one should be removed:

cache-dependency-path: 'requirements/*.txt'

And this one should be changed to pyproject.toml:

- requirements/requirements-documentation.txt

Also this:

- run: pip install -r requirements/requirements-documentation.txt

Thanks for catching this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants