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/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" diff --git a/setup.py b/setup.py index c759ca8..f78ad1f 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', @@ -65,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']}, @@ -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, )