GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(build): use packaging instead of relying on pkg_resources from setuptools by samypr100 · Pull Request #742 · MagicStack/uvloop

Conversation

@samypr100

@samypr100 samypr100 commented Apr 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tjkuson reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@samypr100

samypr100 commented Apr 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Should've checked other PRs and issues. Apologies.

  • Use of deprecated / removed pkg_resources #729
  • Fix CI #727
  • fix: replace pkg_resources with packaging for setuptools 82+ #737

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@samypr100
samypr100 force-pushed the packaging branch from 6ab98cd to 3c3e439 Compare April 3, 2026 19:43
@samypr100
fix: use packaging instead of relying on pkg_resources
1640d6e
@samypr100
samypr100 force-pushed the packaging branch from 2fe06bc to 1640d6e Compare April 3, 2026 20:04
@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
@samypr100 samypr100 mentioned this pull request Apr 4, 2026
fix(tests): explicit yield in test_create_ssl_server_manual_connection_lost #743
Merged
This was referenced Apr 25, 2026
feat(loop): support eager_start in loop.create_task #748
Merged
support **kwargs on loop.create_task like in 3.13 and 3.14 #746
Closed
@graingert-coef

graingert-coef commented Apr 25, 2026

Copy link
Copy Markdown

There's generally no point in using packaging to check for cython version. If the user has the correct packaging installed they probably are building using PEP 517 already so the check is redundant personally I'd just remove this code

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@samypr100

samypr100 commented Apr 25, 2026

Copy link
Copy Markdown
Contributor Author

There's generally no point in using packaging to check for cython version. If the user has the correct packaging installed they probably are building using PEP 517 already so the check is redundant personally I'd just remove this code

Fair, I agree as well 😅. I kept it as-is as that's what pkg_resources was being used for before. Trying to make it as simple as possible for the reviewers...

fantix reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fantix
fantix approved these changes Apr 28, 2026
View reviewed changes
@fantix
fantix merged commit b377b7c into MagicStack:master Apr 28, 2026
10 of 17 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@fantix fantix mentioned this pull request Apr 28, 2026
Fix CI #727
Closed
@samypr100
samypr100 deleted the packaging branch April 28, 2026 17:18
@fantix fantix mentioned this pull request Apr 28, 2026
fix: replace pkg_resources with packaging for setuptools 82+ #737
Closed
@fantix fantix mentioned this pull request Sep 30, 2026
uvloop 0.23.0 #768
Merged
jensbjorgensen pushed a commit to jensbjorgensen/uvloop that referenced this pull request Oct 6, 2026
@fantix
uvloop 0.23.0
c5f7deb
Changes
=======

* Add Python 3.15 and 3.15t wheel builds and CI coverage (MagicStack#758)
  (by @honglei @fantix in f7c0547)

* Add support for the `eager_start` keyword argument in create_task() (MagicStack#748)
  (by @samypr100 in 3cbb095 for MagicStack#746 MagicStack#718)

* Add thread name prefix to the default thread pool executor (MagicStack#636)
  (by @inikolaev @fantix in 0582f94 for MagicStack#562)

* Add support for special hostname `<broadcast>` (MagicStack#592)
  (by @jpbede in 3060ceb for MagicStack#540)

* Upgrade libuv to v1.52.1 (MagicStack#753)
  (by @fantix in e8efea4 for MagicStack#752)

* Improve performance by using Python C API to enter/exit context (MagicStack#627)
  (by @tarasko in 837ef22)

* Improve performance/latency of Transport.write (MagicStack#619)
  (by @tarasko in 1d9b6e0)

* Replace some SSL vectorcall with direct methods (MagicStack#626)
  (by @tarasko in 6a27cbe)

* Optimize SSL buffered reads using C values (MagicStack#629)
  (by @tarasko in a308f75)

Fixes
=====

* Detach socket on create_connection cancellation to prevent fd double-close (MagicStack#740)
  (by @junjzhang @fantix in dc680eb for MagicStack#645 MagicStack#738)

* Remove `loop._ready_len` in favor of `len(loop._ready)` (MagicStack#721)
  (by @x42005e1f in 5910a18 for MagicStack#720)

* Prefer inspect.iscoroutinefunction (MagicStack#705)
  (by @MatthieuDartiailh in fd65027 for MagicStack#703)

* Fix context tests by explicitly yielding after run_in_executor (MagicStack#743)
  (by @samypr100 in 6cd24cb)

* Fix test_create_connection_open_con_addr with Python 3.13.9+ (MagicStack#713)
  (by @shadchin in b93141a for MagicStack#701)

* Skip flaky test_cancel_post_init on asyncio 3.13+ (MagicStack#714)
  (by @fantix in 3ea5c85 for MagicStack#709)

* Fix flaky test_fs_event (MagicStack#717)
  (by @fantix in 8da4547)

* Use C __atomic builtins for debug counters (MagicStack#719)
  (by @fantix in 836e3b2)

* Update the example to work with Python 3.14 (MagicStack#710)
  (by @Jamie-Chang in b74c2f1)

Build
=====

* Replace pkg_resources with packaging and use Cython 3.1 (MagicStack#742)
  (by @samypr100 in b377b7c for MagicStack#729)

* Remove wheel as a build dependency (MagicStack#696)
  (by @DimitriPapadopoulos in 173e88c)

* Support any number of flags in UVLOOP_OPT_CFLAGS (MagicStack#630)
  (by @mgorny in 963a5f3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@fantix fantix fantix approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Use of deprecated / removed pkg_resources

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@samypr100 @graingert-coef @fantix
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.