Skip to content

Conversation

@lcian
Copy link
Member

@lcian lcian commented Nov 3, 2025

validate.py should take into account the python_versions constraint for each package it tries to build.
If this doesn't happen, then validation will always fail if a package requires a python version that is too new (e.g. 3.13) but the pythons we validate on are lower than that (currently 3.11, 3.12, 3.13).

This was initially added for #1728
We don't need it anymore as we're downgrading the package to be compatible with 3.11.
However it might still be useful if we need this for some other package in the future.

@lcian lcian force-pushed the lcian/validate_python_versions branch from 9cef1e0 to 9f61a09 Compare November 3, 2025 14:26
@lcian lcian requested a review from joshuarli November 3, 2025 14:53
Copy link
Member

@joshuarli joshuarli left a comment

Choose a reason for hiding this comment

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

i thought the same back in 2024: #643 (comment)
and proposed a similar but more hacky patch: b2649a1

i now forget / i don't understand anthony's reasoning at the time: "validate must succeed on all installable targets. otherwise we're building a wheel that is installable but broken"

i'll take a closer look at this soon as i think it makes sense to have

edit: hmm so

validating python3.11: dist/objectstore_client-0.0.3-py3-none-any.whl
creating env
=> installing
ERROR: Package 'objectstore-client' requires a different Python: 3.11.10 not in '>=3.13'

Technically this is not correct because a py3-none-any wheel shouldn't have pyproject requires-python >= 3.13. I think that's what anthony was trying to say. It should be py313-none-any.

I'm not sure what that's happening because a pyproject.toml with requires-python >= 3.13 should result in py313-none-any. Maybe it's a craft bug? I don't think we're in the wrong here as it's doing the correct thing - a py3-none-any wheel should be validated on 3.11, 3.12, 3.13 - all installable versions that internal pypi supports.

@lcian
Copy link
Member Author

lcian commented Nov 4, 2025

I'm not too familiar with how wheel tags work, but py3-none-any is what I get using uv (version 0.9.3) and specifying requires_python = ">=3.13".
So either uv is behaving in a nonstandard way, or this is correct and only requires_python should be taken into account.
See https://github.com/getsentry/objectstore/blob/main/clients/python/pyproject.toml for the setup, even though we have since then downgraded the requirement after being unable to publish here.

As a random example, see also sentry-sdk https://pypi.org/project/sentry-sdk/#files
The wheel is tagged as sentry_sdk-2.43.0-py2.py3-none-any.whl even though we specify python_requires=">=3.6" in setup.py:
https://github.com/getsentry/sentry-python/blob/7264a9f7881a75e876bdac9fb0c632b83732ef57/setup.py#L40
(I'm ignorant on whether this differs in semantics from specifying requires_python in pyproject.toml though)

For the record, another problem we had was that we would have to specify python_versions = >=3.13 manually on every release and that would've been annoying.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants