Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ python-json-patch

`python-json-patch <https://github.com/stefankoegl/python-json-patch>`_
is a Python library for applying JSON patches (`RFC 6902
<http://tools.ietf.org/html/rfc6902>`_). Python 3.10+ is
<https://datatracker.ietf.org/doc/html/rfc6902>`_). Python 3.10+ is
supported. Tests are run on both CPython and PyPy.

**Installation**
Expand All @@ -25,7 +25,7 @@ supported. Tests are run on both CPython and PyPy.
tutorial
mod-jsonpatch
commandline
RFC 6902 <http://tools.ietf.org/html/rfc6902>
RFC 6902 <https://datatracker.ietf.org/doc/html/rfc6902>


Indices and tables
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorial.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Tutorial
========

Please refer to `RFC 6902 <http://tools.ietf.org/html/rfc6902>`_ for the exact
Please refer to `RFC 6902 <https://datatracker.ietf.org/doc/html/rfc6902>`_ for the exact
patch syntax.

Creating a Patch
Expand Down Expand Up @@ -87,7 +87,7 @@ Paths and Special Characters
----------------------------

The ``path`` and ``from`` members of an operation are JSON Pointers
(`RFC 6901 <https://tools.ietf.org/html/rfc6901>`_). A pointer is a sequence of
(`RFC 6901 <https://datatracker.ietf.org/doc/html/rfc6901>`_). 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
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[build-system]
# license_expression in setup.py requires setuptools >= 77
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"
21 changes: 4 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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']
Expand All @@ -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',
Expand All @@ -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']},
Expand All @@ -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,
)
Loading