Skip to content
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

Remove pypy constraint for urllib3 #826

Closed
wants to merge 3 commits into from

Conversation

benwah
Copy link

@benwah benwah commented Feb 28, 2024

I'm not certain whether this is a bug in Poetry or with the marker in setup.py.

Context:

A platform_python_implementation is specified as PyPy for a urllib3 <2 constraint: https://github.com/kevin1024/vcrpy/blob/master/setup.py#L57

But in essence, if you depend on urllib3 >= 2 and use CPython + Poetry, you can't install vcrpy.

See sample poetry-compatible pyproject.toml

[tool.poetry]
name = "benny"
version = "0.1.0"
description = ""
authors = ["Me <hi@localhost>"]
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.10"
urllib3 = ">=2"
vcrpy = ">=6.0.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

When trying to install this with poetry:

$ poetry lock 
Updating dependencies
Resolving dependencies... (0.0s)

Because no versions of vcrpy match >6.0.0,<6.0.1 || >6.0.1
 and vcrpy (6.0.0) depends on urllib3 (<2), vcrpy (>=6.0.0,<6.0.1 || >6.0.1) requires urllib3 (<2).
And because vcrpy (6.0.1) depends on urllib3 (<2), vcrpy (>=6.0.0) requires urllib3 (<2).
So, because benny depends on both urllib3 (>=2) and vcrpy (>=6.0.0), version solving failed.

So I'm thinking either the platform_python_implementation =='PyPy'" marker is incorrect or Poetry isn't handling it as it should.

@benwah
Copy link
Author

benwah commented Feb 28, 2024

@hartwork - This might not be the right solution so you might not want to accept this PR... but please provide opinion if you can.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.32%. Comparing base (acc1014) to head (6089493).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #826   +/-   ##
=======================================
  Coverage   92.32%   92.32%           
=======================================
  Files          27       27           
  Lines        1811     1811           
  Branches      338      338           
=======================================
  Hits         1672     1672           
  Misses         92       92           
  Partials       47       47           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@hartwork hartwork left a comment

Choose a reason for hiding this comment

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

Hi @benwah,

this will need dropping of exclude…

- python-version: "pypy-3.10"
urllib3-requirement: "urllib3>=2"

…to prove that it works (if it does). Thanks!

@hartwork
Copy link
Collaborator

@benwah PS: The Poetry aspect is interesting, it might indeed be a bug there, I plan to have a closer look later.

@benwah
Copy link
Author

benwah commented Feb 28, 2024

Let's see how this goes.. I removed the exclude you referenced. cc @hartwork

@hartwork
Copy link
Collaborator

hartwork commented Mar 6, 2024

Let's see how this goes.. I removed the exclude you referenced. cc @hartwork

@benwah thank you! I believe with the new repeatedly failing CI — it doesn't seem flaky — we have our answer now: it cannot be dropped as of yet. Is that also what you concluded — should we close the pull request?

@benwah
Copy link
Author

benwah commented Mar 6, 2024

@hartwork Yeah let's close the PR. In your opinion is this a Poetry bug?

@hartwork
Copy link
Collaborator

hartwork commented Mar 6, 2024

@hartwork Yeah let's close the PR.

@benwah good, will do.

In your opinion is this a Poetry bug?

I reproduced it locally now with CPython 3.10 where VCR.py's…

    "urllib3 <2; python_version <'3.10'",
    "urllib3 <2; platform_python_implementation =='PyPy'",

…should by no means block an update to urllib3 >=2 but it does:

# poetry add urllib3
Using version ^2.2.1 for urllib3

Updating dependencies
Resolving dependencies... (0.1s)

Because vcrpy (6.0.1) depends on urllib3 (<2)
 and no versions of vcrpy match >6.0.1,<7.0.0, vcrpy (>=6.0.1,<7.0.0) requires urllib3 (<2).
So, because demo123 depends on both vcrpy (^6.0.1) and urllib3 (^2.2.1), version solving failed.

Support for PEP 508 markers is broken in Poetry 1.8.2, I confirm. It's a pity they closed python-poetry/poetry#8996 . Seems like a misunderstanding.

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.

3 participants