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 upper Python version constraint #289

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RafaelWO
Copy link

@RafaelWO RafaelWO commented May 29, 2024

This PR removes the upper Python version constraint (<4.0.0) in pyproject.toml.

The idea behind this change is that users of autodoc_pydantic can have issues installing it in a downstream package if their package does not have such a constraint (see command output below).

Click for command output
$ poetry add "autodoc_pydantic[erdantic]"
Using version ^2.2.0 for autodoc-pydantic

Updating dependencies
Resolving dependencies... (0.1s)

The current project's supported Python range (>=3.9) is not compatible with some of the required packages Python requirement:
  - autodoc-pydantic requires Python <4.0.0,>=3.8.1, so it will not be satisfied for Python >=4.0.0

Because no versions of autodoc-pydantic match >2.2.0,<3.0.0
 and autodoc-pydantic[erdantic] (2.2.0) requires Python <4.0.0,>=3.8.1, autodoc-pydantic is forbidden.
So, because test-package-template depends on autodoc-pydantic[erdantic] (^2.2.0), version solving failed.

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
    
    For autodoc-pydantic, a possible solution would be to set the `python` property to ">=3.9,<4.0.0"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers

Furthermore, other prominent packages also do not have this upper constrain, e.g. FastAPI, rich, or transformers, so it should be fine 🙂

This avoids errors when adding autodoc_pydantic in other packages
that have no upper Python version constraint.
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.

1 participant