python-semantic-release icon indicating copy to clipboard operation
python-semantic-release copied to clipboard

Build_command not found in path

Open alandtse opened this issue 5 years ago • 14 comments

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: 

alandtse avatar Apr 26 '20 20:04 alandtse

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.

alandtse avatar Apr 26 '20 20:04 alandtse

Changing the build_command to $HOME/.poetry/bin/poetry may be the workaround per https://github.com/python-poetry/poetry/issues/525

alandtse avatar May 02 '20 07:05 alandtse

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.

github-actions[bot] avatar May 24 '20 00:05 github-actions[bot]

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:

Hope this helps!

browniebroke avatar Oct 15 '20 13:10 browniebroke

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.

github-actions[bot] avatar Nov 07 '20 00:11 github-actions[bot]

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.

github-actions[bot] avatar Nov 15 '22 01:11 github-actions[bot]

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.

schlich avatar Jul 23 '23 09:07 schlich