Skip to content

Commit 7d1a3a8

Browse files
committed
Force fixed version into sdist
1 parent 80ed2dc commit 7d1a3a8

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/create_release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ jobs:
4646
if [[ ${tag_or_branch} == v* ]]; then
4747
# strip trailing v from tag name
4848
tag_or_branch="${tag_or_branch#v}"
49-
echo "TRITON_OVERRIDE_VERSION=${tag_or_branch}" >> "$GITHUB_ENV"
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
5051
fi
5152
echo "RELEASE_NAME=triton-$tag_or_branch" >> "$GITHUB_ENV"
5253
- name: Create source distribution

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,10 +748,12 @@ def get_git_version_suffix():
748748
# will cause errors
749749
Path(__file__).parent.joinpath("python", "triton", "_C").mkdir(exist_ok=True)
750750

751+
# keep it separate for easy substitution
752+
TRITON_VERSION = "3.3.0" + get_git_version_suffix() + os.environ.get("TRITON_WHEEL_VERSION_SUFFIX", "")
753+
751754
setup(
752755
name=os.environ.get("TRITON_WHEEL_NAME", "triton"),
753-
version=os.environ.get("TRITON_OVERRIDE_VERSION",
754-
"3.3.0" + get_git_version_suffix() + os.environ.get("TRITON_WHEEL_VERSION_SUFFIX", "")),
756+
version=TRITON_VERSION,
755757
author="Philippe Tillet",
756758
author_email="phil@openai.com",
757759
description="A language and compiler for custom Deep Learning operations",

0 commit comments

Comments
 (0)