File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11[metadata]
22name = fast_llm
3- # TODO: Take from __init__.py instead?
4- version = 0.2.0
53
64[options]
75packages = find_namespace:
Original file line number Diff line number Diff line change 11import sys
2+ import re
3+ import pathlib
24
35try :
46 import pybind11
1618 print (f"Error: setuptools version { _SETUPTOOLS_MIN_VERSION } " "or greater is required" )
1719 sys .exit (1 )
1820
21+ def get_version ():
22+ """Read version from fast_llm/__init__.py"""
23+ init_file = pathlib .Path (__file__ ).parent .joinpath ("fast_llm" , "__init__.py" ).read_text ()
24+ version_match = re .search (r"^__version__ = ['\"]([^'\"]*)['\"]" , init_file , re .M )
25+ if version_match :
26+ return version_match .group (1 )
27+ raise RuntimeError ("Unable to find version string in fast_llm/__init__.py" )
28+
1929cpp_extension = setuptools .Extension (
2030 "fast_llm.csrc.data" ,
2131 sources = ["fast_llm/csrc/data.cpp" ],
2737
2838setuptools .setup (
2939 ext_modules = [cpp_extension ],
40+ version = get_version (),
3041)
You can’t perform that action at this time.
0 commit comments