Skip to content

Commit 8c9319c

Browse files
authored
Merge pull request #205 from pycompression/autoversion2
Automated versioning using versioningit.
2 parents 7fc677c + cf11a81 commit 8c9319c

File tree

8 files changed

+35
-12
lines changed

8 files changed

+35
-12
lines changed

.github/release_checklist.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ Release checklist
22
- [ ] Check outstanding issues on JIRA and Github.
33
- [ ] Check [latest documentation](https://python-isal.readthedocs.io/en/latest/) looks fine.
44
- [ ] Create a release branch.
5-
- [ ] Set version to a stable number.
65
- [ ] Change current development version in `CHANGELOG.rst` to stable version.
7-
- [ ] Change the version in `__init__.py`
86
- [ ] Check if the address sanitizer does not find any problems using `tox -e asan`
97
- [ ] Merge the release branch into `main`.
108
- [ ] Created an annotated tag with the stable version number. Include changes

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
lint:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2.3.4
16+
- uses: actions/checkout@v4
1717
with:
1818
submodules: recursive
1919
- name: Set up Python 3.8
@@ -33,7 +33,7 @@ jobs:
3333
- twine_check
3434
runs-on: ubuntu-latest
3535
steps:
36-
- uses: actions/checkout@v2.3.4
36+
- uses: actions/checkout@v4
3737
with:
3838
submodules: recursive
3939
- name: Set up Python 3.8
@@ -71,7 +71,7 @@ jobs:
7171
- os: "windows-latest"
7272
python-version: "3.8"
7373
steps:
74-
- uses: actions/checkout@v2.3.4
74+
- uses: actions/checkout@v4
7575
with:
7676
submodules: recursive
7777
- name: Set up Python ${{ matrix.python-version }}
@@ -107,7 +107,7 @@ jobs:
107107
python_version:
108108
- "3.8"
109109
steps:
110-
- uses: actions/checkout@v2.3.4
110+
- uses: actions/checkout@v4
111111
with:
112112
submodules: recursive
113113
- uses: uraimo/[email protected]
@@ -137,7 +137,7 @@ jobs:
137137
- os: "ubuntu-latest"
138138
python_version: "pypy"
139139
steps:
140-
- uses: actions/checkout@v2.3.4
140+
- uses: actions/checkout@v4
141141
with:
142142
submodules: recursive
143143
- name: Install miniconda.
@@ -186,9 +186,10 @@ jobs:
186186
cibw_archs_linux: "aarch64"
187187
cibw_before_all_linux: "true" # The true command exits with 0
188188
steps:
189-
- uses: actions/checkout@v2.3.4
189+
- uses: actions/checkout@v4
190190
with:
191191
submodules: recursive
192+
fetch-depth: 0 # Fetch everything to get accurately versioned tag.
192193
- uses: actions/setup-python@v2
193194
name: Install Python
194195
- name: Install cibuildwheel twine wheel

.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]

MANIFEST.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
graft src/isal/isa-l
22
include src/isal/*.h
3+
prune tests
4+
prune docs
5+
prune benchmark_scripts
6+
exclude requirements-docs.txt
7+
exclude codecov.yml
8+
exclude .readthedocs.yml

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
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+
default-tag = "v0.0.0"
8+
9+
[tool.versioningit.write]
10+
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)