summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2021-12-15 11:19:00 -0500
committerJulian Berman <Julian@GrayVines.com>2021-12-15 11:19:00 -0500
commit5b4d5b7a6446ea8854df66cdf7fff74d03f6d2f6 (patch)
tree57c6cde383dcfdac01df660a8f1d1378e92bd406
parent92d93c1333027d8a19493c431503f3db171efda9 (diff)
downloadjsonschema-5b4d5b7a6446ea8854df66cdf7fff74d03f6d2f6.tar.gz
Remove relative imports
-rw-r--r--jsonschema/_utils.py2
-rw-r--r--jsonschema/protocols.py7
-rw-r--r--setup.cfg1
-rw-r--r--tox.ini3
4 files changed, 7 insertions, 6 deletions
diff --git a/jsonschema/_utils.py b/jsonschema/_utils.py
index 75d099e..1d62545 100644
--- a/jsonschema/_utils.py
+++ b/jsonschema/_utils.py
@@ -7,7 +7,7 @@ import sys
# The files() API was added in Python 3.9.
if sys.version_info >= (3, 9): # pragma: no cover
- import importlib.resources as resources
+ from importlib import resources
else: # pragma: no cover
import importlib_resources as resources
diff --git a/jsonschema/protocols.py b/jsonschema/protocols.py
index 8589afe..2e177b3 100644
--- a/jsonschema/protocols.py
+++ b/jsonschema/protocols.py
@@ -13,10 +13,9 @@ except ImportError:
from typing_extensions import Protocol, runtime_checkable
from jsonschema._format import FormatChecker
-
-from ._types import TypeChecker
-from .exceptions import ValidationError
-from .validators import RefResolver
+from jsonschema._types import TypeChecker
+from jsonschema.exceptions import ValidationError
+from jsonschema.validators import RefResolver
# For code authors working on the validator protocol, these are the three
# use-cases which should be kept in mind:
diff --git a/setup.cfg b/setup.cfg
index c081c64..dacd877 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -62,6 +62,7 @@ console_scripts =
jsonschema = schemas/*.json, schemas/*/*.json
[flake8]
+ban-relative-imports = true
inline-quotes = "
exclude =
jsonschema/__init__.py
diff --git a/tox.ini b/tox.ini
index e2affa4..eea61c6 100644
--- a/tox.ini
+++ b/tox.ini
@@ -81,10 +81,11 @@ commands = {envbindir}/detect-secrets scan {toxinidir}
[testenv:style]
deps =
flake8
+ flake8-broken-line
flake8-bugbear
flake8-commas
flake8-quotes
- flake8-broken-line
+ flake8-tidy-imports
commands =
{envpython} -m flake8 {posargs} {toxinidir}/jsonschema {toxinidir}/docs