Skip to content

Require Python 3.9+, SPDX license metadata, psycodict.__version__ - #121

Merged
roed314 merged 2 commits into
roed314:mainfrom
roed-math:py39-metadata-version
Jul 22, 2026
Merged

Require Python 3.9+, SPDX license metadata, psycodict.__version__#121
roed314 merged 2 commits into
roed314:mainfrom
roed-math:py39-metadata-version

Conversation

@roed-math

Copy link
Copy Markdown

Three packaging changes for 1.0, in one PR because they interlock (the 3.9 floor is what unlocks the license fix):

Python >= 3.9

3.8 has been EOL since October 2024, and 1.0 is the natural moment to set the floor — raising it later is a compatibility break. CI: the unit matrix drops 3.8; the database matrix's "oldest supported pair" row becomes {py3.9, PG13}. [tool.ruff] target-version moves to py39.

SPDX license expression

license = "GPL-2.0-or-later" (PEP 639), replacing free-text {text = "GPL v2+"}. The wheel now carries a real License-Expression field (Metadata-Version 2.4). This form needs setuptools >= 77, which is exactly what kept it out before: py3.8's pip resolves setuptools 75.x, which rejects it. With the floor at 3.9 the workaround disappears; build-system now pins setuptools>=77 (and drops wheel, unneeded with modern setuptools).

Note for #113: with the string form, setuptools >= 77 errors if a License :: trove classifier is also present — the release branch should not add one, and can drop its {text = "GPL-2.0-or-later"} table-form workaround; this supersedes it.

psycodict.__version__

Single source of truth in psycodict/__init__.py; pyproject declares dynamic = ["version"] and reads the literal via [tool.setuptools.dynamic] (AST extraction — no import, so no psycopg needed at build time). Works from an uninstalled checkout too, which is how LMFDB runs psycodict today.

Note for #113: the release becomes "bump __version__ in __init__.py to 1.0.0" — the static version = line in pyproject is gone.

Verification

  • python -m build + twine check --strict: PASSED
  • wheel METADATA: Metadata-Version: 2.4, License-Expression: GPL-2.0-or-later, Requires-Python: >=3.9, Version: 0.1.13
  • installed wheel: psycodict.__version__ == importlib.metadata.version("psycodict") == 0.1.13
  • wheel ships only the psycodict package (no test leakage); sdist unchanged
  • database-free suite: 326 passed; ruff clean under py39 target

🤖 Generated with Claude Code

roed314 and others added 2 commits July 22, 2026 02:12
Three packaging changes for 1.0, taken together because they interlock:

- requires-python >= 3.9 (3.8 has been end-of-life since October 2024).
  The unit matrix drops 3.8 and the "oldest supported pair" database row
  becomes py3.9/PG13; ruff's target-version moves to py39.

- license = "GPL-2.0-or-later" (PEP 639 SPDX expression), replacing the
  free-text {text = "GPL v2+"}. The wheel now carries a proper
  License-Expression field. This needs setuptools >= 77, which is what
  previously kept it out: on py3.8, pip resolves setuptools 75.x, which
  rejects the string form. With the 3.9 floor the workaround disappears;
  build-system pins setuptools>=77 (wheel is no longer needed there).

- psycodict.__version__, the single source of truth: pyproject declares
  version dynamic and reads the literal via [tool.setuptools.dynamic], so
  the attribute also works from an uninstalled checkout (which is how
  LMFDB runs psycodict today).

Verified: build + twine check --strict pass; wheel METADATA shows
Metadata-Version 2.4, License-Expression GPL-2.0-or-later,
Requires-Python >=3.9; installed psycodict.__version__ matches
importlib.metadata.version; database-free suite 326 passed; ruff clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Python 3.14 joins the unit matrix, and {py3.14, PG18} becomes the
matrix's newest-pair corner, per the comment asking for a new row when
a PostgreSQL major is released.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@roed314
roed314 merged commit 510fcc5 into roed314:main Jul 22, 2026
17 checks passed
roed-math pushed a commit to roed-math/psycodict that referenced this pull request Jul 22, 2026
Rebased onto main, which absorbed everything this PR used to anticipate;
the reconciliation:

- Version: 1.0.0 is now set in psycodict.__init__.__version__, the single
  source of truth roed314#121 established -- pyproject keeps main's dynamic
  version, SPDX license string and >=3.9 floor, and this PR's classifiers
  drop the License:: entry (setuptools >= 77 rejects it next to an SPDX
  string) and the 3.8 entry.

- README: the rewrite now carries the Versioning.md pointer (roed314#123) in its
  Documentation list, which switches to relative links -- on the Sphinx
  site (roed314#122) those resolve to the copied guide pages, and they still
  render on GitHub; CHANGELOG and LICENSE stay absolute since neither is
  on the site.  Supported Python is 3.9+; blob/master URLs become
  blob/main.

- CHANGELOG: entries for the late wave -- sum/random honoring saving
  (roed314#118) and the 3.9 floor (roed314#121) under breaking changes; the docs site
  (roed314#122), Versioning.md/CONTRIBUTING/SECURITY and __version__ (roed314#121)
  under added; reload metafile+resort (roed314#114), update_from_file stats
  publication (roed314#115), copy_dumps delimiter escaping (roed314#116) under fixed;
  config.ini untracking (roed314#120), this release workflow and CITATION.cff
  (roed314#124) under infrastructure.

- release.yml: the flow notes now say bump __init__.__version__ and merge
  to main.

- Fixes the docs build on main, broken by the roed314#119 x roed314#122 crossing (roed314#119
  merged after roed314#122's last CI run): the Configuration docstring's nested
  defaults list needed blank lines to be valid RST under autodoc, and the
  README's relative LICENSE link had no target on the site.

Suite 857 passed / 36 skipped; ruff clean; sphinx -W clean; python -m
build + twine check --strict pass with Version 1.0.0,
License-Expression GPL-2.0-or-later, Requires-Python >=3.9 and no
License classifier in the wheel metadata.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants