diff options
author | Julian Berman <Julian@GrayVines.com> | 2021-12-15 11:19:00 -0500 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2021-12-15 11:19:00 -0500 |
commit | 5b4d5b7a6446ea8854df66cdf7fff74d03f6d2f6 (patch) | |
tree | 57c6cde383dcfdac01df660a8f1d1378e92bd406 | |
parent | 92d93c1333027d8a19493c431503f3db171efda9 (diff) | |
download | jsonschema-5b4d5b7a6446ea8854df66cdf7fff74d03f6d2f6.tar.gz |
Remove relative imports
-rw-r--r-- | jsonschema/_utils.py | 2 | ||||
-rw-r--r-- | jsonschema/protocols.py | 7 | ||||
-rw-r--r-- | setup.cfg | 1 | ||||
-rw-r--r-- | tox.ini | 3 |
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: @@ -62,6 +62,7 @@ console_scripts = jsonschema = schemas/*.json, schemas/*/*.json [flake8] +ban-relative-imports = true inline-quotes = " exclude = jsonschema/__init__.py @@ -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 |