Skip to content

Commit cb28d33

Browse files
authored
[Misc] version control by setuptools_scm (#21) (#28)
cherry-pick from c59375c Signed-off-by: wangxiyuan <[email protected]>
1 parent 7637759 commit cb28d33

File tree

5 files changed

+25
-2
lines changed

5 files changed

+25
-2
lines changed

.github/workflows/yapf.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
- name: Install dependencies
4949
run: |
5050
python -m pip install --upgrade pip
51+
pip install toml
5152
pip install yapf==0.32.0
5253
- name: Running yapf
5354
run: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,6 @@ cython_debug/
193193
.pypirc
194194

195195
kernel_meta/
196+
197+
# version file generated by setuptools-scm
198+
/vllm_ascend/_version.py

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[build-system]
2+
# Should be mirrored in requirements.txt
3+
requires = [
4+
"setuptools>=64",
5+
"setuptools-scm>=8",
6+
"decorator",
7+
"pyyaml",
8+
"scipy",
9+
"torch-npu == 2.5.1rc1"
10+
]
11+
build-backend = "setuptools.build_meta"

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ decorator
22
pyyaml
33
scipy
44
setuptools
5-
torch_npu == 2.5.1rc1
5+
setuptools-scm
6+
torch-npu == 2.5.1rc1

setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,15 @@
2121
from typing import List
2222

2323
from setuptools import setup
24+
from setuptools_scm import get_version
2425

2526
ROOT_DIR = os.path.dirname(__file__)
27+
try:
28+
VERSION = get_version(write_to="vllm_ascend/_version.py")
29+
except LookupError:
30+
# The checkout action in github action CI does not checkout the tag. It
31+
# only checks out the commit. In this case, we set a dummy version.
32+
VERSION = "0.0.0"
2633

2734

2835
def get_path(*filepath) -> str:
@@ -66,7 +73,7 @@ def _read_requirements(filename: str) -> List[str]:
6673
name='vllm_ascend',
6774
# Follow:
6875
# https://packaging.python.org/en/latest/specifications/version-specifiers
69-
version='0.1.0a1',
76+
version=VERSION,
7077
author="vLLM-Ascend team",
7178
license="Apache 2.0",
7279
description=("vLLM Ascend backend plugin"),

0 commit comments

Comments
 (0)