diff --git a/.github/release_checklist.md b/.github/release_checklist.md index 9abffc2..71b59ae 100644 --- a/.github/release_checklist.md +++ b/.github/release_checklist.md @@ -2,9 +2,7 @@ Release checklist - [ ] Check outstanding issues on JIRA and Github. - [ ] Check [latest documentation](https://python-zlib-ng.readthedocs.io/en/latest/) looks fine. - [ ] Create a release branch. - - [ ] Set version to a stable number. - [ ] Change current development version in `CHANGELOG.rst` to stable version. - - [ ] Change the version in `__init__.py` - [ ] Merge the release branch into `main`. - [ ] Created an annotated tag with the stable version number. Include changes from CHANGELOG.rst. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52dd2c0..7382e1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v4 with: submodules: recursive - name: Set up Python 3.8 @@ -36,7 +36,7 @@ jobs: - twine_check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v4 with: submodules: recursive - name: Set up Python 3.8 @@ -69,7 +69,7 @@ jobs: - os: "windows-latest" python-version: "3.8" steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v4 with: submodules: recursive - name: Set up Python ${{ matrix.python-version }} @@ -97,7 +97,7 @@ jobs: distro: [ "ubuntu_latest" ] arch: ["aarch64"] steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v4 with: submodules: recursive - uses: uraimo/run-on-arch-action@v2.2.0 @@ -132,7 +132,7 @@ jobs: - os: "ubuntu-latest" python_version: "pypy" steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install miniconda. @@ -170,9 +170,10 @@ jobs: - os: "ubuntu-latest" cibw_archs_linux: "aarch64" steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 # Fetch everything to get accurately versioned tag. - uses: actions/setup-python@v2 name: Install Python - name: Install cibuildwheel twine build diff --git a/.gitignore b/.gitignore index b6e4761..671f3ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +src/zlib_ng/_version.py + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/MANIFEST.in b/MANIFEST.in index 49eb90b..6cde131 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,10 @@ graft src/zlib_ng/zlib-ng +prune tests +prune docs +prune benchmark_scripts +prune .github +exclude tox.ini +exclude requirements-docs.txt +exclude codecov.yml +exclude .readthedocs.yml +exclude .git* diff --git a/pyproject.toml b/pyproject.toml index 62f5f82..28ae41d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,10 @@ [build-system] -requires = ["setuptools>=51", "wheel"] +requires = ["setuptools>=64", "versioningit>=1.1.0"] build-backend = "setuptools.build_meta" + +[tool.versioningit.vcs] +method="git" +default-tag = "v0.0.0" + +[tool.versioningit.write] +file = "src/zlib_ng/_version.py" diff --git a/setup.py b/setup.py index 8da9d85..95a6a44 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,8 @@ from setuptools import Extension, find_packages, setup from setuptools.command.build_ext import build_ext +import versioningit + ZLIB_NG_SOURCE = os.path.join("src", "zlib_ng", "zlib-ng") SYSTEM_IS_UNIX = (sys.platform.startswith("linux") or @@ -124,7 +126,7 @@ def build_zlib_ng(): setup( name="zlib-ng", - version="0.5.0-dev", + version=versioningit.get_version(), description="Drop-in replacement for zlib and gzip modules using zlib-ng", author="Leiden University Medical Center", author_email="r.h.p.vorderman@lumc.nl", # A placeholder for now diff --git a/src/zlib_ng/__init__.py b/src/zlib_ng/__init__.py index aa9ea12..8504ed8 100644 --- a/src/zlib_ng/__init__.py +++ b/src/zlib_ng/__init__.py @@ -5,4 +5,6 @@ # This file is part of python-zlib-ng which is distributed under the # PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2. -__version__ = "0.5.0-dev" +from ._version import __version__ + +__all__ = ["__version__"] diff --git a/src/zlib_ng/_version.pyi b/src/zlib_ng/_version.pyi new file mode 100644 index 0000000..6c8f915 --- /dev/null +++ b/src/zlib_ng/_version.pyi @@ -0,0 +1,8 @@ +# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 +# Python Software Foundation; All Rights Reserved + +# This file is part of python-zlib-ng which is distributed under the +# PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2. + +__version__: int \ No newline at end of file