Skip to content

Commit 8e3d258

Browse files
authored
refactor: modernize packaging (flashinfer-ai#643)
According to [Python Packaging User Guide](https://packaging.python.org/en/latest/discussions/setup-py-deprecated/), `python setup.py` and the use of `setup.py` as a command line tool are deprecated. This PR unifies `setup.py` and `aot_setup.py` and moves static fields to `pyproject.toml`.
1 parent 1b998c3 commit 8e3d258

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+739
-1006
lines changed

.github/workflows/release_wheel.yml

+10-12
Original file line numberDiff line numberDiff line change
@@ -43,74 +43,72 @@ jobs:
4343
- name: Build wheel
4444
run: |
4545
chown -R $CI_UID:$CI_GID "$GITHUB_WORKSPACE"
46-
version="$(cat version.txt)"
4746
docker run --rm -t \
4847
-v "$CI_RUNNER_CACHE_DIR":/ci-cache \
4948
-v "$GITHUB_WORKSPACE":/app \
5049
-e FLASHINFER_CI_PYTHON_VERSION=${{ matrix.python }} \
5150
-e FLASHINFER_CI_CUDA_VERSION=${{ matrix.cuda }} \
5251
-e FLASHINFER_CI_TORCH_VERSION=${{ matrix.torch }} \
53-
-e FLASHINFER_BUILD_VERSION=$version \
5452
-e TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST" \
5553
-e MAX_JOBS=128 \
5654
--user $CI_UID:$CI_GID \
5755
pytorch/manylinux-builder:cuda${{ matrix.cuda }} \
5856
bash /app/scripts/run-ci-build-wheel.sh
5957
timeout-minutes: 120
60-
- run: du -h python/dist/*
58+
- run: du -h dist/*
6159

6260
- uses: actions/upload-artifact@v4
6361
with:
6462
name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}-python${{ matrix.python }}
65-
path: python/dist/*
63+
path: dist/*
6664

6765
release:
6866
needs: build
6967
runs-on: [self-hosted]
7068
steps:
7169
- uses: actions/download-artifact@v4
7270
with:
73-
path: python/dist/
71+
path: dist/
7472
merge-multiple: true
7573
pattern: wheel-*
7674

77-
- run: ls -lah python/dist/
75+
- run: ls -lah dist/
7876

7977
- uses: softprops/action-gh-release@v1
8078
with:
8179
tag_name: ${{ inputs.tag_name }}
8280
files: |
83-
python/dist/flashinfer*cp38*.whl
81+
dist/flashinfer*cp38*.whl
8482
8583
- uses: softprops/action-gh-release@v1
8684
with:
8785
tag_name: ${{ inputs.tag_name }}
8886
files: |
89-
python/dist/flashinfer*cp39*.whl
87+
dist/flashinfer*cp39*.whl
9088
9189
- uses: softprops/action-gh-release@v1
9290
with:
9391
tag_name: ${{ inputs.tag_name }}
9492
files: |
95-
python/dist/flashinfer*cp310*.whl
93+
dist/flashinfer*cp310*.whl
9694
9795
- uses: softprops/action-gh-release@v1
9896
with:
9997
tag_name: ${{ inputs.tag_name }}
10098
files: |
101-
python/dist/flashinfer*cp311*.whl
99+
dist/flashinfer*cp311*.whl
102100
103101
- uses: softprops/action-gh-release@v1
104102
with:
105103
tag_name: ${{ inputs.tag_name }}
106104
files: |
107-
python/dist/flashinfer*cp312*.whl
105+
dist/flashinfer*cp312*.whl
108106
109107
- uses: softprops/action-gh-release@v1
110108
with:
111109
tag_name: ${{ inputs.tag_name }}
112110
files: |
113-
python/dist/flashinfer-*.tar.gz
111+
dist/flashinfer-*.tar.gz
114112
115113
- name: Clone wheel index
116114
run: git clone https://oauth2:${WHL_TOKEN}@github.com/flashinfer-ai/whl.git flashinfer-whl

.gitignore

+7-17
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
11
# ci
22
flashinfer-whl/
3-
python/dist
3+
dist/
44

55
# Compile commands json file
66
compile_commands.json
77

8-
# Generated inst files
9-
src/dispatch.inc
10-
11-
# Generated cu files
8+
# Generated files
9+
csrc/generated/
10+
docs/generated/
11+
flashinfer/_build_meta.py
12+
flashinfer/data/
13+
flashinfer/jit/aot_config.py
1214
src/generated/
13-
python/csrc/generated/
14-
python/flashinfer/_build_meta.py
15-
python/flashinfer/jit/aot_config.py
16-
python/csrc-aot/generated/
17-
18-
# Package files
19-
python/flashinfer/data/
20-
python/flashinfer/version.txt
21-
python/MANIFEST.in
22-
23-
# Generated documentation files
24-
docs/generated
2515

2616
# DS_Store files
2717
.DS_store

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ repos:
5252
- id: clang-format
5353
types_or: [c++, c, cuda]
5454
exclude: |
55-
(?x)^(3rdparty/.* src/generated/.* python/flashinfer/jit/aot_config.py)$
55+
(?x)^(3rdparty/.* src/generated/.* flashinfer/jit/aot_config.py)$
5656
5757
- repo: https://github.com/cheshirekow/cmake-format-precommit
5858
rev: v0.6.13

0 commit comments

Comments
 (0)