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

PIP_EXTRA_INDEX_URL ignored #1450

Closed
gwdekker opened this issue Feb 16, 2024 · 10 comments · Fixed by #1515
Closed

PIP_EXTRA_INDEX_URL ignored #1450

gwdekker opened this issue Feb 16, 2024 · 10 comments · Fixed by #1515
Assignees
Labels
compatibility Compatibility with another interface or tool

Comments

@gwdekker
Copy link

gwdekker commented Feb 16, 2024

Trying to run uv pip compile as a direct replacement for python -m piptools compile, it seems that the environment variable I have set for PIP_EXTRA_INDEX_URL is not picked up yet by uv.

@MichaReiser MichaReiser added the compatibility Compatibility with another interface or tool label Feb 16, 2024
@VMRuiz
Copy link

VMRuiz commented Feb 16, 2024

Also, using uv pip compile --extra-index-url $PIP_EXTRA_INDEX_URL doesn't work either if the URL contains credentials like: https://username:password@example.com.

error: Failed to download: private-package==0.0.1
  Caused by: HTTP status client error (401 Unauthorized) for url (https://example.com/packages/...)

Please let me know if this ticket is a good place to raise this or if I shall open a new one.

@MichaReiser
Copy link
Member

@VMRuiz this sounds like #1458 ?

@VMRuiz
Copy link

VMRuiz commented Feb 16, 2024

Yes, it seems like the same issue with a different error code.

@charliermarsh
Copy link
Member

I don't love reading environment variables that are specifically intended for other tools. It's similar to reading configuration that's intended for other tools -- it can cause problems if they change their own format. I'd prefer to have UV_EXTRA_INDEX_URL.

@gwdekker
Copy link
Author

That makes sense! Breaks the “drop in replacement” but only a tiny bit and for a very good reason. Thanks for the quick follow up and for this amazing package, can hardly wait to use it!

zanieb added a commit that referenced this issue Feb 16, 2024
@Pajinek
Copy link

Pajinek commented Feb 27, 2024

It looks that "--index-url" and "--no-build" is not support in requirements file. For example:

# file requirements.txt
--extra-index-url https://pypi.example.org/pypi
--no-binary  my-package1

aiohttp==3.9.1
aioredis==2.0.1
...

@charliermarsh
Copy link
Member

Index URL is supported, no-build is not. This is covered in other issues.

@Pajinek
Copy link

Pajinek commented Mar 1, 2024

I am not sure that extra-index-url works good, because that tries to install packages only from extra-index-url

error: HTTP status client error (401 Unauthorized) for url (https://pypi.mysite.com/pypi/httpcore/)
)

If I use pip install -r requirements.txt then all packages are installed without problem.

# requirements.txt 
--extra-index-url https://pypi.mysite.com/pypi

aiofiles==0.8.0
    # via gcloud-aio-storage
aiohttp==3.9.3
    # via
    #   -r requirements.in

@charliermarsh
Copy link
Member

Do you know why your index is returning a 401? If it returns an error code like 404, we would continue to search PyPI.

@Pajinek
Copy link

Pajinek commented Mar 6, 2024

Hi, I am not sure, but it works with original pip.

>> pip install -i https://pypi.example.com/simple/ aiohttp --verbose 
Looking in indexes: https://pypi.example.com/simple/
Collecting aiohttp
 Downloading https://pypi.example.com/api/package/aiohttp/aiohttp-3.9.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)

I tried to download package by wget manually and it works as well.

>> wget https://pypi.example.com/api/package/aiohttp/aiohttp-3.9.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Connecting to pypi.example.com (pypi.example.com)|...|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: Basic realm="pypi"
Reusing existing connection to pypi.example.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://storage.googleapis.com/...
...
HTTP request sent, awaiting response... 200 OK
aiohttp-3.9.3-cp312-cp312-manylinux_2_17_x86 100%[============================================================================================>]   1.25M  --.-KB/s    in 0.05s   

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with another interface or tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants