cloud-custodian / poetry-plugin-freeze

poetry plugin to freeze dependency versions in wheels
22 stars 4 forks source link

keep path dependency as such, refering to it via file:// #22

Closed DBS-ST-VIT closed 1 month ago

DBS-ST-VIT commented 1 month ago

What problem is solved

When using local "path" dependencies in a python mono-repo, poetry-plugin-freeze removes the reference to the path and insert the package the same way, as any other package available on pip.

When then trying to use the wheel file, it cannot be installed because the path dependency cannot be found (its not available on pip, and the local path reference is lost).

What is the solution in this PR

This PR changes the behavior, so that for path-dependencies no version restriction is inserted (there is only one version available) and the reference to the local package (via file://) is preserved.

Status

ajkerrigan commented 1 month ago

Hey thanks for the contribution! It's true - the idea of freezing dependencies doesn't mesh very well with the sort of path-based dependency you're talking about. I wouldn't want to avoid freezing path-based dependencies by default (cloud custodian depends on that behavior), but you can use the --exclude / -e option to explicitly avoid freezing certain packages by name:

# avoid freezing specific packages
poetry freeze-wheel --exclude boto3 -e attrs
DBS-ST-VIT commented 1 month ago

We absolutely understand your use case and will use -e instead of our code changes.