Skip to content

Commit c9859dd

Browse files
committed
Merge branch 'master' into feature/refactor
2 parents 3198c54 + 41579a6 commit c9859dd

19 files changed

Lines changed: 382 additions & 392 deletions

.github/workflows/tests.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ jobs:
3232
- name: Generate Hashseed
3333
id: generate
3434
run: |
35-
python -c "from random import randint;
35+
python -c "import os
36+
from random import randint
3637
hashseed = randint(0, 4294967295)
3738
print(f'{hashseed=}')
38-
print(f'::set-output name=hashseed::{hashseed}')"
39+
open(os.environ['GITHUB_OUTPUT'], 'a').write(f'hashseed={hashseed}')"
3940
4041
# Tests job
4142
tests:
@@ -47,13 +48,13 @@ jobs:
4748
strategy:
4849
matrix:
4950
# Match versions specified in tox.ini
50-
python-version: [3.6, 3.8, 3.9, pypy-3.7]
51+
python-version: ['3.8', '3.9', '3.10', 'pypy-3.7']
5152

5253
# Steps represent a sequence of tasks that will be executed as part of the job
5354
steps:
5455
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
5556
- name: Check out code
56-
uses: actions/checkout@v2
57+
uses: actions/checkout@main
5758

5859
- name: Set up Python ${{ matrix.python-version }}
5960
uses: actions/setup-python@main

README.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ dpath-python
22
============
33

44
|PyPI|
5+
|Python Version|
56
|Build Status|
67
|Gitter|
78

@@ -450,12 +451,16 @@ components instead of string globs.
450451
:target: https://pypi.python.org/pypi/dpath/
451452
:alt: PyPI: Latest Version
452453

454+
.. |Python Version| image:: https://img.shields.io/pypi/pyversions/dpath?style=flat
455+
:target: https://pypi.python.org/pypi/dpath/
456+
:alt: Supported Python Version
457+
453458
.. |Build Status| image:: https://github.com/dpath-maintainers/dpath-python/actions/workflows/tests.yml/badge.svg
454-
:target: https://github.com/dpath-maintainers/dpath-python/actions/workflows/tests.yml
459+
:target: https://github.com/dpath-maintainers/dpath-python/actions/workflows/tests.yml
455460

456461
.. |Gitter| image:: https://badges.gitter.im/dpath-python/chat.svg
457-
:target: https://gitter.im/dpath-python/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
458-
:alt: Gitter
462+
:target: https://gitter.im/dpath-python/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
463+
:alt: Gitter
459464

460465
Contributors
461466
============

dpath/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
def deprecated(func):
10-
message =\
10+
message = \
1111
"The dpath.util package is being deprecated. All util functions have been moved to dpath package top level."
1212

1313
def wrapper(*args, **kwargs):

dpath/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "2.0.6"
1+
VERSION = "2.0.8"

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
if __name__ == "__main__":
1414
setup(
1515
name="dpath",
16-
url="https://www.github.com/akesterson/dpath-python",
16+
url="https://github.com/dpath-maintainers/dpath-python",
1717
version=dpath.version.VERSION,
1818
description="Filesystem-like pathing and searching for dictionaries",
1919
long_description=long_description,
@@ -34,7 +34,7 @@
3434
# (Source: https://github.com/hugovk/pypi-tools/blob/master/README.md)
3535
#
3636
# Conclusion: In order to accommodate type hinting support must be limited to Python versions >=3.6.
37-
python_requires=">=3.6",
37+
python_requires=">=3.7",
3838
classifiers=[
3939
'Development Status :: 5 - Production/Stable',
4040
'Environment :: Console',

tests/test_broken_afilter.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ def afilter(x):
2626
]
2727

2828
for (path, value) in dpath.util.search(dict, '/**', yielded=True, afilter=afilter):
29-
assert(path in paths)
30-
assert("view_failure" not in dpath.util.search(dict, '/**', afilter=afilter)['a'])
31-
assert("d" not in dpath.util.search(dict, '/**', afilter=afilter)['a']['b']['c'])
29+
assert path in paths
30+
assert "view_failure" not in dpath.util.search(dict, '/**', afilter=afilter)['a']
31+
assert "d" not in dpath.util.search(dict, '/**', afilter=afilter)['a']['b']['c']
3232

3333
for (path, value) in dpath.util.search(dict, ['**'], yielded=True, afilter=afilter):
34-
assert(path in paths)
35-
assert("view_failure" not in dpath.util.search(dict, ['**'], afilter=afilter)['a'])
36-
assert("d" not in dpath.util.search(dict, ['**'], afilter=afilter)['a']['b']['c'])
34+
assert path in paths
35+
assert "view_failure" not in dpath.util.search(dict, ['**'], afilter=afilter)['a']
36+
assert "d" not in dpath.util.search(dict, ['**'], afilter=afilter)['a']['b']['c']
3737

3838
def filter(x):
3939
sys.stderr.write(str(x))
@@ -54,5 +54,5 @@ def filter(x):
5454

5555
results = [[x[0], x[1]] for x in dpath.util.search(a, 'actions/*', yielded=True)]
5656
results = [[x[0], x[1]] for x in dpath.util.search(a, 'actions/*', afilter=filter, yielded=True)]
57-
assert(len(results) == 1)
58-
assert(results[0][1]['type'] == 'correct')
57+
assert len(results) == 1
58+
assert results[0][1]['type'] == 'correct'

tests/test_path_get.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ def test_path_get_list_of_dicts():
1515
segments = ['a', 'b', 0, 0]
1616

1717
res = dpath.segments.view(tdict, segments)
18-
assert(isinstance(res['a']['b'], list))
19-
assert(len(res['a']['b']) == 1)
20-
assert(res['a']['b'][0][0] == 0)
18+
assert isinstance(res['a']['b'], list)
19+
assert len(res['a']['b']) == 1
20+
assert res['a']['b'][0][0] == 0

tests/test_path_paths.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from nose.tools import raises
1+
from nose2.tools.such import helper
2+
23
import dpath.segments
34
import dpath.exceptions
45
import dpath.options
56

67

7-
@raises(dpath.exceptions.InvalidKeyName)
88
def test_path_paths_empty_key_disallowed():
99
tdict = {
1010
"Empty": {
@@ -14,8 +14,9 @@ def test_path_paths_empty_key_disallowed():
1414
}
1515
}
1616

17-
for x in dpath.segments.walk(tdict):
18-
pass
17+
with helper.assertRaises(dpath.exceptions.InvalidKeyName):
18+
for x in dpath.segments.walk(tdict):
19+
pass
1920

2021

2122
def test_path_paths_empty_key_allowed():
@@ -34,4 +35,4 @@ def test_path_paths_empty_key_allowed():
3435
pass
3536

3637
dpath.options.ALLOW_EMPTY_STRING_KEYS = False
37-
assert("/".join(segments) == "Empty//Key")
38+
assert "/".join(segments) == "Empty//Key"

0 commit comments

Comments
 (0)