Editable dependencies link/unlink - correct methodology to work #2068
liran-cohen-hs
started this conversation in
General
Replies: 1 comment 4 replies
-
It's doable with PDM. pyproject.toml of project A: [project]
# other fields
dependencies = [
"P" # from pypi
]
[tool.pdm.dev-dependencies]
dev = [
"-e file:///${PROJECT_ROOT}/../P" # editable P from P directory next to project A
] And you create two lockfiles: pdm lock --prod
pdm lock --dev --lockfile pdm.dev.lock The default Documentation: https://pdm.fming.dev/latest/usage/dependency/#specify-the-lockfile-to-use |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Details:
I will start by describing the scenario we are trying to solve
We are working extensively on Python with multiple projects across the company and numerous internal libraries
when a developer wants to work on a service (let's call it A) let's say he clones it from github and runs
pdm sync
, now I expect the service dependencies to be installed as they are in production - specifically internal libraries should be retrieved with the relevant github tagUp until here, everything is covered and works as expected
The problem:
The problem starts when the same developer wants to change something in an internal library, let's say service A is dependent on library P, now I want to keep short loops, the developer has P cloned on his working station and once he changes it I want it to affect service A (locally) immediately - or in simple words - I want it to be an editable dependency
The thing is - I couldn't get a way to make it work with any configuration, I tried multiple lock files but it doesn't fully answer it or add a lot of overhead
Wanted behavior:
If I try to imagine the dream scenario I would say that in
pyproject.toml
I should have dependency P, described maybe in 2 locations - one is github/pypi repository and the other one is a local relative path and by a simple command, transition from one to anotherI looked in other tools for the same functionality and I guess that yarn link does something similar
Beta Was this translation helpful? Give feedback.
All reactions