Repository navigation
Clean up broken, outdated and redundant bits across the project - #114
Merged
Merged
Conversation
Library: - Fix the JsonPointer.path doctest, which assigned instead of asserting - Drop an unreachable assert in walk() (get_part already rejects non-indexable documents) and a redundant "$" in a fullmatch regex - Fix docstring typos CLI: - Parse the pointer once instead of re-parsing it for every file - Replace a dated comment with an explanation Packaging: - Add pyproject.toml declaring the setuptools build backend, so pip/build use an isolated, modern setuptools - Use an SPDX license expression (BSD-3-Clause) instead of the deprecated license classifier, silencing setuptools warnings - Read README.md as UTF-8 relative to setup.py; close the source file - Drop wheel/setuptools from requirements-dev.txt (unused by tests) - makefile: recommend "pip install ." instead of "setup.py install" Docs: - Update the CLI usage text to the current argparse help format - Fix the mod-jsonpointer label, grammar, and "method" vs "function" - Use current URLs for RFC 6901, PyPI and Read the Docs - Make conf.py's sys.path independent of the working directory and replace the texinfo placeholder description CI: - Pin the TestPyPI publish action to the same SHA as the PyPI one - Remove a redundant checkout ref and allow-prereleases for 3.13 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzpjhRBV84QNbKy9H564
The package metadata already declares BSD-3-Clause; make the module attribute agree instead of the informal "Modified BSD License". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzpjhRBV84QNbKy9H564
pairwise() is not used by the library itself, and itertools.pairwise() is available on every supported Python version (3.10+). Keep it as a thin wrapper that emits a DeprecationWarning, and mark it @deprecated in the type stubs so type checkers flag callers too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzpjhRBV84QNbKy9H564
join() turns any failure into JsonPointerException("Invalid suffix").
Raise it "from" the original exception so the underlying cause (e.g. a
TypeError for a non-iterable suffix) shows up in tracebacks and is
available as __cause__.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PewzpjhRBV84QNbKy9H564
Read the Docs recommends pinning documentation dependencies so a new Sphinx release cannot silently change or break the build. Pin to the current release (9.2.0), which builds the docs without warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzpjhRBV84QNbKy9H564
doc/conf.py was the 2013 sphinx-quickstart template, mostly commented-out defaults. Keep only the settings that differ from Sphinx's defaults, and: - use the "classic" theme name instead of its legacy alias "default" (the generated HTML is identical apart from the alias stylesheet) - drop templates_path and html_static_path, which pointed at an empty or missing directory, along with doc/_static/.empty - define the author once and reuse it for the LaTeX, man and Texinfo outputs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzpjhRBV84QNbKy9H564
The source distribution included the .rst sources and tests.py but not doc/conf.py, doc/Makefile or the requirements files, so the docs could not be built from it. Add those plus the makefile and .coveragerc, and drop the explicit README.md include, which setuptools adds automatically. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzpjhRBV84QNbKy9H564
- Test on Python 3.15 (released October 2026) and add its classifier; run the Windows and macOS jobs on 3.15 instead of 3.13 - Test the Python 3.16 pre-release as an allowed-to-fail job - Stop testing PyPy 3.10, which PyPy no longer releases; PyPy 3.11 stays Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzpjhRBV84QNbKy9H564
The v4/v5 releases of the first-party actions run on the deprecated Node 20 runtime. Update to the current majors, which run on Node 24: - actions/checkout v4 -> v7 - actions/setup-python v5 -> v7 - actions/upload-artifact v4 -> v7 - actions/download-artifact v4 -> v8 None of the inputs used here changed. Also move the pinned pypa/gh-action-pypi-publish commit from v1.14.2 to v1.14.3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzpjhRBV84QNbKy9H564
Ctrl-C made jsonpointer exit with 1, the same status as "pointer could not be resolved", so callers could not tell the two apart. Use 130 (128 + SIGINT), the conventional status for an interrupted command, and document it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzpjhRBV84QNbKy9H564
runpy.run_path() returns a copy of the script's globals, so replacing resolve_files in it had no effect on main(). Raise KeyboardInterrupt from json.load() instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzpjhRBV84QNbKy9H564
argparse.FileType is deprecated since Python 3.14. Open the pointer file and the JSON inputs with a small helper instead, which keeps the existing behaviour: - "-" still means standard input, which is never closed - files are read as UTF-8 - a file that cannot be opened is a usage error (exit status 2) with the same "can't open" message The pointer file is now opened after argument parsing rather than during it, so the help output is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzpjhRBV84QNbKy9H564
This was referenced Nov 10, 2026
Stop using the deprecated argparse.FileType in the CLI
Trim the Sphinx configuration to the settings in use
Pin Sphinx for reproducible documentation builds
Use SPDX identifier for __license__
Deprecate pairwise() in favour of itertools.pairwise()
Ship everything needed to test and build docs from the sdist
Update GitHub Actions to current major versions
Update the tested Python versions
Exit with status 130 when the CLI is interrupted
Keep the original error when join() rejects a suffix
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.
Project-wide cleanup. No changes to public API behaviour.
Library (
jsonpointer.py)JsonPointer.pathdoctest assigned a comparison to a variable and asserted nothing; now it actually checks the result.assertinwalk():get_part()already raises for documents without__getitem__. The assert also disappeared underpython -O.$from_RE_ARRAY_INDEX, which is only used withfullmatch.CLI (
bin/jsonpointer)Packaging
pyproject.tomlwith[build-system](setuptools>=77). Without it, pip falls back to the legacy, non-isolated path. In this environment that failed to install with a distro-patched setuptools.License :: OSI Approved :: BSD Licenseclassifier withlicense_expression='BSD-3-Clause', which matchesLICENSE.txt. Wheel metadata now hasLicense-Expression: BSD-3-Clause, and setuptools no longer prints deprecation warnings.setup.pyreadsREADME.mdas UTF-8 and relative to its own location, closes the source file, and no longer usesio.open.requirements-dev.txt: removedwheel/setuptools, which the test job doesn't use.makefile: suggestspip install .instead ofsetup.py install.Docs
-f, --pointer-file POINTER_FILE).mod-jsonpointerlabel: it was missing its_, so it was a comment.resolve_pointer/set_pointerare now called functions, not methods.conf.py:sys.pathno longer depends on the current working directory, and the texinfo placeholder description is replaced with the module docstring..readthedocs.yaml: comment now saysdoc/, notdocs/.CI
ref: ${{ github.ref }}andallow-prereleasesfor 3.13.Verification
Run locally on Python 3.13:
python -m unittest: 96 tests OKflake8: cleansphinx-build -W: cleanpython -m buildandtwine check --strict: pass, no warningsmypy.stubtest jsonpointer: no issuesGenerated by Claude Code