Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Grinkers
Copy link
Contributor

@Grinkers Grinkers commented Jul 8, 2025

This is a proper fix for #4162

uv scans many paths. At least the System, User, and Workspace. It silently merges the options. This PR is a revert of our workaround and explicitly overrides the UV_PYTHON_DOWNLOADS flag to always download python.

@zanieb
Copy link

zanieb commented Jul 8, 2025

You could also set UV_NO_CONFIG or --no-config, I'm not sure if you want to respect other user uv settings.

@Grinkers
Copy link
Contributor Author

Grinkers commented Jul 8, 2025

astral-sh/uv#3420
uv follows the precedence that cargo has set with silently unifying. I think we should probably let users have their settings? But also maybe we just want to do things for the user.

I'll let @dae decide.

@dae
Copy link
Member

dae commented Jul 9, 2025

We want Anki to function correctly regardless of the customization a user's done to the system-wide uv, so I think we might be best off with a two-pronged approach: clearing out the existing env vars, and disabling the use of system config. WDYT of the change I've pushed?

@Grinkers
Copy link
Contributor Author

Grinkers commented Jul 9, 2025

We want Anki to function correctly regardless of the customization a user's done to the system-wide uv, so I think we might be best off with a two-pronged approach: clearing out the existing env vars, and disabling the use of system config. WDYT of the change I've pushed?

I did a clean build of 7760fd2 and it works on my system, so I think we're good.

For future reference as of Fedora 25-07,

cat /etc/uv/uv.toml
# The RPM-packaged uv deviates from the default configuration in two ways.
#
# First, we set "python-downloads" to "manual" in order to avoid unintended
# Python downloads. We suggest using RPM-packaged (system) Pythons that benefit
# from distribution maintenance and integration. Use "uv python install" to
# manually install managed Pythons.
#
# Second, we set "python-preference" to "system" instead of "managed".
# Otherwise, any managed Python would be used for uv operations where no
# particular Python is specified, even if the only available managed Python
# were much older than the primary system Python.
#
# No choices can be appropriate for all users and applications. To restore the
# default behavior, comment out settings in this file or override them in a
# configuration file with higher precedence, such as a user-level configuration
# file. See https://docs.astral.sh/uv/configuration/files/ for details on the
# interaction of project-, user-, and system-level configuration files.
#
# https://docs.astral.sh/uv/reference/settings/#python-downloads
python-downloads = "manual"
# https://docs.astral.sh/uv/reference/settings/#python-preference
python-preference = "system"

@dae
Copy link
Member

dae commented Jul 9, 2025

Thanks again for your help here :-)

Edit: I forgot to rename the PR title, oh well.

Edit 2: nothing's ever easy 😅 the removal of things like TEMP is breaking Windows

@dae dae merged commit dfbb730 into ankitects:main Jul 9, 2025
1 check passed
@Grinkers Grinkers deleted the uv-auto-download branch July 9, 2025 20:18
@nkh0472 nkh0472 mentioned this pull request Aug 8, 2025
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

Successfully merging this pull request may close these issues.

3 participants