Skip to content

feat: Disable writing Python bytecode #1152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kwevers
Copy link
Contributor

@kwevers kwevers commented Jan 22, 2025

Purpose

Permission issues can occur on the Python bytecode files as the container entrypoint is being run as the root user. When e.g. using a custom parser the bytecode file will be owned by the root user instead of the user running the action.
This can cause subsequent steps to fail.
For example when running actions/checkout after python-semantic-release it will try to do a git clean -ffdx which will fail to remove the pyc file.

Rationale

This could probably also be avoided by running the entrypoint as a non privileged user, but this would require using sudo or alternative solutions for running e.g. the git config --system command.
In general the usage of the root user isn't really a problem for this action so this seems to be the most straightforward way to workaound the permission issues.

How did you test?

How to Verify

See linked actions in testing section.

Permission issues can occur on the Python bytecode files as the
container entrypoint is being run as the root user.
When e.g. using a custom parser the bytecode file will be owned by the
root user instead of the user running the action.
This can cause subsequent steps to fail.
For example when running actions/checkout after python-semantic-release
it will try to do a `git clean -ffdx` which will fail to remove the pyc
file.
@codejedi365
Copy link
Contributor

Great work, thank you for the fix!

@codejedi365 codejedi365 merged commit 315ae21 into python-semantic-release:master Jan 24, 2025
6 of 7 checks passed
@codejedi365
Copy link
Contributor

🎉 This PR has been published as part of Version 9.17.0 🎉

You can find more information about this release on the GitHub Releases page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants