Skip to content

Commit

Permalink
replace flake8, isort, pycodestyle with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
rkingsbury committed Jul 31, 2023
1 parent 1297e9c commit f5f06d9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ jobs:
run: |
pip install pre-commit
pre-commit run
test:
needs: lint
services:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
rev: v0.0.275
hooks:
- id: ruff
args: [--fix, --ignore, "D,E501"]
args: [--fix, --ignore, D]

- repo: https://github.com/psf/black
rev: 23.3.0
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ version_scheme = "no-guess-dev"
line-length = 120

[tool.ruff]
target-version = "py38"
target-version = "py37"
line-length = 120
select = [
"B", # flake8-bugbear
Expand Down Expand Up @@ -61,10 +61,10 @@ ignore = [
"D105", # Missing docstring in magic method
"D205", # 1 blank line required between summary line and description
"D212", # Multi-line docstring summary should start at the first line
"FA100", # Missing `from __future__ import annotations`, but uses `typing.XXX`
"FA100", # Missing `from __future__ import annotations`, but uses `typing.XXX` TODO
"PD011", # pandas-use-of-dot-values
"PD901", # pandas-df-variable-name
"PT011", # `pytest.raises(XXXError)` is too broad, set the `match` parameter...
"PT011", # `pytest.raises(XXXError)` is too broad, set the `match` parameter... TODO
"PERF203", # try-except-in-loop
"PERF401", # manual-list-comprehension (TODO fix these or wait for autofix)
"PLR", # pylint refactor
Expand All @@ -82,6 +82,8 @@ isort.split-on-trailing-comma = false
"tests/*" = ["D"]
"src/maggma/api/*" = ["B008", "B021", "RET505", "RET506"]
"tests/api/*" = ["B017", "B018"]
"src/maggma/cli/*" = ["EXE001"] # triggered by ! at top of file
"src/maggma/api/utils.py" = ["I001"] # to allow unsorted import block

[tool.pytest.ini_options]
addopts = "--color=yes -p no:warnings --import-mode=importlib --durations=30"
Expand Down
5 changes: 1 addition & 4 deletions requirements-testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ pytest-cov==3.0.0
pytest-mock==3.10.0
pytest-xdist==2.5.0
moto==3.1.17
pydocstyle==6.1.1
flake8==4.0.1
mypy==0.971
mypy-extensions==0.4.3
ruff==0.0.280
responses<0.22.0
types-PyYAML==6.0.11
types-setuptools==65.4.0.0
Expand Down
3 changes: 0 additions & 3 deletions src/maggma/api/resource/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# isort: off
from maggma.api.resource.core import Resource
from maggma.api.resource.core import HintScheme
from maggma.api.resource.core import HeaderProcessor

# isort: on

from maggma.api.resource.aggregation import AggregationResource
from maggma.api.resource.post_resource import PostOnlyResource
from maggma.api.resource.read_resource import ReadOnlyResource, attach_query_ops
Expand Down
11 changes: 8 additions & 3 deletions src/maggma/api/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import base64
import inspect
import sys
from typing import Any, Callable, Dict, List, Optional, Type

from typing import (
Any,
Callable,
Dict,
List,
Optional,
Type,
)
from bson.objectid import ObjectId
from monty.json import MSONable
from pydantic import BaseModel
Expand All @@ -15,7 +21,6 @@
else:
from typing_extensions import get_args # pragma: no cover


QUERY_PARAMS = ["criteria", "properties", "skip", "limit"]
STORE_PARAMS = Dict[
Literal[
Expand Down

0 comments on commit f5f06d9

Please sign in to comment.