Switch to setuptools for a universal wheel, add publish.yml - #69
Merged
Conversation
javaobj still supports Python 2.7 (v1/v2), so this release ships a single py2.py3-none-any wheel instead of one that only pip on 3.x can even select. hatchling has no equivalent of setuptools' universal flag, so the build backend moved there (setup.cfg's old [bdist_wheel] flag now lives in pyproject.toml's [tool.distutils.bdist_wheel], and setup.py gained the dual-path pattern jsonrpclib uses: pyproject.toml on Python 3, explicit metadata parsed from javaobj/__init__.py on 2.7, whose setuptools can't read [project]). Verified locally with podman, not through the new workflow: python -m build under Python 3.14 produces the py2.py3-none-any wheel and passes twine check --strict; a fresh Python 2.7 container installs correctly both from source (setup.py install) and from that exact wheel, with javaobj.__version__ resolving to 0.6.0 from outside the source tree either way. Along the way, setuptools>=77 rejected the old License classifier now that a SPDX license expression is set (fixed), and check_version.py caught javaobj/v2/main.py missing its version docstring entirely (fixed). Added check_version.py, release_notes.py and sbom_artifacts.py (ported from jsonrpclib, which released a universal wheel the same way), docs/changelog.md as the source of truth for release notes, and publish.yml itself: build, SLSA provenance attestation, CycloneDX SBOM, PyPI Trusted Publishing, GitHub release. Not exercised for real: no tag pushed, no workflow_dispatch run. The PyPI trusted publisher and the pypi/testpypi GitHub environments still need to be configured before a real release can go through. Signed-off-by: Thomas Calmant <thomas.calmant@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
py2.py3-none-anyuniversal wheel: javaobj still supports Python 2.7 (v1/v2), and hatchling has no equivalent of setuptools' universal-wheel flag.setup.cfg's old[bdist_wheel]flag now lives inpyproject.toml's[tool.distutils.bdist_wheel];setup.pygained the dual-path pattern jsonrpclib uses for the same situation (Python 3 defers topyproject.toml, Python 2.7's too-old setuptools gets explicit metadata parsed fromjavaobj/__init__.py).github/scripts/check_version.py,release_notes.py,sbom_artifacts.py(ported from../jsonrpclib, which releases the same way) anddocs/changelog.mdas the single source of truth for release notes.github/workflows/publish.yml: build, SLSA provenance attestation, CycloneDX SBOM, PyPI Trusted Publishing, GitHub release, modeled on../ipopo/../jsonrpclib's workflow. Not exercised for real -- no tag pushed, noworkflow_dispatchrun. The PyPI trusted publisher and thepypi/testpypiGitHub environments still need to be configured before an actual release can go through this workflowLicense ::classifier once a SPDXlicenseexpression is set (fixed), andcheck_version.pycaughtjavaobj/v2/main.pymissing its version docstring entirely (fixed)Test plan
python -m buildunder a Python 3.14 container ->javaobj_py3-0.6.0-py2.py3-none-any.whl;twine check --strictPASSED on both the wheel and sdistpython setup.py install-> real egg (not an empty/UNKNOWN one),javaobj.__version__ == "0.6.0"importing from outside the source treepip installthe exact wheel built under 3.14 -> installs cleanly (selected via thepy2.py3-none-anytag), same version check passes -- the universal-wheel packaging promise is verified end to end, not just asserted by the file namecheck_version.py/check_version.py 0.6.0exit 0;release_notes.py 0.6.0correctly refuses (still Unreleased) and produces correct output tested against a throwaway copy with a real date./run_tests_containers.sh 3.13rerun after the packaging churn -> still 280 passed, 7 skipped