diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cb6dd8..2c000ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,10 +19,10 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v2.2.1 with: - python-version: "3.8" + python-version: "3.9" - name: Install tox run: pip install tox - name: Lint @@ -39,10 +39,10 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v2.2.1 with: - python-version: 3.8 + python-version: "3.9" - name: Install tox and upgrade setuptools and pip run: pip install --upgrade tox setuptools pip - name: Run tox -e ${{ matrix.tox_env }} @@ -53,12 +53,11 @@ jobs: strategy: matrix: python-version: - - "3.8" - "3.9" - "3.10" - "3.11" - "3.12" - - "3.13-dev" + - "3.13" - "pypy-3.9" - "pypy-3.10" os: ["ubuntu-latest"] @@ -66,9 +65,9 @@ jobs: - os: "macos-14" # For m1 macos python-version: "3.12" - os: "macos-13" # for x86 macos - python-version: "3.8" + python-version: "3.9" - os: "windows-latest" - python-version: "3.8" + python-version: "3.9" steps: - uses: actions/checkout@v4 with: @@ -96,7 +95,7 @@ jobs: strategy: matrix: python_version: - - "3.8" + - "3.9" steps: - uses: actions/checkout@v4 with: @@ -197,7 +196,7 @@ jobs: - name: Build wheels run: cibuildwheel --output-dir dist env: - # Skip 32 bit, macosx_arm64 causes issues on cpython 3.8 + # Skip 32 bit, macosx_arm64 causes issues on cpython 3.9 CIBW_SKIP: "*-win32 *-manylinux_i686 cp38-macosx_arm64" CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }} CIBW_TEST_REQUIRES: "pytest" @@ -218,14 +217,14 @@ jobs: CIBW_ENVIRONMENT_LINUX: >- PYTHON_ZLIB_NG_BUILD_CACHE=True PYTHON_ZLIB_NG_BUILD_CACHE_FILE=/tmp/build_cache - CFLAGS="-g0 -DNDEBUG" + CFLAGS="-O3 -DNDEBUG" CIBW_ENVIRONMENT_WINDOWS: >- PYTHON_ZLIB_NG_BUILD_CACHE=True PYTHON_ZLIB_NG_BUILD_CACHE_FILE=${{ runner.temp }}\build_cache CIBW_ENVIRONMENT_MACOS: >- PYTHON_ZLIB_NG_BUILD_CACHE=True PYTHON_ZLIB_NG_BUILD_CACHE_FILE=${{ runner.temp }}/build_cache - CFLAGS="-g0 -DNDEBUG" + CFLAGS="-O3 -DNDEBUG" - name: Build sdist if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'x86_64'}} run: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1b7cf28..ffc0d0b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,6 +7,12 @@ Changelog .. This document is user facing. Please word the changes in such a way .. that users understand how the changes affect the new version. +version develop +----------------- ++ Python 3.8 is no longer supported. ++ Switched to setuptools-scm for building the package rather than versioningit. ++ Test files are added to the source distribution. + version 0.5.1 ----------------- + Fix a bug where flushing in threaded mode did not write the data to the diff --git a/MANIFEST.in b/MANIFEST.in index 6cde131..00f6a18 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,9 +1,7 @@ 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 diff --git a/docs/conf.py b/docs/conf.py index 528d846..61a5ca2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -42,9 +42,6 @@ # a list of builtin themes. # html_theme = 'sphinx_rtd_theme' -html_theme_options = dict( - display_version=True, -) # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/pyproject.toml b/pyproject.toml index 28ae41d..1d05808 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,58 @@ [build-system] -requires = ["setuptools>=64", "versioningit>=1.1.0"] +requires = ["setuptools>=77", "setuptools-scm>=8"] build-backend = "setuptools.build_meta" -[tool.versioningit.vcs] -method="git" -default-tag = "v0.0.0" +[project] +name = "zlib-ng" +dynamic = ["version"] +description = "Drop-in replacement for zlib and gzip modules using zlib-ng" +license="PSF-2.0" +keywords=["zlib-ng", "zlib", "compression", "deflate", "gzip"] +authors = [{name = "Leiden University Medical Center"}, + {email = "r.h.p.vorderman@lumc.nl"}] +readme = "README.rst" +requires-python = ">=3.9" # Because of setuptools version +classifiers = [ + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Programming Language :: C", + "Development Status :: 5 - Production/Stable", + "Topic :: System :: Archiving :: Compression", + "Operating System :: POSIX :: Linux", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", +] +urls.homepage = "https://github.com/pycompression/python-zlib-ng" +urls.documentation = "python-zlib-ng.readthedocs.io" -[tool.versioningit.write] -file = "src/zlib_ng/_version.py" +[tool.setuptools_scm] +version_file = "src/zlib_ng/_version.py" + +[tool.setuptools.packages.find] +where = ["src"] +include = ["zlib_ng"] + +[tool.setuptools.package-data] +zlib_ng = ['*.pyi', 'py.typed', 'zlib-ng/LICENSE', 'zlib-ng/README.md'] +[tool.setuptools.exclude-package-data] +zlib_ng = [ + "*.c", + "*.h", + "zlib-ng/*/*", + "zlib-ng/*in", + "zlib-ng/.*", + "zlib-ng/*.map", + "zlib-ng/INDEX.md", + "zlib-ng/CMakeLists.txt", + "zlib-ng/PORTING.md", + "zlib-ng/configure", + "zlib-ng/*.empty", + "zlib-ng/FAQ.zlib", +] diff --git a/requirements-docs.txt b/requirements-docs.txt index 051c278..65356bf 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,4 +1,4 @@ -sphinx -setuptools +# https://github.com/sphinx-doc/sphinx/issues/13415 +sphinx<8 sphinx-rtd-theme sphinx-argparse \ No newline at end of file diff --git a/setup.py b/setup.py index 8959b04..f58cbf8 100644 --- a/setup.py +++ b/setup.py @@ -13,11 +13,9 @@ import tempfile from pathlib import Path -from setuptools import Extension, find_packages, setup +from setuptools import Extension, 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 @@ -125,43 +123,6 @@ def build_zlib_ng(): setup( - name="zlib-ng", - 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 - long_description=Path("README.rst").read_text(), - long_description_content_type="text/x-rst", cmdclass={"build_ext": BuildZlibNGExt}, - license="PSF-2.0", - keywords="zlib-ng zlib compression deflate gzip", - zip_safe=False, - packages=find_packages('src'), - package_dir={'': 'src'}, - package_data={'zlib_ng': [ - '*.pyi', 'py.typed', - # Include zlib-ng LICENSE and other relevant files with the binary distribution. - 'zlib-ng/LICENSE.md', 'zlib-ng/README.md']}, - url="https://github.com/pycompression/python-zlib-ng", - classifiers=[ - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - "Programming Language :: C", - "Development Status :: 4 - Beta", - "Topic :: System :: Archiving :: Compression", - "License :: OSI Approved :: Python Software Foundation License", - "Operating System :: POSIX :: Linux", - "Operating System :: MacOS", - "Operating System :: Microsoft :: Windows", - ], - python_requires=">=3.8", # Earliest version still tested. ext_modules=EXTENSIONS )