patch bump (#2000)

This commit is contained in:
Awni Hannun 2025-03-24 12:47:05 -07:00 committed by GitHub
parent 6a40e1c176
commit aba899cef8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 3 deletions

View File

@ -4,7 +4,7 @@
#define MLX_VERSION_MAJOR 0
#define MLX_VERSION_MINOR 24
#define MLX_VERSION_PATCH 0
#define MLX_VERSION_PATCH 1
#define MLX_VERSION_NUMERIC \
(100000 * MLX_VERSION_MAJOR + 1000 * MLX_VERSION_MINOR + MLX_VERSION_PATCH)

View File

@ -12,7 +12,16 @@ from setuptools import Command, Extension, find_namespace_packages, setup
from setuptools.command.build_ext import build_ext
def get_version(version):
def get_version():
with open("mlx/version.h", "r") as fid:
for l in fid:
if "#define MLX_VERSION_MAJOR" in l:
major = l.split()[-1]
if "#define MLX_VERSION_MINOR" in l:
minor = l.split()[-1]
if "#define MLX_VERSION_PATCH" in l:
patch = l.split()[-1]
version = f"{major}.{minor}.{patch}"
if "PYPI_RELEASE" not in os.environ:
today = datetime.date.today()
version = f"{version}.dev{today.year}{today.month:02d}{today.day:02d}"
@ -172,7 +181,7 @@ if __name__ == "__main__":
setup(
name="mlx",
version=get_version("0.24.0"),
version=get_version(),
author="MLX Contributors",
author_email="mlx@group.apple.com",
description="A framework for machine learning on Apple silicon.",