Skip to content

Installing local package in editable mode fails for multiple indexes #6

@st31ny

Description

@st31ny

I have a python application with a couple of dependencies managed in a Pipfile. To test and run the application locally, I want to include it as editable installation in dev-packages. One of the application's dependencies shall be downloaded from a different index:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[[source]]
url = "https://${GITLAB_DEPLOY_USER}:${GITLAB_DEPLOY_PASS}@<gitlab>/api/v4/groups/<group>/-/packages/pypi/simple/"
verify_ssl = true
name = "gitlab"

[packages]
requests = "*"
mydep = {index="gitlab"}

[dev-packages]
myapp = {file = ".", editable = true}
pytest = "*"

[requires]
python_version = "3.11"

However, this setup causes a dependency conflict since pip now tries to install the package from both indexes (running pipenv lock --verbose):

CRITICAL:pipenv.patched.pip._internal.resolution.resolvelib.factory:Cannot install -r /tmp/pipenv-gyt1u0np-requirements/pipenv-s87osm9z-constraints.txt (line 3) because these package versions have conflicting dependencies.
INFO:pipenv.patched.pip._internal.resolution.resolvelib.factory:
The conflict is caused by:
    myapp 3.3.1.dev137+g173fb52b.d20240930 depends on mydep
    The user requested (constraint) mydep
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

When I set indexes = true in pyproject, credentials are apparently not passed to pip, so the download from the different index fails:

INFO:pipenv.patched.pip._internal.operations.prepare:Collecting mydep@ https://<gitlab>/api/v4/groups/<group>/-/packages/pypi/simple/mydep/ (from myapp==3.3.1.dev137+g173fb52b.d20240930->-r /tmp/pipenv-iadp574a-requirements/pipenv-tf4269xg-constraints.txt (line 5))
INFO:pipenv.patched.pip._internal.network.download:Using cached https://<gitlab>/api/v4/groups/<group>/-/packages/pypi/simple/mydep/
CRITICAL:pipenv.patched.pip._internal.utils.unpacking:Cannot unpack file /tmp/pip-unpack-t2mu_6bn/mydep (downloaded from /tmp/pip-temp-p15q7gst/mydep_5c90c7b5f8be4559887c76039c87b21e, content-type: text/html; charset=utf-8); cannot detect archive format

(Since the content-type is assumed to be text/html I assume that only an error message was downloaded).

So, how should I configure setuptools-pipfile to install myapp in editable mode? Is this possible at all?

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