python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.08k stars 2.26k forks source link

When package has no constraints, Poetry assumes "^latest" #8052

Closed spencerwilson closed 1 year ago

spencerwilson commented 1 year ago

Issue

When running poetry add snowflake-connector-python I expected Poetry to add the latest version of the package for which there is a viable release on PyPI. This is what pip does:

% pip install snowflake-connector-python
Collecting snowflake-connector-python
  Downloading snowflake_connector_python-3.0.3-cp311-cp311-macosx_11_0_arm64.whl (13.7 MB)

In contrast,

% poetry -vvv add snowflake-connector-python
Using virtualenv: /Users/spencer/Library/Caches/pypoetry/virtualenvs/abc-z643ngl0-py3.11
[keyring.backend] Loading KWallet
[keyring.backend] Loading SecretService
[keyring.backend] Loading Windows
[keyring.backend] Loading chainer
[keyring.backend] Loading libsecret
[keyring.backend] Loading macOS
Creating new session for pypi.org
Source (PyPI): 119 packages found for snowflake-connector-python *
Using version ^3.0.4 for snowflake-connector-python
...

How'd it decide to use ^3.0.4 and not ^3.0.3 (which would have installed successfully)? Is this expected?

context: I was among those affected by https://github.com/snowflakedb/snowflake-connector-python/issues/1584, where this behavior of poetry resulted in some surprises.

dimbleby commented 1 year ago

duplicate #707, please close

github-actions[bot] commented 6 months ago

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.