Skip to content

Commit

Permalink
Update config to use ruff isort
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasMarwitzQC committed Nov 6, 2023
1 parent 5c40e29 commit ebe66d4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
html_theme = "alabaster"

__location__ = os.path.join(
os.getcwd(), os.path.dirname(inspect.getfile(inspect.currentframe())) # type: ignore
os.getcwd(),
os.path.dirname(inspect.getfile(inspect.currentframe())), # type: ignore
)


Expand Down
7 changes: 5 additions & 2 deletions minimalkv/_boto.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ def _get_s3bucket(
create_if_missing=True,
):
# TODO: Write docstring.
from boto.s3.connection import S3ResponseError # type: ignore
from boto.s3.connection import OrdinaryCallingFormat, S3Connection
from boto.s3.connection import ( # type: ignore

Check warning on line 10 in minimalkv/_boto.py

View check run for this annotation

Codecov / codecov/patch

minimalkv/_boto.py#L10

Added line #L10 was not covered by tests
OrdinaryCallingFormat,
S3Connection,
S3ResponseError,
)

s3_connection_params = {
"aws_access_key_id": access_key,
Expand Down
18 changes: 8 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@ minimalkv = ["py.typed"]

[tool.ruff]
line-length = 88
target-version = "py310"
target-version = "py38"

[tool.ruff.lint]
ignore = ["E203", "E266", "E501", "C901", "D104", "D100"]
select = ["B", "C", "E", "F", "W", "B9", "D"]
select = ["B", "C", "E", "F", "W", "B9", "D", "I"]

[tool.ruff.lint.isort]
force-wrap-aliases = true
combine-as-imports = true
known-first-party = ["minimalkv"]

[tool.ruff.per-file-ignores]
"tests/*" = ["D101", "D102", "D103", "E402"]
Expand All @@ -53,14 +58,7 @@ convention = "numpy"

[tool.ruff.format]
quote-style = "double"

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
line_length = 88
known_first_party = "minimalkv"
skip_glob = '\.eggs/*,\.git/*,\.venv/*,build/*,dist/*'
default_section = 'THIRDPARTY'
indent-style = "space"

[tool.mypy]
python_version = 3.8
Expand Down
8 changes: 5 additions & 3 deletions tests/test_filesystem_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import tempfile
from io import BytesIO
from unittest.mock import Mock
from urllib.parse import quote as url_quote
from urllib.parse import unquote as url_unquote
from urllib.parse import urlparse
from urllib.parse import (
quote as url_quote,
unquote as url_unquote,
urlparse,
)

import pytest
from basic_store import BasicStore
Expand Down
6 changes: 4 additions & 2 deletions tests/test_get_store_from_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import pytest

from minimalkv._get_store import get_store
from minimalkv._get_store import get_store_from_url as get_store_from_url_new
from minimalkv._get_store import (
get_store,
get_store_from_url as get_store_from_url_new,
)
from minimalkv._hstores import HDictStore
from minimalkv._key_value_store import KeyValueStore
from minimalkv._urls import url2dict
Expand Down

0 comments on commit ebe66d4

Please sign in to comment.