Skip to content

Commit

Permalink
Remove setuptools_scm in favor of explicit version management (#156)
Browse files Browse the repository at this point in the history
setuptools_scm has a few drawbacks to version management by hand, such
as inflexibility for releasing off-tag, and missing info on shallow
checkouts.

As such, revert back to a static version number, with tagged commits as
version bumps.
  • Loading branch information
nicholasjng authored Oct 30, 2024
1 parent 3eefa56 commit 3b27774
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[build-system]
requires = ["setuptools>=45", "setuptools-scm[toml]>=7.1"]
requires = ["setuptools>=45"]
build-backend = "setuptools.build_meta"

[project]
name = "nnbench"
description = "A small framework for benchmarking machine learning models."
keywords = ["Benchmarking", "Machine Learning"]
requires-python = ">=3.10"
readme = "README.md"
license = { text = "Apache-2.0" }
authors = [{ name = "appliedAI Initiative", email = "[email protected]" }]
maintainers = [
Expand All @@ -33,7 +32,7 @@ classifiers = [

dependencies = ["tabulate", "typing-extensions; python_version< '3.11'"]

dynamic = ["version"]
dynamic = ["readme", "version"]

[project.urls]
Homepage = "https://github.com/aai-institute/nnbench"
Expand Down Expand Up @@ -71,15 +70,16 @@ nnbench = "nnbench.cli:main"
[tool.setuptools]
package-dir = { "" = "src" }

[tool.setuptools.dynamic]
readme = { file = "README.md", content-type = "text/markdown" }
version = { attr = "nnbench.__version__" }

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
nnbench = ["py.typed"]

# Automatically determine version number from Git tags
[tool.setuptools_scm]

[tool.mypy]
allow_redefinition = true
check_untyped_defs = true
Expand Down
10 changes: 2 additions & 8 deletions src/nnbench/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
"""A framework for organizing and running benchmark workloads on machine learning models."""

from importlib.metadata import PackageNotFoundError, version

try:
__version__ = version("nnbench")
except PackageNotFoundError:
# package is not installed
pass

from .core import benchmark, parametrize, product
from .reporter import BenchmarkReporter
from .runner import BenchmarkRunner
from .types import Benchmark, BenchmarkRecord, Memo, Parameters

__version__ = "0.3.0"


# TODO: This isn't great, make it functional instead?
def default_runner() -> BenchmarkRunner:
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3b27774

Please sign in to comment.