Skip to content

Fix #838: replace use of exec with runpy in setup.py#840

Merged
mhucka merged 4 commits intomasterfrom
mh-fix-838-exec
Aug 15, 2025
Merged

Fix #838: replace use of exec with runpy in setup.py#840
mhucka merged 4 commits intomasterfrom
mh-fix-838-exec

Conversation

@mhucka
Copy link
Copy Markdown
Collaborator

@mhucka mhucka commented Jul 30, 2025

setup.py uses exec to read the version number from the version file. It's generally considered best practice to avoid exec because of risks it carries. In this particular case, we can borrow the technique used in Cirq's setup.py, and use the Python runpy package.

`setup.py` uses `exec` to read the version number from the version file. It's generally considered best practice to avoid `exec` because of risks it carries. In this particular case, we can borrow the technique used in Cirq's `setup.py`, and use the Python `runpy` package.
@github-actions github-actions Bot added the size: XS <10 lines changed label Jul 30, 2025
@mhucka mhucka self-assigned this Aug 1, 2025
@mhucka mhucka changed the title Replace use of exec with runpy Fix #838: replace use of exec with runpy in setup.py Aug 10, 2025
@mhucka mhucka marked this pull request as ready for review August 14, 2025 02:55
@mhucka mhucka enabled auto-merge (squash) August 15, 2025 19:40
@mhucka mhucka merged commit 886ab82 into master Aug 15, 2025
49 checks passed
@mhucka mhucka deleted the mh-fix-838-exec branch August 15, 2025 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XS <10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants