-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
31 lines (25 loc) · 1.03 KB
/
Copy pathsetup.py
File metadata and controls
31 lines (25 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
import re
from setuptools import setup
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
def read(*path):
return open(os.path.join(*path), encoding="utf8").read()
def find_version(filepath: str) -> str:
"""Extract version information from the given filepath.
Adapted from https://github.com/ray-project/ray/blob/0b190ee1160eeca9796bc091e07eaebf4c85b511/python/setup.py
"""
with open(filepath) as fp:
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
fp.read(), re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
setup(
name="block_math",
version=find_version(os.path.join(PROJECT_ROOT, "block_math", "__init__.py")),
author="Myeonghwan Ahn",
description="Architecture-agnostic microscaling(MX)-like math in Triton-lang",
long_description=read(PROJECT_ROOT, "README.md"),
long_description_content_type="text/markdown",
packages=["block_math"]
)