Skip to content

Commit

Permalink
Using setuptools-scm to generate JAX Scalify version. (#127)
Browse files Browse the repository at this point in the history
Removing old manual setup + using dynamic rule in `pyproject.toml`.
  • Loading branch information
balancap authored Jul 17, 2024
1 parent 186bf8d commit 540f021
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
jax_scalify/version.py

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
2 changes: 1 addition & 1 deletion jax_scalify/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright (c) 2023 Graphcore Ltd. All rights reserved.
from . import core, lax, ops, tree
from ._version import __version__
from .core import ( # noqa: F401
Pow2RoundMode,
ScaledArray,
Expand All @@ -11,3 +10,4 @@
scaled_array,
scalify,
)
from .version import __version__
2 changes: 0 additions & 2 deletions jax_scalify/_version.py

This file was deleted.

10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ build-backend = "setuptools.build_meta"

[project]
name = "jax_scalify"
version = "0.1"
description="JAX Scalify: end-to-end scaled arithmetic."
readme = "README.md"
authors = [
Expand All @@ -30,6 +29,7 @@ dependencies = [
"ml_dtypes",
"numpy >= 1.22.4"
]
dynamic = ["version"]

[project.urls]
"Homepage" = "https://github.com/graphcore-research/jax-scalify/#readme"
Expand All @@ -43,10 +43,16 @@ test = ["pytest"]
# Relying on the default setuptools.
# In case of an issue, can use the following options
# [tool.setuptools]
# packages = ["jax_scalify", "jax_scalify.core", "jax_scalify.lax", "jax_scalify.ops"]
# packages = ["jax_scalify", "jax_scalify.core", "jax_scalify.lax", "jax_scalify.ops", "jax_scalify.tree"]
# [tool.setuptools.packages]
# find = {namespaces = false}

[tool.setuptools.dynamic]
version = {attr = "jax_scalify.version.__version__"}

[tool.setuptools_scm]
version_file = "jax_scalify/version.py"

[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-config", "-p no:hypothesispytest"]
Expand Down

0 comments on commit 540f021

Please sign in to comment.