-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fix building source distributions #6381
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
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
9e31f6b
Move Python build system to root directory
mgorny af98b69
Delay downloading dependencies until CMake build command
mgorny 8efcbf1
Add missing files to source distribution
mgorny f33ee49
Remove `triton/_C/include` symlink
mgorny 93146d2
Future-proof against wheel removing bdist_wheel command
mgorny 349e890
Update path in wheels workflow
mgorny 4f24e68
Remove `third_party/proton/proton/_C/include` symlink too
mgorny 1322da6
Update release workflow to build proper sdist
mgorny 0ca799d
Force fixed version into sdist
mgorny 1943ccf
Update install instructions and Makefile for changed paths
mgorny ee7b993
Include docs in sdist as well
mgorny 27e7a15
Temporarily enable artifact upload
mgorny 6cad0d8
Remove explicit dependency on wheel
mgorny ce81f97
Use setuptools.find_packages()
mgorny c267d86
Remove unnecessary mkdir
mgorny 0c677ab
Remove unnecessary explicit package data logic
mgorny 9a688e2
Defer copying backends until build
mgorny 6ff18a7
Include more test-related files in sdist
mgorny 3a576d0
Revert "Defer copying backends until build"
mgorny f6a99a9
Install subpackages from third-party without symlinks
mgorny a9e85f7
Remove unused imports
mgorny 28455b1
Revert "Temporarily enable artifact upload"
mgorny 76d368d
add artifact upload
mgorny 8afcacd
Add __init__.py to amd backend to fix editable installs
mgorny 1893dc6
Use entry points to locate backends
mgorny b249ecc
Return to using symlinks for editable installs
mgorny cd61e2d
Use modern setuptools backend
mgorny 93b876f
Add a fallback for ancient setuptools
mgorny 74a93c5
Merge branch 'main' into python-sdist
atalman 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 |
|---|---|---|
|
|
@@ -43,30 +43,31 @@ jobs: | |
| tag_or_branch="${tag_or_branch#refs/heads/}" | ||
| # replace directory separators with _ in branch name | ||
| tag_or_branch="${tag_or_branch//\//_}" | ||
| if [[ ${tag_or_branch} == v* ]]; then | ||
| # strip trailing v from tag name | ||
| tag_or_branch="${tag_or_branch#v}" | ||
| # important: version must be fixed in setup.py | ||
| sed -i -e "s:^TRITON_VERSION = .*:TRITON_VERSION = '${tag_or_branch}':" setup.py || exit 1 | ||
| fi | ||
| echo "RELEASE_NAME=triton-$tag_or_branch" >> "$GITHUB_ENV" | ||
| echo "RELEASE_FILE=triton-$tag_or_branch.tar.gz" >> "$GITHUB_ENV" | ||
| - name: Create source distribution | ||
| run: | | ||
| # Create new folder with specified name so extracting the archive yields that | ||
| rm -rf "/tmp/$RELEASE_NAME" | ||
| cp -r "$PWD" "/tmp/$RELEASE_NAME" | ||
| mv "/tmp/$RELEASE_NAME" . | ||
| # Cleanup | ||
| find "$RELEASE_NAME" -name '.git*' -exec rm -rv {} \; || true | ||
| # Create archive | ||
| tar -czf "$RELEASE_FILE" "$RELEASE_NAME" | ||
| echo "Created source archive $RELEASE_FILE with content: $(ls -a "$RELEASE_NAME")" | ||
| pip install build || exit 1 | ||
| python -m build -s || exit 1 | ||
| cd dist || exit 1 | ||
| release_file=( *.tar.gz ) | ||
| echo "RELEASE_FILE=${release_file}" >> "$GITHUB_ENV" | ||
| - name: Upload source distribution for release | ||
| if: ${{ github.event_name == 'release' }} | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: ${{env.RELEASE_FILE}} | ||
| files: dist/${{env.RELEASE_FILE}} | ||
| - name: Upload source distribution to GHA artifacts for release tags | ||
| if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'rc') }} | ||
| uses: actions/[email protected] | ||
| with: | ||
| name: ${{ env.RELEASE_FILE }} | ||
| path: ${{ env.RELEASE_FILE }} | ||
| path: dist/${{ env.RELEASE_FILE }} | ||
| - name: Set output | ||
| id: release_name | ||
| run: echo "name=release_name::${{ env.RELEASE_NAME }}.tar.gz" >> "${GITHUB_OUTPUT}" | ||
|
|
||
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
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 |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| graft bin | ||
| graft cmake | ||
| graft docs | ||
| graft include | ||
| graft lib | ||
| graft python/src | ||
| graft python/test | ||
| graft python/triton/backends/amd | ||
| graft python/triton/backends/nvidia | ||
| graft python/triton/tools/extra/cuda | ||
| graft test | ||
| graft third_party | ||
| graft unittest | ||
| include CMakeLists.txt | ||
| include Makefile | ||
| include python/build_helpers.py | ||
| include python/requirements.txt | ||
| include python/test-requirements.txt |
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
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
HI @mgorny
Please add this action before trying to use Azure (since its failing):
It will allow us to get the wheels from the workflow on this PR.
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.
Done.