Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
p-r-a-v-i-n wants to merge12 commits intoencode:main
base:main
Choose a base branch
Loading
fromp-r-a-v-i-n:remove-requirements

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-np-r-a-v-i-n marked this pull request as draftDecember 7, 2025 13:56
@p-r-a-v-i-np-r-a-v-i-n marked this pull request as ready for reviewDecember 7, 2025 14:10
Copy link

CopilotAI 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 multiplerequirements/*.txt files to a centralizedpyproject.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
FileDescription
pyproject.tomlAdded four optional-dependencies groups (documentation, optional, packaging, testing) with migrated dependencies
tox.iniUpdated all test environments to install dependencies using.[group] syntax instead of-r requirements/*.txt
docs/community/contributing.mdUpdated installation instructions to use pyproject.toml optional dependencies
.github/workflows/main.ymlUpdated CI workflow to install dependencies from pyproject.toml
requirements.txtRemoved root requirements file
requirements/requirements-*.txtRemoved all requirements directory files

💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.

tox.ini Outdated
django<6.1
-rrequirements/requirements-testing.txt
-rrequirements/requirements-optionals.txt
.[testing, optional]
Copy link

CopilotAIDec 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

CopilotAIDec 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

CopilotAIDec 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

CopilotAIDec 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 topip 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

CopilotAIDec 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-np-r-a-v-i-nforce-pushed theremove-requirements branch 2 times, most recently from0699662 to54a17b2CompareDecember 7, 2025 15:37
Copy link
Member

@browniebrokebrowniebroke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Usingoptional-dependencies for that is IMO the wrong way to solve this.

@p-r-a-v-i-np-r-a-v-i-nforce-pushed theremove-requirements branch 2 times, most recently fromc87972b to2f2086dCompareDecember 8, 2025 06:09
Copy link
Member

@browniebrokebrowniebroke 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

@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
ContributorAuthor

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.

browniebroke
browniebroke previously approved these changesDec 10, 2025
Copy link
Member

@browniebrokebrowniebroke left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for taking this on, looks good to me

PS: will leave this open for a few days to give time to other maintainers to take a look

p-r-a-v-i-n reacted with thumbs up emoji
Project's URLs should be in the [project] table
@browniebroke
Copy link
Member

Looking atthe logs more closely, I think something isn't right:

py310-django42: asgiref==3.11.0,attrs==22.1.0,certifi==2025.11.12,charset-normalizer==3.4.4,coreapi==2.3.1,coreschema==0.0.4,coverage==7.13.0,Django==5.2.9,django-filter==25.2,django-guardian==2.4.0,djangorestframework @ file:///home/runner/work/django-rest-framework/django-rest-framework/.tox/.tmp/package/1/djangorestframework-3.16.1.tar.gz#sha256=2aed51d9d37a155d67965e004f4c13de30000ed00f4d684a7009a7b3d5fa5e37,exceptiongroup==1.3.1,idna==3.11,importlib-metadata==4.13.0,inflection==0.5.1,iniconfig==2.3.0,itypes==1.2.0,Jinja2==3.1.6,Markdown==3.10,MarkupSafe==3.0.3,packaging==25.0,pip==25.3,pluggy==1.6.0,psycopg==3.3.2,psycopg-binary==3.3.2,Pygments==2.17.2,pytest==7.4.4,pytest-cov==4.1.0,pytest-django==4.11.1,pytz==2025.2,PyYAML==5.3.1,requests==2.32.5,setuptools==80.9.0,sqlparse==0.5.4,tomli==2.3.0,typing_extensions==4.15.0,uritemplate==4.2.0,urllib3==2.6.2,zipp==3.23.0py310-django42: commands[0]> python -W error::DeprecationWarning -W error::PendingDeprecationWarning runtests.py --coverage/home/runner/work/django-rest-framework/django-rest-framework/.tox/venvs/py310-django42/lib/python3.10/site-packages/coreapi/utils.py:5: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.  import pkg_resources============================= test session starts ==============================platform linux -- Python 3.10.19, pytest-7.4.4, pluggy-1.6.0cachedir: .tox/venvs/py310-django42/.pytest_cachedjango: version: 5.2.9rootdir: /home/runner/work/django-rest-framework/django-rest-frameworkconfigfile: pyproject.tomlplugins: django-4.11.1, cov-4.1.0collected 1618 items

Thepy310-django42 tox target runs rightfully on Python 3.10 but it runs against Django 5.2

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

p-r-a-v-i-n commentedDec 17, 2025
edited
Loading

The py310-django42 tox target runs rightfully on Python 3.10 but it runs against Django 5.2

may be bcs of this step
py310-django42: install_package_deps> python -I -m pip install 'django>=4.2'

@browniebroke
Copy link
Member

browniebroke commentedDec 17, 2025
edited
Loading

Right so tox does:

  1. install deps from tox targetpy312-django42: install_deps> pip install 'Django<5.0,>=4.2'
  2. Install dependency-groups
  3. Install package depspy312-django42: install_package_deps> pip install 'django>=4.2'
  4. Install packagepy312-django42: install_package> pip install --reinstall --no-deps .

So I initially assumed step 3 overrides the version from step 1, but it's actually overridden in step 2 (by runningtox -re py312-django42 -vv)

DEBUG Requirement installed, but mismatched:  Installed: InstalledDist { kind: Registry(InstalledRegistryDist { name: PackageName("django"), version: "4.2.27", path: ".../.tox/venvs/py312-django42/lib/python3.12/site-packages/django-4.2.27.dist-info", cache_info: None, build_info: None }), metadata_cache: OnceLock(<uninit>), tags_cache: OnceLock(<uninit>) }  Requested: Registry { specifier: VersionSpecifiers([VersionSpecifier { operator: Equal, version: "6.0" }]), index: Some(IndexMetadata { url: Pypi(VerbatimUrl { url: DisplaySafeUrl { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("pypi.org")), port: None, path: "/simple", query: None, fragment: None }, given: None }), format: Simple }), conflict: None }

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 😞

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

Reviewers

@browniebrokebrowniebrokebrowniebroke left review comments

Copilot code reviewCopilotCopilot left review comments

@auvipyauvipyAwaiting requested review from auvipy

@peterthomassenpeterthomassenAwaiting requested review from peterthomassen

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@p-r-a-v-i-n@browniebroke

[8]ページ先頭

©2009-2025 Movatter.jp