Build_command not found in path
The problem
The build_command not found in path for GitHub Actions
Expected behavior
The build_command command runs successfully.
Additional context
[semantic_release]
version_variable=pyproject.toml:version
upload_to_pypi=true
check_build_status=false
remove_dist=false
hvcs=gitlab
build_command="poetry publish --build"
$ pip install poetry
<snip>
$ poetry config virtualenvs.create false
$ poetry install
<snip>
$ pip install python-semantic-release
<snip>
$ semantic-release publish
Creating new version
Current version: 1.6.1
Bumping with a minor version to 1.7.0
Pushing new version
Building distributions
Running "poetry publish --build"
/bin/bash: poetry publish --build: command not found
error: Encountered a bad command exit code!
error:
error: Command: '"poetry publish --build"'
error:
error: Exit code: 127
error:
error: Stdout: already printed
error:
error: Stderr: already printed
error:
I'm not too familiar with the run command from invoke and whether there are any gotchas to get the right path so I'm hoping someone else knows the right way to fix it.
Changing the build_command to $HOME/.poetry/bin/poetry may be the workaround per https://github.com/python-poetry/poetry/issues/525
This bug report has been labelled as help wanted since there has been no activity in the last 3 weeks. It will not be closed.
I recently migrated a project which was using PSR on Github actions to Poetry and here is the config I'm using:
[tool.semantic_release]
version_variable = [
"deezer/__init__.py:__version__",
"pyproject.toml:version"
]
build_command = "pip install poetry && poetry build"
This works because a couple of things work nicely together:
- The
version_variablecan be specified in multiple places, once inpyproject.tomland once in the module__init__.py - The version replacement works in TOML file because the format is the same as it would be in Python:
version = "1.2.3" - Multiple commands are passed to the
build_commandwith&&. The documentation usesflitas an example, but it works the same for Poetry. - Poetry builds the source and binary distributions in a standard location
dist/by default, which is perfectly compatible with what PSR uses to publish (Twine)
Hope this helps!
This bug report has been labelled as help wanted since there has been no activity in the last 3 weeks. It will not be closed.
This bug report has been labelled as help wanted since there has been no activity in the last 3 weeks. It will not be closed.
Been running into this issue with the GitHub Action in CI. the "pip install poetry && poetry build" seems ok as a workaround, but this configuration will unnecessarily re-install Poetry if running semantic-release locally. there is no way to my knowledge to give third-party actions access to your job's runner, so in the meantime i've resorted to just manually calling semantic-release on the GitHub runner created by the workflow/job:
- name: Semantic Release
run: |
poetry run semantic-release version
poetry run semantic-release publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
I figure that configuring the action to use Poetry shouldn't be any more difficult than adding an installation command to the Dockefile. I can put together a PR if this is acceptable.