Skip to content

fix(build): use packaging instead of relying on pkg_resources from setuptools#742

Open
samypr100 wants to merge 1 commit intoMagicStack:masterfrom
samypr100:packaging
Open

fix(build): use packaging instead of relying on pkg_resources from setuptools#742
samypr100 wants to merge 1 commit intoMagicStack:masterfrom
samypr100:packaging

Conversation

@samypr100
Copy link
Copy Markdown

@samypr100 samypr100 commented Apr 3, 2026

When trying to build uvloop locally, I ended up encountering the issues mentioned in pypa/setuptools#5174

Reliance of pkg_resources causes pip install -e . to break given setuptools>60 build requirement pulls setuptools 82+. While a plausible fix is to setup a constraint like ,<82, I thought it'd be better to move to use packaging given the purpose pkg_resources was being used for (version checking) to avoid constraining downstream builders.

I also made sure the Cython versions were aligned to ~=3.1, seems like misalignment was introduced after #693

Disclosure (because this seems needed nowadays): This PR is made by human-only contribution without AI usage.

Closes #729

@samypr100
Copy link
Copy Markdown
Author

samypr100 commented Apr 3, 2026

Should've checked other PRs and issues. Apologies.

Upon reviewing, they're both missing some important areas that needed to be addressed (e.g. build-system.requires) for merging. This PR also doesn't convert Cython.__version__ to Version(Cython.__version__) as it's not needed. Lastly, it bounds the packaging version to >=20 which contains the minimal API's needed for what its used for (verified manually).

Note, the CI failures on 3.13.12 (less prominent on 3.13.11) and 3.14.3 (less prominent on 3.14.2) pipelines on test_create_ssl_server_manual_connection_lost when PYTHONASYNCIODEBUG=1 is set is unrelated to this change and seem to be happening in all other open PR's.

These unrelated failures would be fixed by #743

@samypr100 samypr100 marked this pull request as ready for review April 3, 2026 22:10
@samypr100 samypr100 changed the title Use packaging instead of relying on pkg_resources from setuptools fix(build): use packaging instead of relying on pkg_resources from setuptools Apr 4, 2026
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.

Use of deprecated / removed pkg_resources

1 participant