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

Poetry adds conflicting requirements when cases are mixed #6831

Closed
4 tasks done
adamchainz opened this issue Oct 18, 2022 · 1 comment · Fixed by #6832
Closed
4 tasks done

Poetry adds conflicting requirements when cases are mixed #6831

adamchainz opened this issue Oct 18, 2022 · 1 comment · Fixed by #6832
Labels
kind/bug Something isn't working as expected status/confirmed Issue is reproduced and confirmed

Comments

@adamchainz
Copy link
Contributor

  • Poetry version: 1.2.2
  • Python version: 3.10.8
  • OS version and name: macOS 12.6
  • pyproject.toml: see below
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Take this minimal pyproject.toml config for poetry:

[tool.poetry]
name = "example"
version = "0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "^3.10"
Django = "^4.0.8"


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

Then run a command to upgrade Django:

$ poetry add "Django@4.1.2"
Creating virtualenv example-i90kWyrF-py3.10 in /Users/chainz/Library/Caches/pypoetry/virtualenvs

Updating dependencies
Resolving dependencies... (0.5s)

Writing lock file

Package operations: 3 installs, 0 updates, 0 removals

  • Installing asgiref (3.5.2)
  • Installing sqlparse (0.4.3)
  • Installing django (4.1.2)

Poetry adds a second lower-cased dependency on Django to its configuration:

[tool.poetry]
name = "example"
version = "0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "^3.10"
Django = "^4.0.8"
django = "4.1.2"


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

This difference lead to a crash when building a project Docker container:

 > [stage-1  7/18] RUN   poetry config virtualenvs.create false &&   poetry install:
#17 0.749 Skipping virtualenv creation, as specified in config file.
#17 1.881 Installing dependencies from lock file
#17 3.363
#17 3.363 Because example depends on both Django (^4.1.2) and django (4.0.8), version solving failed.

Unfortunately I didn't manage to replicate this crash with poetry install with my minimal example, outside of Docker.

@adamchainz adamchainz added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 18, 2022
@finswimmer finswimmer added status/confirmed Issue is reproduced and confirmed and removed status/triage This issue needs to be triaged labels Oct 18, 2022
Copy link

github-actions bot commented Mar 1, 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 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/confirmed Issue is reproduced and confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants