-
-
Notifications
You must be signed in to change notification settings - Fork 816
Update python-package.yml #1640
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -171,42 +171,67 @@ jobs: | |||||||||||||||||||||
| path: tmp/ | ||||||||||||||||||||||
| pattern: "bdist_wheel_*" | ||||||||||||||||||||||
| merge-multiple: true | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Inspect tmp directory after downloading artifacts | ||||||||||||||||||||||
| run: ls -alFR tmp/ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Move and rename wheel files with pattern replacement | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| mkdir -p wheels/ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # The whole point of the continuous release is to have a stable download link and the only way to have a PEP 440–compliant wheel name | ||||||||||||||||||||||
| # is to use a stable placeholder version. Otherwise, pip won't let you install the wheel. The cool thing is that we can now install the | ||||||||||||||||||||||
| # wheel directly from the GH pre-release which gets updated continuously, e.g. | ||||||||||||||||||||||
| # `pip install https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_main/bitsandbytes-1.33.7.preview-py3-none-manylinux_2_24_x86_64.whl` | ||||||||||||||||||||||
| STABLE_PLACEHOLDER_VERSION="1.33.7.preview" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # exclude macos wheels for now | ||||||||||||||||||||||
| find tmp/ -type f -name '*.whl' ! -name '*macos*' -print0 | while IFS= read -r -d '' wheel; do | ||||||||||||||||||||||
| wheel_filename=$(basename "$wheel") | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Strip off the original version | ||||||||||||||||||||||
| rest=${wheel_filename#bitsandbytes-*-} | ||||||||||||||||||||||
| new_name="bitsandbytes-${STABLE_PLACEHOLDER_VERSION}-${rest}" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| echo "Renaming $wheel_filename → $new_name" | ||||||||||||||||||||||
| mv "$wheel" "wheels/${new_name}" | ||||||||||||||||||||||
| done | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Inspect wheels directory after renaming files | ||||||||||||||||||||||
| run: ls -alFR wheels/ | ||||||||||||||||||||||
| - name: Create release and upload artifacts | ||||||||||||||||||||||
| uses: softprops/action-gh-release@v2.2.1 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Delete old pre-release (if exists) | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| gh release delete continuous-release_main --cleanup-tag -y || true | ||||||||||||||||||||||
| env: | ||||||||||||||||||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Generate pip install commands for release body | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| cat <<'EOF' > body.md | ||||||||||||||||||||||
| ## Latest `main` Wheel Pre-release | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| This pre-release contains the latest development wheels for all supported platforms, rebuilt automatically on every commit to the `main` branch. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **How to install:** | ||||||||||||||||||||||
| Pick the correct command for your platform and run it in your terminal: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| EOF | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| for whl in wheels/*.whl; do | ||||||||||||||||||||||
| fname=$(basename "$whl") | ||||||||||||||||||||||
| url="https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_main/$fname" | ||||||||||||||||||||||
| echo "\`\`\`sh" >> body.md | ||||||||||||||||||||||
| echo "pip install $url" >> body.md | ||||||||||||||||||||||
| echo "\`\`\`" >> body.md | ||||||||||||||||||||||
| echo "" >> body.md | ||||||||||||||||||||||
|
Comment on lines
+214
to
+217
|
||||||||||||||||||||||
| echo "\`\`\`sh" >> body.md | |
| echo "pip install $url" >> body.md | |
| echo "\`\`\`" >> body.md | |
| echo "" >> body.md | |
| cat <<EOF >> body.md | |
| \`\`\`sh | |
| pip install $url | |
| \`\`\` | |
| EOF |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
[nitpick] A brief inline comment explaining the use of '|| true' could help clarify that failing to delete a non-existent release is expected behavior.