From 40bfae37aa4030801cc7322dbd5e8f1d615d56ed Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Oct 2026 08:14:37 +0000 Subject: [PATCH 1/3] Housekeeping: drop stale references and dead code - Replace dead Travis CI links/badge with GitHub Actions (README, setup.py) - Remove the distutils fallback in setup.py (distutils is gone in 3.12) - Drop the deprecated License classifier; license is set via SPDX expression - MANIFEST.in: include LICENSE instead of the nonexistent COPYING, and ship property_tests.py in the sdist - Bump test workflow to checkout@v7 / setup-python@v7, matching publish.yaml - Update pypi.python.org and tools.ietf.org URLs, fix ext_tests.py typo - makefile: suggest "pip install ." instead of "setup.py install" Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EVf18LoPb4o3BjH8KVBJDd --- .github/workflows/test.yaml | 4 ++-- MANIFEST.in | 3 ++- README.md | 14 +++++++------- doc/index.rst | 4 ++-- doc/tutorial.rst | 4 ++-- makefile | 2 +- setup.py | 19 +++---------------- 7 files changed, 19 insertions(+), 31 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a37c831..dd97bf4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,9 +15,9 @@ jobs: python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/MANIFEST.in b/MANIFEST.in index 2b1cbf0..6b60d7e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,8 @@ include requirements.txt -include COPYING +include LICENSE include README.md include tests.py +include property_tests.py include pytest.ini include ext_tests.py include AUTHORS diff --git a/README.md b/README.md index 3ede220..964b0fa 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,29 @@ python-json-patch ================= -[![PyPI version](https://img.shields.io/pypi/v/jsonpatch.svg)](https://pypi.python.org/pypi/jsonpatch/) -[![Supported Python versions](https://img.shields.io/pypi/pyversions/jsonpatch.svg)](https://pypi.python.org/pypi/jsonpatch/) -[![Build Status](https://travis-ci.org/stefankoegl/python-json-patch.png?branch=master)](https://travis-ci.org/stefankoegl/python-json-patch) +[![PyPI version](https://img.shields.io/pypi/v/jsonpatch.svg)](https://pypi.org/project/jsonpatch//) +[![Supported Python versions](https://img.shields.io/pypi/pyversions/jsonpatch.svg)](https://pypi.org/project/jsonpatch//) +[![Build Status](https://github.com/stefankoegl/python-json-patch/actions/workflows/test.yaml/badge.svg?branch=master)](https://github.com/stefankoegl/python-json-patch/actions/workflows/test.yaml) [![Coverage Status](https://coveralls.io/repos/stefankoegl/python-json-patch/badge.png?branch=master)](https://coveralls.io/r/stefankoegl/python-json-patch?branch=master) Applying JSON Patches in Python ------------------------------- Library to apply JSON Patches according to -[RFC 6902](http://tools.ietf.org/html/rfc6902) +[RFC 6902](https://datatracker.ietf.org/doc/html/rfc6902) See source code for examples * Website: https://github.com/stefankoegl/python-json-patch * Repository: https://github.com/stefankoegl/python-json-patch.git * Documentation: https://python-json-patch.readthedocs.org/ -* PyPI: https://pypi.python.org/pypi/jsonpatch -* Travis CI: https://travis-ci.org/stefankoegl/python-json-patch +* PyPI: https://pypi.org/project/jsonpatch/ +* CI: https://github.com/stefankoegl/python-json-patch/actions * Coveralls: https://coveralls.io/r/stefankoegl/python-json-patch Running external tests ---------------------- -To run external tests (such as those from https://github.com/json-patch/json-patch-tests) use ext_test.py +To run external tests (such as those from https://github.com/json-patch/json-patch-tests) use ext_tests.py ./ext_tests.py ../json-patch-tests/tests.json diff --git a/doc/index.rst b/doc/index.rst index 1c52762..eb5cdec 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -8,7 +8,7 @@ python-json-patch `python-json-patch `_ is a Python library for applying JSON patches (`RFC 6902 -`_). Python 3.10+ is +`_). Python 3.10+ is supported. Tests are run on both CPython and PyPy. **Installation** @@ -25,7 +25,7 @@ supported. Tests are run on both CPython and PyPy. tutorial mod-jsonpatch commandline - RFC 6902 + RFC 6902 Indices and tables diff --git a/doc/tutorial.rst b/doc/tutorial.rst index 52c0637..1e89c7d 100644 --- a/doc/tutorial.rst +++ b/doc/tutorial.rst @@ -1,7 +1,7 @@ Tutorial ======== -Please refer to `RFC 6902 `_ for the exact +Please refer to `RFC 6902 `_ for the exact patch syntax. Creating a Patch @@ -87,7 +87,7 @@ Paths and Special Characters ---------------------------- The ``path`` and ``from`` members of an operation are JSON Pointers -(`RFC 6901 `_). A pointer is a sequence of +(`RFC 6901 `_). A pointer is a sequence of reference tokens, each starting with ``/``, and every token selects one object key or array index. Because ``/`` separates the tokens, a key that contains ``/`` or ``~`` has to be escaped: ``~`` is written as ``~0`` and ``/`` as diff --git a/makefile b/makefile index 73d325a..6b0df44 100644 --- a/makefile +++ b/makefile @@ -6,7 +6,7 @@ help: @echo " - coverage: run tests with coverage" @echo @echo "To install jsonpatch, type" - @echo " python setup.py install" + @echo " pip install ." @echo test: diff --git a/setup.py b/setup.py index c759ca8..d0775d7 100644 --- a/setup.py +++ b/setup.py @@ -2,12 +2,7 @@ # -*- coding: utf-8 -*- import re -try: - from setuptools import setup - has_setuptools = True -except ImportError: - from distutils.core import setup - has_setuptools = False +from setuptools import setup src = open('jsonpatch.py', encoding='utf-8').read() metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", src)) @@ -21,13 +16,6 @@ REQUIREMENTS = list(open('requirements.txt')) -if has_setuptools: - OPTIONS = { - 'install_requires': REQUIREMENTS - } -else: - OPTIONS = {} - AUTHOR_EMAIL = metadata['author'] VERSION = metadata['version'] WEBSITE = metadata['website'] @@ -41,7 +29,6 @@ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', - 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', @@ -77,8 +64,8 @@ 'Repository': 'https://github.com/stefankoegl/python-json-patch.git', 'Documentation': "https://python-json-patch.readthedocs.org/", 'PyPI': 'https://pypi.org/pypi/jsonpatch', - 'Tests': 'https://travis-ci.org/stefankoegl/python-json-patch', + 'Tests': 'https://github.com/stefankoegl/python-json-patch/actions', 'Test Coverage': 'https://coveralls.io/r/stefankoegl/python-json-patch', }, - **OPTIONS + install_requires=REQUIREMENTS, ) From d114f16f83c3fd8085fd231c9bb264004b2666de Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Oct 2026 08:20:41 +0000 Subject: [PATCH 2/3] Set license via license_expression (PEP 639) The previous commit dropped the deprecated license classifier but kept license=, which only emits the legacy License field. license_expression emits License-Expression instead (requires setuptools >= 77). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EVf18LoPb4o3BjH8KVBJDd --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d0775d7..f78ad1f 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ long_description_content_type='text/markdown', author=AUTHOR, author_email=EMAIL, - license=LICENSE, + license_expression=LICENSE, url=WEBSITE, py_modules=MODULES, package_data={'': ['requirements.txt']}, From 4c5aac3ad6030286899173b39d161f2c3844a24c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Oct 2026 08:21:50 +0000 Subject: [PATCH 3/3] Add pyproject.toml declaring the setuptools>=77 build requirement Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EVf18LoPb4o3BjH8KVBJDd --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..95af07e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,4 @@ +[build-system] +# license_expression in setup.py requires setuptools >= 77 +requires = ["setuptools>=77"] +build-backend = "setuptools.build_meta"