Skip to content

Commit

Permalink
update isort and move options to pyproject.toml (nsidnev#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsidnev authored Oct 1, 2020
1 parent 6b5dcbb commit f3830df
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 82 deletions.
118 changes: 58 additions & 60 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 24 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ loguru = "^0.5.1"

[tool.poetry.dev-dependencies]
black = "^20.8b1"
isort = "^4.3"
isort = "^5.0"
autoflake = "^1.4"
wemake-python-styleguide = "^0.14.1"
wemake-python-styleguide = { git = "https://github.com/wemake-services/wemake-python-styleguide", rev = "a787ee1" }
mypy = "^0.782"
flake8-fixme = "^1.1"
pytest = "^6.0"
Expand All @@ -36,6 +36,28 @@ docker = "^4.3"
httpx = "^0.14.2"
asgi-lifespan = "^1.0.1"

[tool.isort]
profile = "black"
src_paths = ["app", "tests"]
combine_as_imports = true

[tool.pytest.ini_options]
testpaths = "tests"
filterwarnings = "error"
addopts = '''
--strict
--tb=short
--cov=app
--cov=tests
--cov-branch
--cov-report=term-missing
--cov-report=html
--cov-report=xml
--no-cov-on-fail
--cov-fail-under=100
'''
env = ["SECRET_KEY=secret"]

[build-system]
requires = ["poetry>=1.0"]
build-backend = "poetry.masonry.api"
4 changes: 2 additions & 2 deletions scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

isort --recursive --force-single-line-imports app tests
isort --force-single-line-imports app tests
autoflake --recursive --remove-all-unused-imports --remove-unused-variables --in-place app tests
black app tests
isort --recursive app tests
isort app tests
2 changes: 1 addition & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ flake8 app --exclude=app/db/migrations
mypy app

black --check app --diff
isort --recursive --check-only app
isort --check-only app
15 changes: 1 addition & 14 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
[tool:pytest]
testpaths = tests
filterwarnings = error
env =
SECRET_KEY=secret

[coverage:report]
precision = 2
exclude_lines =
Expand Down Expand Up @@ -50,13 +44,6 @@ ignore_missing_imports = True
[mypy-pypika.*]
ignore_missing_imports = True

[isort]
multi_line_output = 3
include_trailing_comma = True
line_length = 88
force_grid_wrap = 0
combine_as_imports = True

[flake8]
format = wemake
max-line-length = 88
Expand Down Expand Up @@ -88,4 +75,4 @@ ignore =
WPS601,
no-accept-encodings = True
nested-classes-whitelist=Config
inline-quotes = "
inline-quotes = double
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from os import environ, getenv

import alembic.config
import docker as libdocker
import pytest
from asgi_lifespan import LifespanManager
from asyncpg.pool import Pool
from fastapi import FastAPI
from httpx import AsyncClient

import docker as libdocker
from app.db.repositories.articles import ArticlesRepository
from app.db.repositories.users import UsersRepository
from app.models.domain.articles import Article
Expand Down
3 changes: 1 addition & 2 deletions tests/testing_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
from functools import wraps
from typing import Any, Callable, Type

import psycopg2

import docker.errors
import psycopg2
from docker import APIClient


Expand Down

0 comments on commit f3830df

Please sign in to comment.