breezy-electrician-41537
05/11/2024, 12:18 AMroot
|--projA/
|--projB/
|--pants.toml
Both use poetry and projB depends on projA. What would be the correct way to make this work with pants and poetry? Would projA be a path dependency (in poetry terms via pyproject.toml) that tailor picks up for pants? Or is another approach recommended?better-van-82973
05/11/2024, 12:22 AMprojA
and projB
contain? Python code, or other kinds of dependencies as well? If it’s just Python code then you should be able to use dependency inference or explicit dependencies to import the right code from projA
in projB
breezy-electrician-41537
05/11/2024, 12:30 AM[tool.poetry.dependencies]
python = "~3.11"
projA = "*"
and tailor taking care of setting up the Build files for the dependencies be enough, or is there a different, recommended approach.better-van-82973
05/11/2024, 12:32 AMpyproject.toml
files into one and then building your resolve in Pants using that combined file. Given that there is a dependency between the projects, you will need them to use the same resolve in Pants.
The example you gave relies on projA
as a package - you could build that package using python_distribution
in Pants but you might also just be able to rely on the relevant sources directlybreezy-electrician-41537
05/11/2024, 12:37 AMpython_distribution
could work, but then would it need a package every time projA is changed, or would the changes get picked up automatically? (And in the real scenario, there's also projectC which also happens to depend on projA).better-van-82973
05/11/2024, 12:39 AMbreezy-electrician-41537
05/11/2024, 12:44 AMbetter-van-82973
05/11/2024, 1:04 AMroot
|--pyproject.toml
|--src/py
|----projA/
|----projB/
|----projC/
If all the source files are in the same repo, you might not need the editable dependency - you can just rely on the source files directly and trigger updated test runs based on the files that changedbreezy-electrician-41537
05/11/2024, 1:08 AMbetter-van-82973
05/11/2024, 1:09 AMbreezy-electrician-41537
05/11/2024, 1:15 AMbetter-van-82973
05/11/2024, 1:15 AMbreezy-electrician-41537
05/11/2024, 1:19 AMbetter-van-82973
05/11/2024, 1:36 AMbreezy-electrician-41537
05/11/2024, 9:48 AM