Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore using isort to manage imports #31

Merged
merged 7 commits into from Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
@@ -1,2 +1,4 @@
# Commit that added in black formatting support
98ce05a9ebb46033cbbc993ad6b2134c9d9e476f
# Commit that added in isort formatting support
79494e75dc20226d130e27d638108f8d96fd7873
6 changes: 3 additions & 3 deletions octodns_ns1/__init__.py
Expand Up @@ -6,17 +6,17 @@
from collections.abc import Mapping
from itertools import chain
from logging import getLogger
from time import sleep
from uuid import uuid4

from ns1 import NS1
from ns1.rest.errors import RateLimitException, ResourceException
from pycountry_convert import country_alpha2_to_continent_code
from time import sleep
from uuid import uuid4

from octodns.provider import ProviderException
from octodns.provider.base import BaseProvider
from octodns.record import Record, Update


__VERSION__ = '0.0.3'


Expand Down
14 changes: 14 additions & 0 deletions pyproject.toml
@@ -0,0 +1,14 @@
[tool.black]
line-length=80
skip-string-normalization=true
skip-magic-trailing-comma=true

[tool.isort]
profile = "black"
known_first_party="octodns_ns1"
known_octodns="octodns"
line_length=80
sections="FUTURE,STDLIB,THIRDPARTY,OCTODNS,FIRSTPARTY,LOCALFOLDER"

[tool.pytest.ini_options]
pythonpath = "."
1 change: 1 addition & 0 deletions requirements-dev.txt
Expand Up @@ -9,6 +9,7 @@ cmarkgfm==0.8.0
commonmark==0.9.1
docutils==0.19
importlib-metadata==5.0.0
isort==5.11.4
jaraco.classes==3.2.3
keyring==23.9.3
more-itertools==9.0.0
Expand Down
2 changes: 0 additions & 2 deletions script/coverage
Expand Up @@ -22,8 +22,6 @@ grep -r -I --line-number "# pragma: +no.*cover" $SOURCE_DIR && {
exit 1
}

export PYTHONPATH=.:$PYTHONPATH

pytest \
--disable-network \
--cov-reset \
Expand Down
3 changes: 2 additions & 1 deletion script/format
Expand Up @@ -6,4 +6,5 @@ SOURCES=$(find *.py octodns_* tests -name "*.py")

. env/bin/activate

black --line-length=80 --skip-string-normalization --skip-magic-trailing-comma "$@" $SOURCES
isort "$@" $SOURCES
black "$@" $SOURCES
2 changes: 0 additions & 2 deletions script/test
Expand Up @@ -14,6 +14,4 @@ if [ ! -f "$ACTIVATE" ]; then
fi
. "$ACTIVATE"

export PYTHONPATH=.:$PYTHONPATH

pytest --disable-network "$@"
4 changes: 3 additions & 1 deletion setup.py
@@ -1,7 +1,8 @@
from os import environ
from setuptools import find_packages, setup
from subprocess import CalledProcessError, check_output

from setuptools import find_packages, setup


def descriptions():
with open('README.md') as fh:
Expand Down Expand Up @@ -43,6 +44,7 @@ def version():
+ (
'black>=22.3.0',
'build>=0.7.0',
'isort>=5.11.4',
'pyflakes>=2.2.0',
'readme_renderer[md]>=26.0',
'twine>=3.4.2',
Expand Down
3 changes: 2 additions & 1 deletion tests/test_provider_ns1.py
Expand Up @@ -4,10 +4,11 @@

from collections import defaultdict
from logging import getLogger
from ns1.rest.errors import AuthException, RateLimitException, ResourceException
from unittest import TestCase
from unittest.mock import call, patch

from ns1.rest.errors import AuthException, RateLimitException, ResourceException

from octodns.provider.plan import Plan
from octodns.record import Delete, Record, Update
from octodns.zone import Zone
Expand Down