[Background]:
Amazon AWS Greengrass doesn't support to install third party tools to manage python virtual env, but it's good to manage local development environment using uv.
So when I try to deploy multiple components to Greengrass devices, I need to convert dependencies list to a requirements.txt.
I was struggling to manage multiple greengrass components in one workspace.
Suggest we had two package members (bird-feeder and seeds) in one project, and the structure is like this:
Suggest there is no additional dependencies in bird-feeder, so in the pyproject.toml under bird-feeder folder, we will not write dependencies section and assume that it would reuse the dependencies from workspace.
Then when I was using the second solution, I try to build a requirements.txt under bird-feeder using command uv pip compile pyproject.toml -o requirements.txt, but it seemed not creating any packages dependencies in the generated requirements.txt.
(It didn't try to get the dependencies list from parent pyproject.toml).
[Background]: Amazon AWS Greengrass doesn't support to install third party tools to manage python virtual env, but it's good to manage local development environment using uv. So when I try to deploy multiple components to Greengrass devices, I need to convert dependencies list to a
requirements.txt
.I was struggling to manage multiple greengrass components in one workspace.
Suggest we had two package members (
bird-feeder
andseeds
) in one project, and the structure is like this:According to the docs, there were two ways to manage multiple package members in one project:
[tool.uv.sources] bird-feeder = { workspace = true } seeds = { workspace = true } tqdm = { git = "https://github.com/tqdm/tqdm" }
[tool.uv.workspace] members = ["packages/*"]
[build-system] requires = ["hatchling"] build-backend = "hatchling.build"
Suggest there is no additional dependencies in
bird-feeder
, so in the pyproject.toml underbird-feeder
folder, we will not write dependencies section and assume that it would reuse the dependencies from workspace.Then when I was using the second solution, I try to build a requirements.txt under
bird-feeder
using commanduv pip compile pyproject.toml -o requirements.txt
, but it seemed not creating any packages dependencies in the generated requirements.txt. (It didn't try to get the dependencies list from parentpyproject.toml
).What's the best practice for my usage?