| |
@@ -0,0 +1,22 @@
|
| |
+ # 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"
|
| |
Configures
python-downloads = "manual", which keepsuvfrom automatically downloading precompiled Python interpreters from the Internet without asking; users can still ask to install these interpreters withuv python install.Original discussion and upstream documentation links in https://src.fedoraproject.org/rpms/uv/pull-request/16.
One choice I make here is to install the configuration file in the XDG-specified path
/etc/xdg/uv/uv.tomlrather than the also-supported/etc/uv/uv.toml. That seemed like the right choice to me, but I admit that/etc/xdg/is not widely used in practice.Another choice is not to set
python-preference = "system", at least for now. As @churchyard noted, users who have manually downloaded Python interpreters withuv python installpossibly/probably expect that they will be used. When I raised the various choices involved in this config file in the Fedora Python Matrix channel, a couple of people spoke up in favor of addingpython-preference = "system", but didn’t offer a rationale. This could be revisited in the future if someone comes up with a good justification.Sample behaviour on Fedora 41 with
python3.13installed (of course) and withpython3.12not installed.Before the config file with
python-downloads = "manual"was added, the above would have automatically downloaded and installed a managed interpreter. The user now has two choices:Or:
Disabling automatic Python interpreter downloads could be seen as a breaking change for some users, but there is some compromise required when we’re chasing a relatively new and fast-moving target, and the availability of system-wide configuration in
uvis brand new.