Skip to content

Missing --extra-index-url lines in requirements.txt for second primary package source #269

@nsoranzo

Description

@nsoranzo

For a project I work on, we have a different package source configured as primary (since poetry deprecated default) with PyPI as second primary, as recommended in https://python-poetry.org/docs/repositories/ .

This is the relevant section of our pyproject.toml:

[[tool.poetry.source]]
name = "galaxyproject"
url = "https://wheels.galaxyproject.org/simple"
priority = "primary"

[[tool.poetry.source]]
name = "PyPI"
priority = "primary"

When exporting with poetry export -f requirements.txt --without-hashes --output requirements.txt the output file starts with just:

--index-url https://wheels.galaxyproject.org/simple

so when trying to install the project dependencies from this file, it fails with:

Looking in indexes: https://wheels.galaxyproject.org/simple
...
ERROR: Could not find a version that satisfies the requirement a2wsgi==1.10.4 (from versions: none)
ERROR: No matching distribution found for a2wsgi==1.10.4

Before the merge of #263 , the file started with:

--extra-index-url https://wheels.galaxyproject.org/simple

and it worked fine.
I think the proper solution is to also add for each primary after the first an --extra-index-url URL line, e.g. adding the following line fixes the issue for us:

--extra-index-url https://pypi.python.org/simple

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions