Skip to content

Commit b9650b7

Browse files
authored
Merge pull request #48 from pycompression/autoversion3
Use automated versioning using versioningit
2 parents 1c9e979 + 8f0cda4 commit b9650b7

File tree

8 files changed

+40
-11
lines changed

8 files changed

+40
-11
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-zlib-ng.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
- [ ] Merge the release branch into `main`.
97
- [ ] Created an annotated tag with the stable version number. Include changes
108
from CHANGELOG.rst.

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
lint:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v2.3.4
19+
- uses: actions/checkout@v4
2020
with:
2121
submodules: recursive
2222
- name: Set up Python 3.8
@@ -36,7 +36,7 @@ jobs:
3636
- twine_check
3737
runs-on: ubuntu-latest
3838
steps:
39-
- uses: actions/checkout@v2.3.4
39+
- uses: actions/checkout@v4
4040
with:
4141
submodules: recursive
4242
- name: Set up Python 3.8
@@ -69,7 +69,7 @@ jobs:
6969
- os: "windows-latest"
7070
python-version: "3.8"
7171
steps:
72-
- uses: actions/checkout@v2.3.4
72+
- uses: actions/checkout@v4
7373
with:
7474
submodules: recursive
7575
- name: Set up Python ${{ matrix.python-version }}
@@ -97,7 +97,7 @@ jobs:
9797
distro: [ "ubuntu_latest" ]
9898
arch: ["aarch64"]
9999
steps:
100-
- uses: actions/checkout@v2.3.4
100+
- uses: actions/checkout@v4
101101
with:
102102
submodules: recursive
103103
- uses: uraimo/run-on-arch-action@v2.2.0
@@ -132,7 +132,7 @@ jobs:
132132
- os: "ubuntu-latest"
133133
python_version: "pypy"
134134
steps:
135-
- uses: actions/checkout@v2.3.4
135+
- uses: actions/checkout@v4
136136
with:
137137
submodules: recursive
138138
- name: Install miniconda.
@@ -170,9 +170,10 @@ jobs:
170170
- os: "ubuntu-latest"
171171
cibw_archs_linux: "aarch64"
172172
steps:
173-
- uses: actions/checkout@v2.3.4
173+
- uses: actions/checkout@v4
174174
with:
175175
submodules: recursive
176+
fetch-depth: 0 # Fetch everything to get accurately versioned tag.
176177
- uses: actions/setup-python@v2
177178
name: Install Python
178179
- name: Install cibuildwheel twine build

.gitignore

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

MANIFEST.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
graft src/zlib_ng/zlib-ng
2+
prune tests
3+
prune docs
4+
prune benchmark_scripts
5+
prune .github
6+
exclude tox.ini
7+
exclude requirements-docs.txt
8+
exclude codecov.yml
9+
exclude .readthedocs.yml
10+
exclude .git*

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/zlib_ng/_version.py"

setup.py

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

19+
import versioningit
20+
1921
ZLIB_NG_SOURCE = os.path.join("src", "zlib_ng", "zlib-ng")
2022

2123
SYSTEM_IS_UNIX = (sys.platform.startswith("linux") or
@@ -124,7 +126,7 @@ def build_zlib_ng():
124126

125127
setup(
126128
name="zlib-ng",
127-
version="0.5.0-dev",
129+
version=versioningit.get_version(),
128130
description="Drop-in replacement for zlib and gzip modules using zlib-ng",
129131
author="Leiden University Medical Center",
130132
author_email="r.h.p.vorderman@lumc.nl", # A placeholder for now

src/zlib_ng/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
# This file is part of python-zlib-ng which is distributed under the
66
# PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2.
77

8-
__version__ = "0.5.0-dev"
8+
from ._version import __version__
9+
10+
__all__ = ["__version__"]

src/zlib_ng/_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-zlib-ng which is distributed under the
6+
# PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2.
7+
8+
__version__: int

0 commit comments

Comments
 (0)