Skip to content

nox-poetry does not seem to support the source directive in a poetry definition #1117

@thondeboer

Description

@thondeboer

I have a package that requried pytorch and have the following directives in the pyproject.toml file

[tool.poetry.dependencies]
python = ">=3.8.1,<3.11"
.
.
.
torch = { version = "==2.0.1+cu118", source = "pytorch" }
torchvision = { version = "^0.15.2+cu118", source = "pytorch" }


[[tool.poetry.source]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu118"
priority = "explicit"

when trying to run a nox session with the noxfile that uses nox-poetry, I get this error in a mypy session:

ERROR: Cannot install genyx==0.1.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    genyx 0.1.0 depends on torch==2.0.1+cu118
    The user requested (constraint) torch==2.0.1+cu118

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
nox > Session mypy-3.10 failed.

I'm suspecting that the pip install command does not use the source directive from the poetry file? Not sure where the issue lies, but suspecting nox-poetry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions