Skip to content

Commit 5b4d5b7

Browse files
committed
Remove relative imports
1 parent 92d93c1 commit 5b4d5b7

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

jsonschema/_utils.py

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

88
# The files() API was added in Python 3.9.
99
if sys.version_info >= (3, 9): # pragma: no cover
10-
import importlib.resources as resources
10+
from importlib import resources
1111
else: # pragma: no cover
1212
import importlib_resources as resources
1313

jsonschema/protocols.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
from typing_extensions import Protocol, runtime_checkable
1414

1515
from jsonschema._format import FormatChecker
16-
17-
from ._types import TypeChecker
18-
from .exceptions import ValidationError
19-
from .validators import RefResolver
16+
from jsonschema._types import TypeChecker
17+
from jsonschema.exceptions import ValidationError
18+
from jsonschema.validators import RefResolver
2019

2120
# For code authors working on the validator protocol, these are the three
2221
# use-cases which should be kept in mind:

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ console_scripts =
6262
jsonschema = schemas/*.json, schemas/*/*.json
6363

6464
[flake8]
65+
ban-relative-imports = true
6566
inline-quotes = "
6667
exclude =
6768
jsonschema/__init__.py

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,11 @@ commands = {envbindir}/detect-secrets scan {toxinidir}
8181
[testenv:style]
8282
deps =
8383
flake8
84+
flake8-broken-line
8485
flake8-bugbear
8586
flake8-commas
8687
flake8-quotes
87-
flake8-broken-line
88+
flake8-tidy-imports
8889
commands =
8990
{envpython} -m flake8 {posargs} {toxinidir}/jsonschema {toxinidir}/docs
9091

0 commit comments

Comments
 (0)