-
Notifications
You must be signed in to change notification settings - Fork 901
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
Underscores in Git dependencies and [tool.uv.sources] #8328
Comments
Another example of an "other suprise" that we came across: gh repo clone cgravill/example_python_app
cd example_python_app
uv remove example_python_lib
git diff pyproject.toml we see: diff --git a/pyproject.toml b/pyproject.toml
index 71c2ebc..b043916 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,9 +4,7 @@ version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.13"
-dependencies = [
- "example_python_library",
-]
+dependencies = []
[tool.uv.sources]
example_python_library = { git = "https://github.com/cgravill/example_python_library.git" } i.e. it has removed the dependency from |
Hmm, I think |
@charliermarsh you're right I've confused the issue with that, I got into that when debugging around the issue @tpgillam more clearly reported (and has been extracted as separate issue). Since I've mentioned that though: I do somewhat expect symmetry between The other issue of adding the dependency again:
and git diff pyproject.toml
diff --git a/pyproject.toml b/pyproject.toml
index 71c2ebc..33d2eb3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,8 +5,9 @@ description = "Add your description here"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
- "example_python_library",
+ "example-python-library",
]
[tool.uv.sources]
example_python_library = { git = "https://github.com/cgravill/example_python_library.git" }
+example-python-library = { git = "https://github.com/cgravill/example_python_library.git" } is also an annoyance. The slightly more involved context that comes from is we also specify git |
Thanks all! |
This is reproduced from a private repository.
https://github.com/cgravill/example_python_library
https://github.com/cgravill/example_python_app
We've some packages that are named with underscores then referenced as git dependencies. Some of the dependencies are hand written so match the exact names like this:
https://github.com/cgravill/example_python_app/blob/24b446b856475297785d5d240a3dc08086fa51b5/pyproject.toml#L7-L12
In general use this all works, we can use
uv run
,uv lock
and others. What goes wrong is if we try use management commands:I think what's happening is that you folks are applying normalization prior commands: https://peps.python.org/pep-0503/#normalized-names which is totally reasonable. I'm mainly reporting as the behaviour caused quite a lot of confusion in the project (migrated from Poetry) and it might be possible to adjust the errors to lead folks down better paths.
There are also various other surprises if you say use
uv add https://github.com/cgravill/example_python_library.git
as you'll then get conflicting TOML parsing with the overlapping entries.Personally I think we're doing something ill-advised, though it's permitted by https://peps.python.org/pep-0503 so we're planning to just move all our project-names over to
-
as it'll just be simpler that way.Also to note if everything is done with
uv add
anduv remove
it works as the normalized names are written to pyproject.toml.uv 0.4.24 (b9cd549 2024-10-17)
The text was updated successfully, but these errors were encountered: