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

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

Open
st31ny opened this issue Sep 30, 2024 · 0 comments
Open

Comments

@st31ny
Copy link

st31ny commented Sep 30, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant