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

allow global configuration of project environments #9752

Open
mbtuckersimm opened this issue Dec 9, 2024 · 2 comments
Open

allow global configuration of project environments #9752

mbtuckersimm opened this issue Dec 9, 2024 · 2 comments
Labels
configuration Settings and such

Comments

@mbtuckersimm
Copy link

I recently encountered this problem installing ansible-lint for a work project. I won't reproduce all of that info here, but the gist of it is that in order to install a recent version of ansible-lint, I had to include the following chunk in my pyproject.toml file:

[tool.uv]
environments = ["platform_system != 'Windows'"]

This is fine, and I understand that this isn't really a problem with uv itself, but my work uses only Linux and macOS, and we'd like to configure this globally to avoid any potential problems with dependencies on Windows, and not have to remember to add this bit of config to the pyproject.toml file every time we start a new python project.

I tried adding

environments = ["platform_system != 'Windows'"]

to my ~/.config/uv/uv.toml file, but it didn't help. My reading of the relevant documentation is that this is just a per-project setting, and that it can't be set globally. I also did not see any relevant environment variables that could be set, although perhaps I missed something.

So, I guess the question is: is there a way to set this globally? If not, please consider adding this feature.

@ajlive
Copy link

ajlive commented Dec 9, 2024

This affects not only my work but also my personal projects. It would be great if I could globally specify a list of default platform or platforms like:

platforms = ["linux", "macos"]

Another option would be to have project templates that allow you to easily reproduce core settings without braving the uncertainties of copypasta.

@zanieb
Copy link
Member

zanieb commented Jan 7, 2025

I don't think we can have a global configuration for environments — that would invalidate the lockfile in projects.

We could have a global default for uv init.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Settings and such
Projects
None yet
Development

No branches or pull requests

3 participants