Closed jslorrma closed 2 months ago
I don't really know why the resolution is taking so long, debugging this by running with -vvv
would help. However, uv
prioritizes the extra-index-url
s. There is not really a way around this.
I think what we could do however is expose the no-index
uv option and then you could provide both the Azure DevOps Artifacts feed and the pypi.org/simple as extra index url. With the pypi url coming first. This will essentially be the behavior that you described, note that it will then always take a package from pypi.org/simple
first. Meaning that at that point your mirrored packages are not selected, only the ones not present on the official index.
Would this be sufficient?
BTW you could take a look at these options here, we can expose more of these if it would help: https://docs.astral.sh/uv/reference/settings/#pip_index-url
I think what we could do however is expose the no-index uv option and then you could provide both the Azure DevOps Artifacts feed and the pypi.org/simple as extra index url. With the pypi url coming first. This will essentially be the behavior that you described, note that it will then always take a package from pypi.org/simple first. Meaning that at that point your mirrored packages are not selected, only the ones not present on the official index.
Would this be sufficient?
Expose it as a configuration in pixi.toml
or pyproject.toml
, or just as a CLI option?
Having it as a configuration parameter would be fine. While it doesn't solve an issue directly, since, as mentioned, you can control the index order by swapping index-url
and extra-index-urls
, it could make the configuration more explicit.
Having it only as a CLI option or in the global config.toml
might not be helpful, as it requires additional configuration outside the project. One of the best things about pixi
is that it makes projects fully self-contained and reproducible. BTW, in this sense, it would be beneficial if the --pypi-keyring-provider subprocess
CLI option or the keyring-provider = "subprocess"
global config parameter could be set in pixi.toml
or pyproject.toml
as well.
However, uv prioritizes the extra-index-urls. There is not really a way around this. It would be helpful for other users if this information is included in the pixi documentation.
Anyhow, thanks for your response. The main goal of this issue was anyhow to document the problem and offer a solution for others who might encounter similar issues.
I think we can close this issue for now. If needed, we can address any no-index
concerns in a new issue or PR.
Alright! Thanks for the response, and I wholeheartedly agree, we want pixi.toml
to be as reproducible from the file itself as possible, so I would be for exposing it in the manifest.
I also agree with the keyring-provider
being able to be set from the manifest actually, will not create an issue out of it yet. But I think it something we should do in the future, will discuss this more internally.
Again, thanks for the thoughtful issue and replies. Will be closing this for now.
Checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pixi, using
pixi --version
.Reproducible example
pyproject.toml
pixi.lock
config.toml
Issue description
First of all, great work on Pixi! It has been incredibly helpful and has resolved many of our consistency issues.
Context:
pyproject.toml
Issue Scenario:
extra-index-urls
in [tool.pixi.pypi-options] table inpyproject.toml
, the pixi install command hangs duringupdating lock-file
atresolving package-xyz ...
and does not complete (even after 45 minutes).index-url
and defininghttps://pypi.org/simple
inextra-index-urls
, the installation completes without any issues.Debugging:
matplotlib
,numpy
, ...) without any private packages from the Azure DevOps Artifacts feed allowspixi install
to work, but updating lock-file is still kind of slow (installation takes over 5 minutes). However, it does eventually finish.pixi.lock
file shows that PyPI package URLs are all from Azure DevOps Artifacts (https://pkgs.dev.azure.com/...
) instead of fromhttps://files.pythonhosted.org/packages/....
index-url
andextra-index-urls
as described above results in a quick install and lock-file generation. In this case, thepixi.lock
file shows all PyPI packages have URLs as https://files.pythonhosted.org/packages.Expected behavior
Pixi should use
index-url
with highest priority andpixi install
,pixi shell
, ... should complete successfully without hanging, regardless of whether the Azure DevOps Artifacts feed is set as index-url or extra-index-urls.