Skip to content

Commit 5bb8918

Browse files
authored
Merge pull request #64 from pycompression/setuptools_scm
Switch to setuptools-scm
2 parents fe3ccbb + 54f8595 commit 5bb8918

File tree

7 files changed

+74
-65
lines changed

7 files changed

+74
-65
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
- uses: actions/checkout@v4
2020
with:
2121
submodules: recursive
22-
- name: Set up Python 3.8
22+
- name: Set up Python 3.9
2323
uses: actions/[email protected]
2424
with:
25-
python-version: "3.8"
25+
python-version: "3.9"
2626
- name: Install tox
2727
run: pip install tox
2828
- name: Lint
@@ -39,10 +39,10 @@ jobs:
3939
- uses: actions/checkout@v4
4040
with:
4141
submodules: recursive
42-
- name: Set up Python 3.8
42+
- name: Set up Python 3.9
4343
uses: actions/[email protected]
4444
with:
45-
python-version: 3.8
45+
python-version: "3.9"
4646
- name: Install tox and upgrade setuptools and pip
4747
run: pip install --upgrade tox setuptools pip
4848
- name: Run tox -e ${{ matrix.tox_env }}
@@ -53,22 +53,21 @@ jobs:
5353
strategy:
5454
matrix:
5555
python-version:
56-
- "3.8"
5756
- "3.9"
5857
- "3.10"
5958
- "3.11"
6059
- "3.12"
61-
- "3.13-dev"
60+
- "3.13"
6261
- "pypy-3.9"
6362
- "pypy-3.10"
6463
os: ["ubuntu-latest"]
6564
include:
6665
- os: "macos-14" # For m1 macos
6766
python-version: "3.12"
6867
- os: "macos-13" # for x86 macos
69-
python-version: "3.8"
68+
python-version: "3.9"
7069
- os: "windows-latest"
71-
python-version: "3.8"
70+
python-version: "3.9"
7271
steps:
7372
- uses: actions/checkout@v4
7473
with:
@@ -96,7 +95,7 @@ jobs:
9695
strategy:
9796
matrix:
9897
python_version:
99-
- "3.8"
98+
- "3.9"
10099
steps:
101100
- uses: actions/checkout@v4
102101
with:
@@ -197,7 +196,7 @@ jobs:
197196
- name: Build wheels
198197
run: cibuildwheel --output-dir dist
199198
env:
200-
# Skip 32 bit, macosx_arm64 causes issues on cpython 3.8
199+
# Skip 32 bit, macosx_arm64 causes issues on cpython 3.9
201200
CIBW_SKIP: "*-win32 *-manylinux_i686 cp38-macosx_arm64"
202201
CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }}
203202
CIBW_TEST_REQUIRES: "pytest"
@@ -218,14 +217,14 @@ jobs:
218217
CIBW_ENVIRONMENT_LINUX: >-
219218
PYTHON_ZLIB_NG_BUILD_CACHE=True
220219
PYTHON_ZLIB_NG_BUILD_CACHE_FILE=/tmp/build_cache
221-
CFLAGS="-g0 -DNDEBUG"
220+
CFLAGS="-O3 -DNDEBUG"
222221
CIBW_ENVIRONMENT_WINDOWS: >-
223222
PYTHON_ZLIB_NG_BUILD_CACHE=True
224223
PYTHON_ZLIB_NG_BUILD_CACHE_FILE=${{ runner.temp }}\build_cache
225224
CIBW_ENVIRONMENT_MACOS: >-
226225
PYTHON_ZLIB_NG_BUILD_CACHE=True
227226
PYTHON_ZLIB_NG_BUILD_CACHE_FILE=${{ runner.temp }}/build_cache
228-
CFLAGS="-g0 -DNDEBUG"
227+
CFLAGS="-O3 -DNDEBUG"
229228
- name: Build sdist
230229
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'x86_64'}}
231230
run:

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ Changelog
77
.. This document is user facing. Please word the changes in such a way
88
.. that users understand how the changes affect the new version.
99
10+
version develop
11+
-----------------
12+
+ Python 3.8 is no longer supported.
13+
+ Switched to setuptools-scm for building the package rather than versioningit.
14+
+ Test files are added to the source distribution.
15+
1016
version 0.5.1
1117
-----------------
1218
+ Fix a bug where flushing in threaded mode did not write the data to the

MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
graft src/zlib_ng/zlib-ng
2-
prune tests
32
prune docs
43
prune benchmark_scripts
54
prune .github
6-
exclude tox.ini
75
exclude requirements-docs.txt
86
exclude codecov.yml
97
exclude .readthedocs.yml

docs/conf.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@
4242
# a list of builtin themes.
4343
#
4444
html_theme = 'sphinx_rtd_theme'
45-
html_theme_options = dict(
46-
display_version=True,
47-
)
4845

4946
# Add any paths that contain custom static files (such as style sheets) here,
5047
# relative to this directory. They are copied after the builtin static files,

pyproject.toml

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,58 @@
11
[build-system]
2-
requires = ["setuptools>=64", "versioningit>=1.1.0"]
2+
requires = ["setuptools>=77", "setuptools-scm>=8"]
33
build-backend = "setuptools.build_meta"
44

5-
[tool.versioningit.vcs]
6-
method="git"
7-
default-tag = "v0.0.0"
5+
[project]
6+
name = "zlib-ng"
7+
dynamic = ["version"]
8+
description = "Drop-in replacement for zlib and gzip modules using zlib-ng"
9+
license="PSF-2.0"
10+
keywords=["zlib-ng", "zlib", "compression", "deflate", "gzip"]
11+
authors = [{name = "Leiden University Medical Center"},
12+
{email = "[email protected]"}]
13+
readme = "README.rst"
14+
requires-python = ">=3.9" # Because of setuptools version
15+
classifiers = [
16+
"Programming Language :: Python :: 3 :: Only",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.9",
19+
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
22+
"Programming Language :: Python :: 3.13",
23+
"Programming Language :: Python :: Implementation :: CPython",
24+
"Programming Language :: Python :: Implementation :: PyPy",
25+
"Programming Language :: C",
26+
"Development Status :: 5 - Production/Stable",
27+
"Topic :: System :: Archiving :: Compression",
28+
"Operating System :: POSIX :: Linux",
29+
"Operating System :: MacOS",
30+
"Operating System :: Microsoft :: Windows",
31+
]
32+
urls.homepage = "https://github.com/pycompression/python-zlib-ng"
33+
urls.documentation = "python-zlib-ng.readthedocs.io"
834

9-
[tool.versioningit.write]
10-
file = "src/zlib_ng/_version.py"
35+
[tool.setuptools_scm]
36+
version_file = "src/zlib_ng/_version.py"
37+
38+
[tool.setuptools.packages.find]
39+
where = ["src"]
40+
include = ["zlib_ng"]
41+
42+
[tool.setuptools.package-data]
43+
zlib_ng = ['*.pyi', 'py.typed', 'zlib-ng/LICENSE', 'zlib-ng/README.md']
44+
[tool.setuptools.exclude-package-data]
45+
zlib_ng = [
46+
"*.c",
47+
"*.h",
48+
"zlib-ng/*/*",
49+
"zlib-ng/*in",
50+
"zlib-ng/.*",
51+
"zlib-ng/*.map",
52+
"zlib-ng/INDEX.md",
53+
"zlib-ng/CMakeLists.txt",
54+
"zlib-ng/PORTING.md",
55+
"zlib-ng/configure",
56+
"zlib-ng/*.empty",
57+
"zlib-ng/FAQ.zlib",
58+
]

requirements-docs.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sphinx
2-
setuptools
1+
# https://github.com/sphinx-doc/sphinx/issues/13415
2+
sphinx<8
33
sphinx-rtd-theme
44
sphinx-argparse

setup.py

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
import tempfile
1414
from pathlib import Path
1515

16-
from setuptools import Extension, find_packages, setup
16+
from setuptools import Extension, setup
1717
from setuptools.command.build_ext import build_ext
1818

19-
import versioningit
20-
2119
ZLIB_NG_SOURCE = os.path.join("src", "zlib_ng", "zlib-ng")
2220

2321
SYSTEM_IS_UNIX = (sys.platform.startswith("linux") or
@@ -125,43 +123,6 @@ def build_zlib_ng():
125123

126124

127125
setup(
128-
name="zlib-ng",
129-
version=versioningit.get_version(),
130-
description="Drop-in replacement for zlib and gzip modules using zlib-ng",
131-
author="Leiden University Medical Center",
132-
author_email="[email protected]", # A placeholder for now
133-
long_description=Path("README.rst").read_text(),
134-
long_description_content_type="text/x-rst",
135126
cmdclass={"build_ext": BuildZlibNGExt},
136-
license="PSF-2.0",
137-
keywords="zlib-ng zlib compression deflate gzip",
138-
zip_safe=False,
139-
packages=find_packages('src'),
140-
package_dir={'': 'src'},
141-
package_data={'zlib_ng': [
142-
'*.pyi', 'py.typed',
143-
# Include zlib-ng LICENSE and other relevant files with the binary distribution.
144-
'zlib-ng/LICENSE.md', 'zlib-ng/README.md']},
145-
url="https://github.com/pycompression/python-zlib-ng",
146-
classifiers=[
147-
"Programming Language :: Python :: 3 :: Only",
148-
"Programming Language :: Python :: 3",
149-
"Programming Language :: Python :: 3.8",
150-
"Programming Language :: Python :: 3.9",
151-
"Programming Language :: Python :: 3.10",
152-
"Programming Language :: Python :: 3.11",
153-
"Programming Language :: Python :: 3.12",
154-
"Programming Language :: Python :: 3.13",
155-
"Programming Language :: Python :: Implementation :: CPython",
156-
"Programming Language :: Python :: Implementation :: PyPy",
157-
"Programming Language :: C",
158-
"Development Status :: 4 - Beta",
159-
"Topic :: System :: Archiving :: Compression",
160-
"License :: OSI Approved :: Python Software Foundation License",
161-
"Operating System :: POSIX :: Linux",
162-
"Operating System :: MacOS",
163-
"Operating System :: Microsoft :: Windows",
164-
],
165-
python_requires=">=3.8", # Earliest version still tested.
166127
ext_modules=EXTENSIONS
167128
)

0 commit comments

Comments
 (0)