fix pypi publishing#295
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request attempts to fix PyPI publishing by dynamically updating the version number in the Python setup file before building the distribution package. The change extracts the current version from setup.py and uses sed to replace it with the calculated PACKAGE_VERSION environment variable that is determined earlier in the workflow.
Changes:
- Added version extraction and replacement logic in the "Build t-encrypt Python distributions" step to dynamically update the package version before building
| python -m pip install --upgrade pip | ||
| python -m pip install --upgrade setuptools wheel twine | ||
| CURRENT_VERSION="$(python setup.py --version)" | ||
| sed -i "s/${CURRENT_VERSION}/${PACKAGE_VERSION}/g" setup.py |
There was a problem hiding this comment.
The variable substitution in the sed command lacks proper quoting, which could cause failures if the version strings contain special characters (like dots, which are regex metacharacters). Consider using a delimiter that's less likely to appear in version strings, or escape the version string properly. For example, use sed -i "s|${CURRENT_VERSION}|${PACKAGE_VERSION}|g" with pipe delimiters, or properly escape the variables.
| sed -i "s/${CURRENT_VERSION}/${PACKAGE_VERSION}/g" setup.py | |
| sed -i "s|${CURRENT_VERSION}|${PACKAGE_VERSION}|g" setup.py |
No description provided.