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

Use relative paths in pyproject.toml for path dependencies #6684

Closed
harrymconner opened this issue Aug 27, 2024 · 2 comments · Fixed by #6686
Closed

Use relative paths in pyproject.toml for path dependencies #6684

harrymconner opened this issue Aug 27, 2024 · 2 comments · Fixed by #6686
Labels
bug Something isn't working cli Related to the command line interface

Comments

@harrymconner
Copy link

My company organizes its python code in a monorepo, and the recent addition of relative paths in lockfiles (#6490) convinced me to switch to uv! I was wondering if it would also be possible to use relative paths in the pyproject.toml file when uv add-ing path dependencies? Here is the repo structure for reference:

root
├-libs
│  ├-liba
│  └-libb
└-projects
   └-projecta

I want to add libb as a dependency to projecta, so I run the following command: uv add ..\..\libs\libb --editable from projecta. This gives me the following [tool.uv.sources] section in projecta's pyproject.toml:

[tool.uv.sources]
libb = { path = 'C:\full\path\to\the\library\libb', editable = true }

Since all of my team members have the monorepo checked out to different locations on their machine, I would like to have the dependency added as a relative path for consistency:

[tool.uv.sources]
libb = { path = '..\..\libs\libb', editable = true }

Please let me know if you have any questions on this use case!

Relevant info:

  • Platform: Windows 11
  • version: uv 0.3.4 (39f3cd2 2024-08-26)
@charliermarsh
Copy link
Member

I think this makes sense.

@charliermarsh charliermarsh added bug Something isn't working cli Related to the command line interface labels Aug 27, 2024
@charliermarsh
Copy link
Member

(I'm gonna call it a bug since it probably should've always behaved this way.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Related to the command line interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants