#Hi, I have a strange behaviour in a
1 messages · Page 1 of 1 (latest)
I tried to create a module from scratch and copying the code, it seems to work without the dependency I added, so I have the feeling the uv add python-dotenv break my module but I don't understand why and how to revert it without recreate the same module
ok don't really know why but my first uv add failed because the package name was wrong then the dagger-io dependency was no more in the pyproject.toml
Hey @vapid obsidian, is it working now? Was dagger-io really removed from pyproject.toml? How did that happen?
yes now it's working, yes it was removed, tbh I don't know as never touch this file, I was only working the src folder and doing some refacto/cleaning of my module
Do you have uv.lock?
yes
How's your pyproject.toml now?
you want to see the content ?
I'm surprised it's working without the dagger-io dependency, so yeah, I'm trying to figure out what you have.
ah no without the dependency it's not working I add it back manually
How did you add it? Did you manually edit pyproject.toml?
but adding the package it was removed and I figured about that comparing 2 modules
yes manually
[project]
name = "main"
version = "0.0.0"
dependencies = [
"dagger-io",
"python-dotenv>=1.0.1",
]
[tool.uv.sources]
dagger-io = { path = "sdk", editable = true }
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
when I did the uv add the block [tool.uv.sources] was not present and the field dependencies with only my third party package
You can see the command in https://docs.dagger.io/api/ide-integration#project-environment:
uv add --editable ./sdk
Do you have a requirements.lock file?
I add one but it was the only mdouel and I remove it
Ok, so your module was created before uv.lock and now you've upgraded is that right? So to add python-dotenv with uv you'd run these:
uv add --editable ./sdk
uv add python-dotenv
The first one is just for migrating over to uv.lock, only needed once.
Is it possible you did uv add python-dotenv before the first migrating dagger-io and that's why it failed?
After that you should remove requirements.lock, yes.
ah yes maybe it was a module I did a poc few weeks ago and I retake it yesterday
yes I did that
i didn't do the the 2 add commands
I only try to add my third party package
I think I can make this better by adding the dagger-io dependency automatically if it's not there.