Skip to content

Commit a7b48c8

Browse files
committed
Revert "Fix building source distributions (#6381)"
This reverts commit a782a36. Signed-off-by: Anatoly Myachev <[email protected]>
1 parent e244747 commit a7b48c8

File tree

12 files changed

+215
-207
lines changed

12 files changed

+215
-207
lines changed

.github/workflows/create_release.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,30 @@ jobs:
4343
tag_or_branch="${tag_or_branch#refs/heads/}"
4444
# replace directory separators with _ in branch name
4545
tag_or_branch="${tag_or_branch//\//_}"
46-
if [[ ${tag_or_branch} == v* ]]; then
47-
# strip trailing v from tag name
48-
tag_or_branch="${tag_or_branch#v}"
49-
# important: version must be fixed in setup.py
50-
sed -i -e "s:^TRITON_VERSION = .*:TRITON_VERSION = '${tag_or_branch}':" setup.py || exit 1
51-
fi
5246
echo "RELEASE_NAME=triton-$tag_or_branch" >> "$GITHUB_ENV"
47+
echo "RELEASE_FILE=triton-$tag_or_branch.tar.gz" >> "$GITHUB_ENV"
5348
- name: Create source distribution
5449
run: |
55-
pip install build || exit 1
56-
python -m build -s || exit 1
57-
cd dist || exit 1
58-
release_file=( *.tar.gz )
59-
echo "RELEASE_FILE=${release_file}" >> "$GITHUB_ENV"
50+
# Create new folder with specified name so extracting the archive yields that
51+
rm -rf "/tmp/$RELEASE_NAME"
52+
cp -r "$PWD" "/tmp/$RELEASE_NAME"
53+
mv "/tmp/$RELEASE_NAME" .
54+
# Cleanup
55+
find "$RELEASE_NAME" -name '.git*' -exec rm -rv {} \; || true
56+
# Create archive
57+
tar -czf "$RELEASE_FILE" "$RELEASE_NAME"
58+
echo "Created source archive $RELEASE_FILE with content: $(ls -a "$RELEASE_NAME")"
6059
- name: Upload source distribution for release
6160
if: ${{ github.event_name == 'release' }}
6261
uses: softprops/action-gh-release@v2
6362
with:
64-
files: dist/${{env.RELEASE_FILE}}
63+
files: ${{env.RELEASE_FILE}}
6564
- name: Upload source distribution to GHA artifacts for release tags
6665
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'rc') }}
6766
uses: actions/[email protected]
6867
with:
6968
name: ${{ env.RELEASE_FILE }}
70-
path: dist/${{ env.RELEASE_FILE }}
69+
path: ${{ env.RELEASE_FILE }}
7170
- name: Set output
7271
id: release_name
7372
run: echo "name=release_name::${{ env.RELEASE_NAME }}.tar.gz" >> "${GITHUB_OUTPUT}"

.github/workflows/wheels.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,7 @@ jobs:
7979
export CIBW_BUILD="cp3{9,10,11,12,13,13t}-manylinux_${{ matrix.config.arch }}"
8080
export CIBW_SKIP="cp{35,36,37,38}-*"
8181
export CIBW_FREE_THREADED_SUPPORT=1
82-
python3 -m cibuildwheel . --output-dir wheelhouse
83-
84-
- uses: actions/upload-artifact@v4
85-
with:
86-
name: cibw-wheels-manylinux_2_28_${{ matrix.config.arch }}-wheels-upload
87-
path: ./wheelhouse/*.whl
82+
python3 -m cibuildwheel python --output-dir wheelhouse
8883
8984
- name: Install Azure CLI
9085
if: ${{ steps.check-version.outputs.new_commit == 'true' }}

MANIFEST.in

Lines changed: 0 additions & 18 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ dev-install-torch:
7979

8080
.PHONY: dev-install-triton
8181
dev-install-triton:
82-
$(PYTHON) -m pip install -e . --no-build-isolation -v
82+
$(PYTHON) -m pip install -e python --no-build-isolation -v
8383

8484
.PHONY: dev-install
8585
.NOPARALLEL: dev-install

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ git clone https://github.com/triton-lang/triton.git
7171
cd triton
7272

7373
pip install -r python/requirements.txt # build-time dependencies
74-
pip install -e .
74+
pip install -e python
7575
```
7676

7777
Or with a virtualenv:
@@ -84,7 +84,7 @@ python -m venv .venv --prompt triton
8484
source .venv/bin/activate
8585

8686
pip install -r python/requirements.txt # build-time dependencies
87-
pip install -e .
87+
pip install -e python
8888
```
8989

9090
# Building with a custom LLVM
@@ -124,7 +124,7 @@ arbitrary LLVM version.
124124
$ LLVM_INCLUDE_DIRS=$LLVM_BUILD_DIR/include \
125125
LLVM_LIBRARY_DIR=$LLVM_BUILD_DIR/lib \
126126
LLVM_SYSPATH=$LLVM_BUILD_DIR \
127-
pip install -e .
127+
pip install -e python
128128

129129
# Tips for building
130130

@@ -139,7 +139,7 @@ arbitrary LLVM version.
139139
can be changed anytime.
140140

141141
- If you're running out of memory when building Triton, specify the `MAX_JOBS`
142-
environment variable (to the `pip install -e .` command) to limit the
142+
environment variable (to the `pip install -e python` command) to limit the
143143
number of jobs.
144144

145145
- Pass `--no-build-isolation` to `pip install` to make nop builds faster.
@@ -150,7 +150,7 @@ arbitrary LLVM version.
150150
(probably because, in our build, users don't invoke cmake directly, but
151151
instead use setup.py). Teach vscode how to compile Triton as follows.
152152

153-
- Do a local build. Run command `pip install -e .`
153+
- Do a local build. Run command `pip install -e python`
154154
- Get the full path to the `compile_commands.json` file produced by the build:
155155
`find python/build -name 'compile_commands.json' | xargs readlink -f`.
156156
You might get a full path similar to `/Users/{username}/triton/python/build/cmake.macosx-11.1-arm64-cpython-3.12/compile_commands.json`

pyproject.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=78.1.0", "cmake>=3.18", "ninja>=1.11.1", "pybind11>=2.13.1"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["setuptools>=78.1.0", "wheel", "cmake>=3.18", "ninja>=1.11.1"]
43

54
[tool.yapf]
65
based_on_style = "pep8"
@@ -10,12 +9,6 @@ each_dict_entry_on_separate_line=false
109
split_before_named_assigns = false
1110
split_complex_comprehension = true
1211

13-
# We're incrementally switching from autopep8 to ruff.
14-
[tool.autopep8]
15-
aggressive = 1
16-
ignore = "E501,E701,E731,W690,W503"
17-
max_line_length = 88
18-
1912
[tool.ruff]
2013
line-length = 120
2114

File renamed without changes.

python/build_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ def get_cmake_dir():
1212
plat_name = sysconfig.get_platform()
1313
python_version = sysconfig.get_python_version()
1414
dir_name = f"cmake.{plat_name}-{sys.implementation.name}-{python_version}"
15-
cmake_dir = Path(get_base_dir()) / "build" / dir_name
15+
cmake_dir = Path(get_base_dir()) / "python" / "build" / dir_name
1616
cmake_dir.mkdir(parents=True, exist_ok=True)
1717
return cmake_dir

0 commit comments

Comments
 (0)