Skip to content

Commit

Permalink
fix(build): fix build versioning
Browse files Browse the repository at this point in the history
This commit fixes an issue with `poetry build` not substituting the dynamic version number. It fixes the issue by adding the optional plugin dependency.

fix #367
  • Loading branch information
kenibrewer committed Jan 27, 2024
1 parent 272b2be commit f2946d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"features": {
"ghcr.io/devcontainers-contrib/features/poetry:2": {}
},
// Use 'postCreateCommand' to run commands after the container is created.
// This command is kept outside of the postCreateCommand script because we
// don't want to include a privileged command in the manual setup process.
"onCreateCommand": "sudo /usr/local/py-utils/bin/poetry self add \"poetry-dynamic-versioning[plugin]\"",
// This postCreateCommand script is also referenced for manual dev setup.
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh",
// Configure tool-specific properties.
"customizations": {
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#! /usr/bin/env bash
python -m pip install poetry-dynamic-versioning
# PDV will already have been installed in a devcontainer, but is
# re-included here for the benefit of manual dev environments.
poetry self add "poetry-dynamic-versioning[plugin]"
poetry config virtualenvs.in-project true --local
poetry install --with dev --all-extras
poetry run pre-commit install --install-hooks
3 changes: 2 additions & 1 deletion .github/actions/setup-env/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ runs:
shell: bash
if: ${{ inputs.setup-poetry == 'true' }}
run: |
python -m pip install poetry poetry-dynamic-versioning
python -m pip install poetry
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Install dependencies with poetry
shell: bash
if: ${{ inputs.install-deps == 'true' }}
Expand Down

0 comments on commit f2946d6

Please sign in to comment.