Skip to content

Commit 5f89969

Browse files
authored
Merge pull request #73 from stefankoegl/update-python
Update to latest Python versions
2 parents 9087321 + c76bac9 commit 5f89969

File tree

10 files changed

+38
-44
lines changed

10 files changed

+38
-44
lines changed

.github/workflows/test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
with:
2020
ref: ${{ github.ref }}
2121

22-
- name: Set up Python 3.12
22+
- name: Set up Python 3.13
2323
uses: actions/setup-python@v5
2424
with:
25-
python-version: 3.12
25+
python-version: 3.13
2626
allow-prereleases: true
2727
- name: Install dependencies
2828
run: |
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
42+
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
4343

4444
steps:
4545
- uses: actions/checkout@v4

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ version: 2
99
build:
1010
os: ubuntu-22.04
1111
tools:
12-
python: "3.11"
12+
python: "3.13"
1313

1414
# Build documentation in the docs/ directory with Sphinx
1515
sphinx:

bin/jsonpointer

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#!/usr/bin/env python
2-
# -*- coding: utf-8 -*-
1+
#!/usr/bin/env python3
32

43

54
import argparse

doc/conf.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# python-json-pointer documentation build configuration file, created by
43
# sphinx-quickstart on Sat Apr 13 16:52:59 2013.
@@ -11,7 +10,8 @@
1110
# All configuration values have a default; values that are commented out
1211
# serve to show the default.
1312

14-
import sys, os
13+
import os
14+
import sys
1515

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

4444
# General information about the project.
45-
project = u'python-json-pointer'
45+
project = 'python-json-pointer'
4646
copyright = jsonpointer.__author__
4747

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

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

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

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ python-json-pointer
77
===================
88

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

1313
**Contents**

jsonpointer.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
#
31
# python-json-pointer - An implementation of the JSON Pointer syntax
42
# https://github.com/stefankoegl/python-json-pointer
53
#
@@ -136,7 +134,7 @@ class JsonPointerException(Exception):
136134
pass
137135

138136

139-
class EndOfList(object):
137+
class EndOfList:
140138
"""Result of accessing element "-" of a list"""
141139

142140
def __init__(self, list_):
@@ -147,7 +145,7 @@ def __repr__(self):
147145
lst=repr(self.list_))
148146

149147

150-
class JsonPointer(object):
148+
class JsonPointer:
151149
"""A JSON Pointer that can reference parts of a JSON document"""
152150

153151
# Array indices must not contain:
@@ -294,7 +292,7 @@ def join(self, suffix):
294292
except: # noqa E722
295293
raise JsonPointerException("Invalid suffix")
296294

297-
def __truediv__(self, suffix): # Python 3
295+
def __truediv__(self, suffix):
298296
return self.join(suffix)
299297

300298
@property

makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ help:
66
@echo " - coverage: run tests with coverage"
77
@echo
88
@echo "To install jsonpointer, type"
9-
@echo " python setup.py install"
9+
@echo " python3 setup.py install"
1010
@echo
1111

1212
test:
13-
python -munittest
13+
python3 -munittest
1414

1515
coverage:
1616
coverage run --source=jsonpointer tests.py

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[bdist_wheel]
2-
universal = 1
3-
41
[flake8]
52
max-line-length = 120
63
exclude = .git,.tox,dist,doc,*egg,build,.venv

setup.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,28 @@
3838
'Operating System :: OS Independent',
3939
'Programming Language :: Python',
4040
'Programming Language :: Python :: 3',
41-
'Programming Language :: Python :: 3.9',
4241
'Programming Language :: Python :: 3.10',
4342
'Programming Language :: Python :: 3.11',
4443
'Programming Language :: Python :: 3.12',
44+
'Programming Language :: Python :: 3.13',
4545
'Programming Language :: Python :: Implementation :: CPython',
4646
'Programming Language :: Python :: Implementation :: PyPy',
4747
'Topic :: Software Development :: Libraries',
4848
'Topic :: Utilities',
4949
]
5050

51-
setup(name=PACKAGE,
52-
version=VERSION,
53-
description=DESCRIPTION,
54-
long_description=long_description,
55-
long_description_content_type="text/markdown",
56-
author=AUTHOR,
57-
author_email=EMAIL,
58-
license=LICENSE,
59-
url=WEBSITE,
60-
py_modules=MODULES,
61-
scripts=['bin/jsonpointer'],
62-
classifiers=CLASSIFIERS,
63-
python_requires='>=3.9',
64-
)
51+
setup(
52+
name=PACKAGE,
53+
version=VERSION,
54+
description=DESCRIPTION,
55+
long_description=long_description,
56+
long_description_content_type="text/markdown",
57+
author=AUTHOR,
58+
author_email=EMAIL,
59+
license=LICENSE,
60+
url=WEBSITE,
61+
py_modules=MODULES,
62+
scripts=['bin/jsonpointer'],
63+
classifiers=CLASSIFIERS,
64+
python_requires='>=3.10',
65+
)

tests.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python
2-
# -*- coding: utf-8 -*-
32

43
import copy
54
import doctest
@@ -370,7 +369,7 @@ def test_mock_dict_sanity(self):
370369
'/root/1/2': '3',
371370
}
372371

373-
for path, expected_value in iter(path_to_expected_value.items()):
372+
for path, expected_value in path_to_expected_value.items():
374373
self.assertEqual(resolve_pointer(doc, path, default), expected_value)
375374

376375
def test_mock_dict_returns_default(self):
@@ -382,7 +381,7 @@ def test_mock_dict_returns_default(self):
382381
'/x/y/z/d': default
383382
}
384383

385-
for path, expected_value in iter(path_to_expected_value.items()):
384+
for path, expected_value in path_to_expected_value.items():
386385
self.assertEqual(resolve_pointer(doc, path, default), expected_value)
387386

388387
def test_mock_dict_raises_key_error(self):

0 commit comments

Comments
 (0)