Open carlotardivo opened 1 year ago
Please create a repo that reproduces this as there's enough complexity that a search-and-replace of (likely partially tested) reproducer pyproject.tomls is fraught. That being said, I immediately notice you have optional = true
for a dependency -- that is a feature used by extras only, and should not be used with the marker-based selection you are using.
@neersighted Does this mean that the use of extra groups is not compatible with the use of markers?
At this point I wonder if there is a hierarchy of use among groups, extras, and markers in the dependencies, but more importantly whether there are exclusion constraints ("this is not allowed with that"). By any chance are there clear references on this?
I @neersighted, thanks for the quick answer. That optional = True
was left by mistake (in the original use case the toml file had an actual extra dependency), however the problem remains the same after deleting it (in any case I'm quite interested on having an answer to @gianfa questions too).
If it is good for you I'm going to leave the optional = True
in the issue, and I also added a link to a repo that can be used to reproduce the error.
PS: in lib_c the python = ">=3.9,<3.10"
marker on the scipy dependency should be redundant, but I don't think it can be the source of the problem.
They're not incompatible; but without seeing a complete real (sanitized real, as opposed to synthetic recreation, as many users do not fully test their minimal reproductions) pyproject.toml(s), it's hard to know if it's not some use of extras not included in the reproduction that breaks things. We have that now, so I'm confident that was merely a red herring.
probably duplicates #5506
I @neersighted, sorry but I cannot fully understand what do you mean with complete real example. I linked a mock repo that can be easily cloned and where the error can be reproduced. Has anybody tried this? Did you have the same unexpected output as mine? If so, I think this should be labelled as a bug.
We have that now
We have a real clonable repro; I have not had time to investigate, but thank you for providing it.
If so, I think this should be labelled as a bug.
This is labeled as a bug, and as requiring triage/someone to reproduce and confirm the details.
Hi, adding my question here as it looks like a duplicate or something really close. Using Poetry 1.2.2 too.
[tool.poetry]
name = "RobotRun"
version = "1.0.0"
description = "Test Automation Framework"
authors = ["Tester <tester@mail.com>"]
[tool.poetry.dependencies]
python = ">=3.8, <3.12"
robotframework = [
{version = "3.1.2", python = "~3.8"},
{version = "~6", python = "^3.10"}
]
[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
robotframework-tidy = { version = "^3", python = ">=3.10"}
[build-system]
requires = ["poetry-core>=1.2"]
build-backend = "poetry.core.masonry.api"
With above config shouldn't the pass lock file creation be successful as robotframework-tidy
is only installed if Python is 3.10 or higher, when we are also having robotframework
6?
Now it fails with:
So, because robotrun depends on both robotframework (3.1.2) and robotframework-tidy (^3), version solving failed.
When RF 3.1.2 is changed to 4 (and resolve passes). the poetry install
work as expected and only installs robotframework-tidy
when Python 3.10 is used.
Hi, is there any update on this? Is there any plan to attack this issue in the nearby future? This unexpected behavior is becoming quite blocking for our organization.
What feels like another very similar reproduction; Package napari
sets python_requires = >=3.8
in their setup.cfg
, even though it isn't compatible with python 3.11; so I want the prerelease if using python 3.11.
[tool.poetry]
name = "test_resolve"
version = "0.1.0"
description = ""
authors = ["Some Person <some@example.com>"]
[tool.poetry.dependencies]
python = "^3.10"
napari = [
{version = "^0.4.18rc2", python = "^3.11"},
{version = "^0.4.17", python = "<3.11"},
]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
however, a poetry env use python3.10 && poetry install
still installs 0.4.18rc2 on python 3.10. (on Poetry 1.5.1). This seems like exactly the scenario described by https://python-poetry.org/docs/dependency-specification/#multiple-constraints-dependencies.
the constraint ^0.4.17
allows version 0.4.18rc2
, if you don't want that then write a tighter constraint
Ah! That works! But shouldn't that be filtered out by the fact that I didn't allow prereleases?
There is definitely some weirdness going on. It looks like selecting the prerelease explicitly for one of the restricted dependencies implicitly allows resolution of prereleases for all of the others, e.g.
napari = [
{version = "^0.4.17", python = "^3.11"},
{version = "^0.4.17", python = "<3.11"},
]
doesn't match 0.4.18rc2
on either python 3.10 or 3.11, but changing the 3.11 specifier to explicit prerelease does on both.
Perhaps this implicit allow-prerelease was intended - I couldn't find it mentioned in the documentation.
Even attempting to force no-prereleases failed (resolved the rc2 on 3.10)
napari = [
{version = "^0.4.18rc2", python = "^3.11"},
{version = "^0.4.17", allow-prereleases = false, python = "<3.11"},
]
and FWIW the only combination I found to get what I wanted was:
napari = [
{version = "^0.4.18rc2", python = "^3.11"},
{version = "<0.4.18a0", python = "<3.11"},
]
Poetry version: 1.2.2
Python version: 3.9.13
OS version and name: macOS Catalina, Version 0.15.7
[x] I am on the latest stable Poetry version, installed using a recommended method.
[x] I have searched the issues of this repo and believe that this is not a duplicate.
[x] I have consulted the FAQ and blog for any relevant entries or release notes.
[x] If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option) and have included the output below.Issue
Hi, I'm currently working on a multirepo context and I have a pyproject.toml file that has some other repos between its dependencies. I tried to recreate the situation with three empty repos
lib_a
,lib_b
,lib_c
wherelib_a
depends on the other two. To reproduce the error just clone this repo: https://github.com/carlotardivo/poetry-issue-6895 and execute apoetry lock -vvv
from lib_a root directory.These are the three pyproject.toml files:
lib_a:
lib_b
lib_c:
Expected result
Basically what I'd expect, according to these docs (python restrcted dependencies) is to be able to create a lock file that allows for the creation of an environment with
lib_b
(withscipy
1.5.*) when python ~3.7.13lib_b
(withscipy
1.8.0) andlib_c
installed only when python >=3.9,<3.10Actual result
The lock file generation breaks with the following error, that seems related to the fact that scipy 1.5 is looked also for python >=3.9,<3.10 (while only ^1.7.0 should in this python range):
I'm I missing something?
Thank you very much.