I was able to get the locked versions into the built wheel using the poetry-lock-package
plugin. This plugin packages only the dependencies from poetry.lock
, producing a separate wheel.
Here’s what I have added to my Azure pipeline to generate both the regular and locked wheels:
- script: |
cd ${{ parameters.wheel_folder }}
poetry build
ls -l dist/
displayName: "Build Poetry Wheel"
- script: |
cd ${{ parameters.wheel_folder }}
poetry-lock-package --wheel
cp ./tsff-lock/dist/*.whl dist/
# Verify contents
ls -l dist/
displayName: "Build Lock Package from poetry.lock and copy to dist/"
This will generate:
A standard Poetry wheel (based on version constraints from pyproject.toml
)
A lock wheel containing all dependencies pinned to exact versions as resolved in poetry.lock