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
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
with:
ref: ${{ github.ref }}

- name: Set up Python 3.12
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: 3.13
allow-prereleases: true
- name: Install dependencies
run: |
Expand All @@ -39,7 +39,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.10", "3.11", "3.12", "3.13" ]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: "3.13"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
3 changes: 1 addition & 2 deletions bin/jsonpointer
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#!/usr/bin/env python3


import argparse
Expand Down
18 changes: 9 additions & 9 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# python-json-pointer documentation build configuration file, created by
# sphinx-quickstart on Sat Apr 13 16:52:59 2013.
Expand All @@ -11,7 +10,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import os
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -42,7 +42,7 @@
master_doc = 'index'

# General information about the project.
project = u'python-json-pointer'
project = 'python-json-pointer'
copyright = jsonpointer.__author__

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -186,8 +186,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'python-json-pointer.tex', u'python-json-pointer Documentation',
u'Stefan Kögl', 'manual'),
('index', 'python-json-pointer.tex', 'python-json-pointer Documentation',
'Stefan Kögl', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -216,8 +216,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'python-json-pointer', u'python-json-pointer Documentation',
[u'Stefan Kögl'], 1)
('index', 'python-json-pointer', 'python-json-pointer Documentation',
['Stefan Kögl'], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -230,8 +230,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'python-json-pointer', u'python-json-pointer Documentation',
u'Stefan Kögl', 'python-json-pointer', 'One line description of project.',
('index', 'python-json-pointer', 'python-json-pointer Documentation',
'Stefan Kögl', 'python-json-pointer', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ python-json-pointer
===================

*python-json-pointer* is a Python library for resolving JSON pointers (`RFC
6901 <http://tools.ietf.org/html/rfc6901>`_). Python 3.9+
6901 <http://tools.ietf.org/html/rfc6901>`_). Python 3.10+
and PyPy are supported.

**Contents**
Expand Down
8 changes: 3 additions & 5 deletions jsonpointer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
#
# python-json-pointer - An implementation of the JSON Pointer syntax
# https://github.com/stefankoegl/python-json-pointer
#
Expand Down Expand Up @@ -136,7 +134,7 @@ class JsonPointerException(Exception):
pass


class EndOfList(object):
class EndOfList:
"""Result of accessing element "-" of a list"""

def __init__(self, list_):
Expand All @@ -147,7 +145,7 @@ def __repr__(self):
lst=repr(self.list_))


class JsonPointer(object):
class JsonPointer:
"""A JSON Pointer that can reference parts of a JSON document"""

# Array indices must not contain:
Expand Down Expand Up @@ -294,7 +292,7 @@ def join(self, suffix):
except: # noqa E722
raise JsonPointerException("Invalid suffix")

def __truediv__(self, suffix): # Python 3
def __truediv__(self, suffix):
return self.join(suffix)

@property
Expand Down
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ help:
@echo " - coverage: run tests with coverage"
@echo
@echo "To install jsonpointer, type"
@echo " python setup.py install"
@echo " python3 setup.py install"
@echo

test:
python -munittest
python3 -munittest

coverage:
coverage run --source=jsonpointer tests.py
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[bdist_wheel]
universal = 1

[flake8]
max-line-length = 120
exclude = .git,.tox,dist,doc,*egg,build,.venv
31 changes: 16 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,28 @@
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries',
'Topic :: Utilities',
]

setup(name=PACKAGE,
version=VERSION,
description=DESCRIPTION,
long_description=long_description,
long_description_content_type="text/markdown",
author=AUTHOR,
author_email=EMAIL,
license=LICENSE,
url=WEBSITE,
py_modules=MODULES,
scripts=['bin/jsonpointer'],
classifiers=CLASSIFIERS,
python_requires='>=3.9',
)
setup(
name=PACKAGE,
version=VERSION,
description=DESCRIPTION,
long_description=long_description,
long_description_content_type="text/markdown",
author=AUTHOR,
author_email=EMAIL,
license=LICENSE,
url=WEBSITE,
py_modules=MODULES,
scripts=['bin/jsonpointer'],
classifiers=CLASSIFIERS,
python_requires='>=3.10',
)
5 changes: 2 additions & 3 deletions tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import copy
import doctest
Expand Down Expand Up @@ -370,7 +369,7 @@ def test_mock_dict_sanity(self):
'/root/1/2': '3',
}

for path, expected_value in iter(path_to_expected_value.items()):
for path, expected_value in path_to_expected_value.items():
self.assertEqual(resolve_pointer(doc, path, default), expected_value)

def test_mock_dict_returns_default(self):
Expand All @@ -382,7 +381,7 @@ def test_mock_dict_returns_default(self):
'/x/y/z/d': default
}

for path, expected_value in iter(path_to_expected_value.items()):
for path, expected_value in path_to_expected_value.items():
self.assertEqual(resolve_pointer(doc, path, default), expected_value)

def test_mock_dict_raises_key_error(self):
Expand Down
Loading