Skip to content

Commit dacbe52

Browse files
committed
Build version with versioningit
1 parent 7fc677c commit dacbe52

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
src/isal/_version.py
2+
13
# Byte-compiled / optimized / DLL files
24
__pycache__/
35
*.py[cod]

pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
[build-system]
2-
requires = ["setuptools>=51", "wheel"]
2+
requires = ["setuptools>=64", "versioningit>=1.1.0"]
33
build-backend = "setuptools.build_meta"
4+
5+
[tool.versioningit.vcs]
6+
method="git"
7+
8+
[tool.versioningit.write]
9+
file = "src/isal/_version.py"

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
from setuptools import Extension, find_packages, setup
1919
from setuptools.command.build_ext import build_ext
2020

21+
import versioningit
22+
2123
ISA_L_SOURCE = os.path.join("src", "isal", "isa-l")
2224

2325
SYSTEM_IS_BSD = (sys.platform.startswith("freebsd") or
@@ -136,7 +138,7 @@ def build_isa_l():
136138

137139
setup(
138140
name="isal",
139-
version="1.7.0-dev",
141+
version=versioningit.get_version(),
140142
description="Faster zlib and gzip compatible compression and "
141143
"decompression by providing python bindings for the ISA-L "
142144
"library.",

src/isal/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from ._isal import (ISAL_MAJOR_VERSION, ISAL_MINOR_VERSION, ISAL_PATCH_VERSION,
99
ISAL_VERSION)
10+
from ._version import __version__
1011

1112
__all__ = [
1213
"ISAL_MAJOR_VERSION",
@@ -15,5 +16,3 @@
1516
"ISAL_VERSION",
1617
"__version__"
1718
]
18-
19-
__version__ = "1.7.0-dev"

src/isal/_version.pyi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2+
# 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022
3+
# Python Software Foundation; All Rights Reserved
4+
5+
# This file is part of python-isal which is distributed under the
6+
# PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2.
7+
8+
__version__: int

0 commit comments

Comments
 (0)