Skip to content

Commit 32981fa

Browse files
authored
fix versioning (#56)
* fix version * Update versioning structure and increment version to 0.1.0 - Refactor version management by moving version information from _version.py to version.py. - Update pyproject.toml to reflect the new version attribute path. - Adjust tests to ensure compatibility with the new versioning structure. * Remove bumpversion configuration from pyproject.toml to streamline version management. * format * fix tests
1 parent ae95458 commit 32981fa

3 files changed

Lines changed: 2809 additions & 18 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import re
2+
from pathlib import Path
3+
4+
ROOT = Path(__file__).resolve().parents[2]
5+
6+
7+
def test_pyproject_uses_version_module():
8+
pyproject = (ROOT / "pyproject.toml").read_text(encoding="utf-8")
9+
10+
assert re.search(
11+
r"dynamic\s*=\s*\[[^\]]*\"version\"",
12+
pyproject,
13+
re.DOTALL,
14+
)
15+
assert re.search(
16+
r'version\s*=\s*\{\s*attr\s*=\s*"mlx_embeddings\.version\.__version__"\s*\}',
17+
pyproject,
18+
)

pyproject.toml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "mlx-embeddings"
3-
version = "0.1.0"
43
dynamic = [
4+
"version",
55
"dependencies",
66
]
77
description = "MLX-Embeddings is a package for running Vision and Language Embedding models locally on your Mac using MLX."
@@ -48,29 +48,14 @@ include = ["mlx_embeddings*"]
4848
exclude = ["docs*"]
4949

5050
[tool.setuptools.dynamic]
51+
version = {attr = "mlx_embeddings.version.__version__"}
5152
dependencies = {file = ["requirements.txt"]}
5253

5354

5455
[tool.distutils.bdist_wheel]
5556
universal = true
5657

5758

58-
[tool.bumpversion]
59-
current_version = "0.1.0"
60-
commit = true
61-
tag = true
62-
63-
[[tool.bumpversion.files]]
64-
filename = "pyproject.toml"
65-
search = 'version = "{current_version}"'
66-
replace = 'version = "{new_version}"'
67-
68-
[[tool.bumpversion.files]]
69-
filename = "mlx_embeddings/version.py"
70-
search = '__version__ = "{current_version}"'
71-
replace = '__version__ = "{new_version}"'
72-
73-
7459
[tool.pytest.ini_options]
7560
# test_smoke.py is a CLI integration script, not a pytest module
7661
addopts = "--ignore=mlx_embeddings/tests/test_smoke.py"
@@ -86,5 +71,5 @@ max-line-length = 88
8671
Homepage = "https://github.com/Blaizzy/mlx-embeddings"
8772

8873
[build-system]
89-
requires = ["setuptools>=64", "setuptools_scm>=8"]
74+
requires = ["setuptools>=64"]
9075
build-backend = "setuptools.build_meta"

0 commit comments

Comments
 (0)