From 2321b276b53689da19bb2ceb1b89c503d7c9672d Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Tue, 27 Oct 2026 16:07:58 -0500 Subject: [PATCH 1/5] Changes for 5.0.0 --- .github/workflows/python-app.yml | 14 ++++++------- .gitignore | 3 +++ docs/conf.py | 2 +- docs/requirements.txt | 1 - setup.py | 34 ++------------------------------ 5 files changed, 13 insertions(+), 41 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 55b4b43..b4926c9 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -8,12 +8,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "pypy-3.10"] + python-version: ["3.11", "3.12", "3.13", "3.14", "3.15", "pypy-3.11"] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -31,19 +31,19 @@ jobs: run: | flake8 . - name: Build docs with sphinx - if: "matrix.python-version == '3.10'" + if: "matrix.python-version == '3.11'" run: | pip install -r docs/requirements.txt sphinx-build -W -b html docs docs/_build/html - name: Build packages - if: "matrix.python-version == '3.10'" + if: "matrix.python-version == '3.11'" run: | pip install -U twine wheel python setup.py sdist bdist_wheel twine check dist/* - name: Upload packages - if: "matrix.python-version == '3.10'" - uses: actions/upload-artifact@v4 + if: "matrix.python-version == '3.11'" + uses: actions/upload-artifact@v7 with: name: python-pure-cdb-packages path: dist/* diff --git a/.gitignore b/.gitignore index 6f7a6d9..753244d 100644 --- a/.gitignore +++ b/.gitignore @@ -109,3 +109,6 @@ venv.bak/ .mypy_cache/ .dmypy.json dmypy.json + +# MacOS +.DS_Store diff --git a/docs/conf.py b/docs/conf.py index b781c91..ed0f967 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -74,7 +74,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' +# html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/docs/requirements.txt b/docs/requirements.txt index ab3f3dd..2806c16 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1 @@ Sphinx -sphinx_rtd_theme diff --git a/setup.py b/setup.py index e45ef2b..64cfcea 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ -#!/usr/bin/env python from os import environ -from setuptools import Extension, find_packages, setup +from setuptools import Extension, setup # Opt-in to building the C extension by setting the # ENABLE_DJB_HASH_CEXT environment variable @@ -12,33 +11,4 @@ else: ext_modules = [] - -description = "Pure Python reader/writer for Dan J. Berstein's CDB format." - -with open('README.rst', 'rt') as f: - long_description = f.read() - -setup( - author='David Wilson', - author_email='dw@botanicus.net', - description=description, - long_description=long_description, - long_description_content_type='text/x-rst', - download_url='https://github.com/dw/python-pure-cdb', - keywords='cdb file format appengine database db', - license='MIT', - name='pure-cdb', - version='4.0.0', - packages=find_packages(include=['cdblib']), - ext_modules=ext_modules, - install_requires=[], - python_requires='>=3.6', - test_suite='tests', - tests_require=['flake8'], - entry_points={ - 'console_scripts': [ - 'python-pure-cdbmake=cdblib.cdbmake:main', - 'python-pure-cdbdump=cdblib.cdbdump:main', - ], - }, -) +setup(ext_modules=ext_modules) From 118a7477008a166c8ec61c6fbe0c5ddaa2dba234 Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Tue, 27 Oct 2026 16:29:57 -0500 Subject: [PATCH 2/5] Publish releases to PyPI --- .github/workflows/publish.yml | 67 +++++++++++++++++++++++++++++++++++ pyproject.toml | 38 ++++++++++++++++++++ setup.py | 14 -------- 3 files changed, 105 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..a5de97f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,67 @@ +name: Publish releases to PyPI + +on: + workflow_dispatch: + release: + types: [published] + +jobs: + build_sdist: + name: Build sdist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-python@v7 + with: + python-version: "3.11" + + - name: Install build + run: python -m pip install build + + - name: Build sdist + run: python -m build --sdist --outdir dist + + - uses: actions/upload-artifact@v7 + with: + name: dist-sdist + path: dist/* + + build_wheels: + name: Build wheels for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - uses: actions/checkout@v7 + + - name: Build wheels + uses: pypa/cibuildwheel@v3.4.1 + env: + CIBW_ARCHS_LINUX: "x86_64 aarch64" + CIBW_ARCHS_MACOS: "x86_64 arm64" + CIBW_ARCHS_WINDOWS: "AMD64" + + - uses: actions/upload-artifact@v7 + with: + name: dist-wheels-${{ matrix.os }} + path: ./wheelhouse/*.whl + + publish: + name: Publish to PyPI + needs: [build_sdist, build_wheels] + if: github.event_name == 'release' && github.event.action == 'published' + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v8 + with: + pattern: dist-* + path: dist + merge-multiple: true + + - name: Publish distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..084e73c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,38 @@ +[build-system] +requires = ["setuptools>=77.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "pure-cdb" +version = "5.0.0" +description = "Pure Python reader/writer for Dan J. Bernstein's CDB format." +readme = "README.rst" +requires-python = ">=3.11" +license = "MIT" +authors = [ + { name = "Bo Bayles", email = "bo@bbayles.com" }, + { name = "David Wilson", email = "dw@botanicus.net" }, +] +keywords = ["cdb", "file", "format", "appengine", "database", "db"] +dependencies = [] + +[project.urls] +Download = "https://github.com/bbayles/python-pure-cdb" + +[project.scripts] +python-pure-cdbmake = "cdblib.cdbmake:main" +python-pure-cdbdump = "cdblib.cdbdump:main" + +[project.optional-dependencies] +test = ["flake8"] + +[tool.setuptools.packages.find] +include = ["cdblib"] + +[[tool.setuptools.ext-modules]] +name = "cdblib._djb_hash" +sources = ["cdblib/_djb_hash.c"] + +[tool.cibuildwheel] +build-frontend = "build" +skip = ["*-win32", "*-manylinux_i686", "*-musllinux_i686", "pp*"] diff --git a/setup.py b/setup.py deleted file mode 100644 index 64cfcea..0000000 --- a/setup.py +++ /dev/null @@ -1,14 +0,0 @@ -from os import environ - -from setuptools import Extension, setup - -# Opt-in to building the C extension by setting the -# ENABLE_DJB_HASH_CEXT environment variable -if environ.get('ENABLE_DJB_HASH_CEXT', '1') != '0': - ext_modules = [ - Extension('cdblib._djb_hash', sources=['cdblib/_djb_hash.c']), - ] -else: - ext_modules = [] - -setup(ext_modules=ext_modules) From bbf7c7cfe96bf100924a6c0cd37bedd1b64d40ec Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Tue, 27 Oct 2026 16:43:55 -0500 Subject: [PATCH 3/5] No more setup.py --- .github/workflows/python-app.yml | 2 +- setup.cfg | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index b4926c9..413a6a8 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -39,7 +39,7 @@ jobs: if: "matrix.python-version == '3.11'" run: | pip install -U twine wheel - python setup.py sdist bdist_wheel + python -m build twine check dist/* - name: Upload packages if: "matrix.python-version == '3.11'" diff --git a/setup.cfg b/setup.cfg index 7e6a48a..b1c9595 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,4 +1,3 @@ [flake8] filename = ./cdblib/*.py - ./setup.py From 2250eef8e079db928eea6840a3e809bb8c94fdbf Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Tue, 27 Oct 2026 16:46:35 -0500 Subject: [PATCH 4/5] Build with build --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 413a6a8..17142bc 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -38,7 +38,7 @@ jobs: - name: Build packages if: "matrix.python-version == '3.11'" run: | - pip install -U twine wheel + pip install -U twine wheel build python -m build twine check dist/* - name: Upload packages From 86ce9241acf77830acdd4b97bb7aedd10224bfc2 Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Wed, 28 Oct 2026 11:39:37 -0500 Subject: [PATCH 5/5] Update versions.rst --- docs/versions.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/versions.rst b/docs/versions.rst index 9b86915..1401e4e 100644 --- a/docs/versions.rst +++ b/docs/versions.rst @@ -1,6 +1,8 @@ Version history =============== +* `Version 5.0.0 `_ + * This package is now marked as supporting Python 3.10 and above * `Version 4.0.0 `_ * This package is now marked as supporting Python 3.6 and above * Fixed a bug related to items that hash to the value 0 (thanks to pwlodarczyk92)