You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clarify the need(?) and use of --index-url and --extra-index-url. I might have over complicated some of the instructions given a misunderstanding of priority, but there seems to be no priority and no way to enforce priority. This I think lead to some of the confusion in #41.
Note that uv differs from pip here in that it does give higher priority to --extra-index-url (which is different than I would have assumed!).
From uv pip install --help:
...
-i, --index-url <INDEX_URL>
The URL of the Python package index (by default: <https://pypi.org/simple>).
The index given by this flag is given lower priority than all other indexes specified via the `--extra-index-url` flag.
Unlike `pip`, `uv` will stop looking for versions of a package as soon as it finds it in an index. That is, it isn't possible for `uv` to consider versions of the same package across multiple indexes.
[env: UV_INDEX_URL=]
--extra-index-url <EXTRA_INDEX_URL>
Extra URLs of package indexes to use, in addition to `--index-url`.
All indexes given via this flag take priority over the index in `--index-url` (which defaults to PyPI). And when multiple `--extra-index-url` flags are given, earlier values take priority.
Unlike `pip`, `uv` will stop looking for versions of a package as soon as it finds it in an index. That is, it isn't possible for `uv` to consider versions of the same package across multiple indexes.
[env: UV_EXTRA_INDEX_URL=]
...
I think it is, though we could easily check (and ask).
I thought that their aim was to be a drop-in replacement.
I believe the goal is for functionality to be achieved, not for design choices to be replicated. In the limitations section of the README they note
Limitations
While uv supports a large subset of the pip interface, it does not support the entire feature set.
In some cases, those differences are intentional; in others, they're a result of uv's early stage of development.
If there are issue with the order of indexes, one alternative would be for scientific python to have a "proxy index", that merges the json of multiple upstream index.
I'm wondering if a proxy index like that would even need a permanent server or could be hosted purely on an edge cloud as it is likely stateless.
Hum, it's theoretical, but basically you fetch multiple <repos>/simple/<package> and merge the pages. I believe I might talk about this with @ivanov last June in seattle.
Should now just work and "merge" Pypi and https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/, we should be able to add any other PyPI mirror or have crazy things like /random return only a subset of the wheel, or /binary, strip all the tgz if whl are present.. for example.
If it's of interest we could have that owned by the tools team, which would simplify the above (and we could have usage metrics...)
If it's of interest we could have that owned by the tools team, which would simplify the above (and we could have usage metrics...)
SGTM. Does @scientific-python/tools-team agree?
The only question I have is that I assume that you're currently paying for the any Cloudflare expenses for this at the moment, and while it seems like currently
the first 100,000 requests each day are free
for Cloudflare, which is good, can we make it so that your payment details don't ever get charged?
Yeah careful with Cloudflare pricing. There has been some articles where people complained about sudden changes and in the end they had to rewrite their whole integration because they could not pay...
For the index thing. I had also that issue/concern at work. In the end I ended up checking that the SHA in my lockfile was present on the index I wanted (and being strict about not following redirections). Something I hope I can ditch with uv once it's stable.
can we make it so that your payment details don't ever get charged
I don't think I have payment methods setup on cloudflare.
I also think that scientific-python should have a cloudflare account and the tools team should get delegated access to it anyway, and make sure it works well to delegate and we know how to debug/deploy/track metrics.
I think we can / should play with this a bit before recommending it also. In particular my POC does not support the /json because anaconda nightly upload channel does not.
What does happen when the free requests run out? Automatic charges, or access denied requests? If the latter, then I would say do the migration as soon as you can.
migrating to a scientific-python managed cloudflare (that can still be free).
moving from free to paid plan.
I think we should do 1 anyway as urls do reflect the org, and I would prefer to use scientifc-python.workers.dev instead of carreau.workers.dev
Paid plan we can discuss later, as there is a flat rate of $5/month that bump us from 100k to 10M regardless of wether you are under or above 100k requests.
Activity
matthewfeickert commentedon Mar 21, 2024
Relevant thing to point to (c.f. pypa/pip#8606 (comment)) is PEP 708 – Extending the Repository API to Mitigate Dependency Confusion Attacks (currently unimplimented).
matthewfeickert commentedon Mar 22, 2024
Note that
uvdiffers frompiphere in that it does give higher priority to --extra-index-url (which is different than I would have assumed!).From
uv pip install --help:martinfleis commentedon Mar 22, 2024
I'm curious if that's intended. I thought that their aim was to be a drop-in replacement.
matthewfeickert commentedon Mar 22, 2024
I think it is, though we could easily check (and ask).
I believe the goal is for functionality to be achieved, not for design choices to be replicated. In the limitations section of the README they note
matthewfeickert commentedon Mar 22, 2024
Yeah, it is intentional given astral-sh/uv#2083.
Carreau commentedon Mar 25, 2024
If there are issue with the order of
indexes, one alternative would be for scientific python to have a "proxy index", that merges the json of multiple upstream index.I'm wondering if a proxy index like that would even need a permanent server or could be hosted purely on an edge cloud as it is likely stateless.
matthewfeickert commentedon Mar 26, 2024
@Carreau do you have examples of these proxy indexes? I haven't heard of this before, so it would be interesting to see how they work.
Carreau commentedon Mar 26, 2024
Hum, it's theoretical, but basically you fetch multiple
<repos>/simple/<package>and merge the pages. I believe I might talk about this with @ivanov last June in seattle.Think:
That's the legacy API – I think anaconda.org only have it – but there is a new JSON API as well, so we might need some work to figure out the details.
We should only need to serve indexes, as the download come from somewhere else.
Carreau commentedon Mar 28, 2024
Here is a poc using flask: https://github.com/Carreau/multi-index which does work locally.
It's sync, but it should not be hard to make it async with various caching.
Carreau commentedon Jun 6, 2024
See https://github.com/Carreau/cloudflare-pypi-multi-index deployed on cloudflare workers on
https://nightly.carreau.workers.dev/nightly
Should now just work and "merge" Pypi and https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/, we should be able to add any other PyPI mirror or have crazy things like
/randomreturn only a subset of the wheel, or/binary, strip all the tgz if whl are present.. for example.If it's of interest we could have that owned by the tools team, which would simplify the above (and we could have usage metrics...)
matthewfeickert commentedon Jun 8, 2024
This is pretty great @Carreau! Thank you for building this.
SGTM. Does @scientific-python/tools-team agree?
The only question I have is that I assume that you're currently paying for the any Cloudflare expenses for this at the moment, and while it seems like currently
for Cloudflare, which is good, can we make it so that your payment details don't ever get charged?
tupui commentedon Jun 8, 2024
Yeah careful with Cloudflare pricing. There has been some articles where people complained about sudden changes and in the end they had to rewrite their whole integration because they could not pay...
For the index thing. I had also that issue/concern at work. In the end I ended up checking that the SHA in my lockfile was present on the index I wanted (and being strict about not following redirections). Something I hope I can ditch with uv once it's stable.
Carreau commentedon Jun 10, 2024
I don't think I have payment methods setup on cloudflare.
I also think that scientific-python should have a cloudflare account and the tools team should get delegated access to it anyway, and make sure it works well to delegate and we know how to debug/deploy/track metrics.
I think we can / should play with this a bit before recommending it also. In particular my POC does not support the
/jsonbecause anaconda nightly upload channel does not.bsipocz commentedon Jun 10, 2024
What does happen when the free requests run out? Automatic charges, or access denied requests? If the latter, then I would say do the migration as soon as you can.
Carreau commentedon Jun 11, 2024
https://developers.cloudflare.com/workers/platform/pricing/ and https://developers.cloudflare.com/workers/platform/limits/ suggest that it's 100,000 reset at midnight every day that stop working once passed the limit.
I think there are also 2 things:
I think we should do 1 anyway as urls do reflect the org, and I would prefer to use
scientifc-python.workers.devinstead ofcarreau.workers.devPaid plan we can discuss later, as there is a flat rate of $5/month that bump us from 100k to 10M regardless of wether you are under or above 100k requests.
bsipocz commentedon Jun 11, 2024
I fully support the plan above.