Skip to content

Commit

Permalink
Switch to isort for ordering imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Jun 26, 2021
1 parent 0855552 commit 2723a6a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 10 deletions.
6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ repos:
hooks:
- id: black

- repo: https://github.com/PyCQA/isort
rev: 5.9.1
hooks:
- id: isort

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-builtins
- flake8-import-order-jwodder
- flake8-unused-arguments
exclude: ^test/data
2 changes: 1 addition & 1 deletion test/deprecated/test_parse_project_page.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from os.path import dirname, join
import pytest
from pypi_simple import DistributionPackage, PYPI_SIMPLE_ENDPOINT, parse_project_page
from pypi_simple import PYPI_SIMPLE_ENDPOINT, DistributionPackage, parse_project_page

DATA_DIR = join(dirname(__file__), os.pardir, "data")

Expand Down
2 changes: 1 addition & 1 deletion test/test_parse_links_stream.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from io import StringIO
import pytest
from pypi_simple import (
Link,
SUPPORTED_REPOSITORY_VERSION,
Link,
UnsupportedRepoVersionError,
parse_links_stream,
)
Expand Down
2 changes: 1 addition & 1 deletion test/test_parse_repo_index_page.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from pathlib import Path
import pytest
from pypi_simple import (
IndexPage,
SUPPORTED_REPOSITORY_VERSION,
IndexPage,
UnsupportedRepoVersionError,
parse_repo_index_page,
)
Expand Down
2 changes: 1 addition & 1 deletion test/test_parse_repo_links.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from pypi_simple import (
Link,
SUPPORTED_REPOSITORY_VERSION,
Link,
UnsupportedRepoVersionError,
parse_repo_links,
)
Expand Down
4 changes: 2 additions & 2 deletions test/test_parse_repo_project_page.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from pathlib import Path
import pytest
from pypi_simple import (
DistributionPackage,
PYPI_SIMPLE_ENDPOINT,
ProjectPage,
SUPPORTED_REPOSITORY_VERSION,
DistributionPackage,
ProjectPage,
UnsupportedRepoVersionError,
parse_repo_project_page,
)
Expand Down
13 changes: 10 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ deps =
flake8~=3.7
flake8-bugbear
flake8-builtins~=1.4
flake8-import-order-jwodder
flake8-unused-arguments
commands =
flake8 --config=tox.ini src test
Expand Down Expand Up @@ -49,11 +48,9 @@ precision = 2
show_missing = True

[flake8]
application-import-names = pypi_simple
doctests = True
exclude = .*/,build/,dist/,venv/
hang-closing = False
import-order-style = jwodder
max-doc-length = 80
max-line-length = 80
select = C,B,B902,B950,E,E242,F,I,U100,W
Expand All @@ -63,6 +60,16 @@ per-file-ignores =
src/pypi_simple/__init__.py:E402
test/*.py:B950

[isort]
atomic = True
force_sort_within_sections = True
honor_noqa = True
lines_between_sections = 0
profile = black
reverse_relative = True
sort_relative_in_force_sorted_sections = True
src_paths = src

[testenv:docs]
basepython = python3
deps = -rdocs/requirements.txt
Expand Down

0 comments on commit 2723a6a

Please sign in to comment.