-
Notifications
You must be signed in to change notification settings - Fork 44
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
chore(release): update pypi packaging #604
base: main
Are you sure you want to change the base?
Conversation
5dc03cc
to
1bf1eb9
Compare
❌ 5 Tests Failed:
View the top 3 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
✅ All tests successful. No failed tests were found. 📣 Thoughts on this report? Let Codecov know! | Powered by Codecov |
056aa60
to
c21c77b
Compare
@webknjaz if you have some time, would love another look at this PR |
@webknjaz, I'd like to send you some swag from Codecov/Sentry for all the help on this PR (and all the issues you've created over the years), you can email me at [email protected]. |
@@ -18,7 +18,7 @@ jobs: | |||
- id: get-release-vars | |||
name: Configure Release Vars | |||
run: | | |||
echo release_version=v$(grep -E "version=\"[0-9]+\.[0-9]+\.[0-9]+\"" setup.py | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") >> "$GITHUB_OUTPUT" | |||
echo release_version=v$(grep -E "version=\"[0-9]+\.[0-9]+\.[0-9]+\"" pyproject.toml | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") >> "$GITHUB_OUTPUT" | |||
echo previous_version=$(git tag --sort=-creatordate | head -n 2 | tail -n 1) >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the Python version in this job is 3.11+, you can just use the stdlib module for reading TOML:
echo previous_version=$(git tag --sort=-creatordate | head -n 2 | tail -n 1) >> "$GITHUB_OUTPUT" | |
echo previous_version=$(git tag --sort=-creatordate | head -n 2 | tail -n 1) >> "$GITHUB_OUTPUT" | |
- name: Extract hardcoded dist version from PEP 621 config | |
id: dist-meta | |
run: | | |
from os import environ | |
from pathlib import Path | |
from tomllib import loads as convert_toml_text_to_dict | |
FILE_APPEND_MODE = 'a' | |
pyproject_toml_txt = Path("pyproject.toml").read_text(encoding="utf-8") | |
pyproject_toml = convert_toml_text_to_dict(pyproject_toml_txt) | |
version_string = pyproject_toml["project"]["version"] | |
with Path(environ['GITHUB_OUTPUT']).open( | |
mode=FILE_APPEND_MODE, | |
) as outputs_file: | |
print(f'release-version={version_string !s}', file=outputs_file) | |
shell: python |
(if not — call actions/setup-python
earlier to ensure it's modern enough)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(note that I'm setting release-version
over release_version
, and a new step ID here because it's usually helpful to have kebab-case identifiers in GHA, making it easier to distinguish them from identifiers from other embedded scripts)
@@ -1,2 +1,3 @@ | |||
include languages/treesitterjavascript/src/tree_sitter/parser.h | |||
include languages/treesitterpython/src/tree_sitter/parser.h | |||
include requirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for the future: include the entire repo. Well, except GHA automation and some helper scripts that aren't needed for running tests/building docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahhh, is that the preferred way of doing this?
@thomasrockhu-codecov short of the broken regex, the rest should be ready even without implementing improvement suggestions in other comments — they can be declared out of the scope and filed as separate issues, I suppose. |
Thanks! I've emailed you. |
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
build_assets
andbuild_for_pypi
into separate workflows that runon
pyproject.toml
because its what should be used oversetup.py
build_for_pypi
workflowfixes #466