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

Use .python-version as version constraint when absent from pyproject.toml #4284

Closed
2 tasks done
l0b0 opened this issue Jul 14, 2021 · 3 comments
Closed
2 tasks done
Labels
kind/feature Feature requests/implementations

Comments

@l0b0
Copy link

l0b0 commented Jul 14, 2021

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

Add a configuration and command-line flag to say whether the contents of .python-version should be treated as a version restriction in the same way as the tool.poetry.dependencies.python setting. Projects which only support the exact version in .python-version could set this flag to True and remove tool.poetry.dependencies.python. Then they won't have to keep both settings in sync.

Example configuration:

[tool.poetry.pyenv]
use-version-as-constraint = true

or

[tool.poetry]
use-pyenv-version-as-constraint = true

This is not the same as #2019 or #2558.

@l0b0 l0b0 added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Jul 14, 2021
@finswimmer
Copy link
Member

Hello @l0b0,

thanks a lot for your suggestion. However poetry will most likely not implement such a feature for various reasons:

  • The pyproject.toml is the single source of truth for all package metadata including the dependencies and python requirements
  • Poetry tries to avoid implementing configs that are specific to external tools

fin swimmer

@caniko
Copy link

caniko commented Jul 26, 2021

Hello @l0b0,

thanks a lot for your suggestion. However poetry will most likely not implement such a feature for various reasons:

  • The pyproject.toml is the single source of truth for all package metadata including the dependencies and python requirements
  • Poetry tries to avoid implementing configs that are specific to external tools

fin swimmer

Your reasoning implies that the suggestion excludes other frameworks, it doesn't. It simply provides a basic level of support for pyenv. It is inclusive rather than being exclusive.

pyenv is one of the best if not the best in its category. There should be at least some level of direct support for it on poetry. poetry env use is also bugged. I have to use pyenv global <preferred version> every time I am making a new environment in order to install the correct version.

To go full purism at this point is highly idealistic, and ignores the fact that poetry doesn't work as intended without these features frequently.

@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Feature requests/implementations
Projects
None yet
Development

No branches or pull requests

4 participants