Skip to content

Commit

Permalink
style: update ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Jan 3, 2025
1 parent 82b75d3 commit 6f342ed
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: mixed-line-ending
args: [ --fix=lf ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
rev: v0.8.4
hooks:
- id: ruff
- id: ruff-format
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ etl = [
"setuptools", # pinned for 3.12 because yoyo-migrations still uses pkg_resources
]
tests = ["pytest>=6.0", "pytest-cov", "mock", "httpx", "deepdiff"]
dev = ["pre-commit>=3.7.1", "ruff==0.5.0"]
dev = ["pre-commit>=3.7.1", "ruff==0.8.4"]
docs = [
"sphinx==6.1.3",
"sphinx-autodoc-typehints==1.22.0",
Expand Down Expand Up @@ -121,6 +121,8 @@ select = [
"ARG", # https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"PGH", # https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
"PLC", # https://docs.astral.sh/ruff/rules/#convention-c
"PLE", # https://docs.astral.sh/ruff/rules/#error-e_1
"PERF", # https://docs.astral.sh/ruff/rules/#perflint-perf
"FURB", # https://docs.astral.sh/ruff/rules/#refurb-furb
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
Expand All @@ -139,13 +141,13 @@ fixable = [
"PT",
"RSE",
"SIM",
"PLC",
"PLE",
"PERF",
"FURB",
"RUF"
]
# ANN003 - missing-type-kwargs
# ANN101 - missing-type-self
# ANN102 - missing-type-cls
# D203 - one-blank-line-before-class
# D205 - blank-line-after-summary
# D206 - indent-with-spaces*
Expand All @@ -161,7 +163,7 @@ fixable = [
# S321 - suspicious-ftp-lib-usage
# *ignored for compatibility with formatter
ignore = [
"ANN003", "ANN101", "ANN102",
"ANN003",
"D203", "D205", "D206", "D213", "D300", "D400", "D415",
"E111", "E114", "E117", "E501",
"W191",
Expand All @@ -171,7 +173,6 @@ ignore = [
[tool.ruff.lint.per-file-ignores]
# ANN001 - missing-type-function-argument
# ANN2 - missing-return-type
# ANN102 - missing-type-cls
# F401 - unused-import
# N805 - invalid-first-argument-name-for-method
# D100 - undocumented-public-module
Expand All @@ -186,7 +187,6 @@ ignore = [
"tests/*" = [
"ANN001",
"ANN2",
"ANN102",
"D100",
"D102",
"S101",
Expand Down
12 changes: 6 additions & 6 deletions src/gene/database/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,12 +804,12 @@ def load_from_remote(self, url: str | None) -> None:
for chunk in r.iter_content(chunk_size=8192):
if chunk:
h.write(chunk)
tar = tarfile.open(temp_tarfile, "r:gz")
tar_dump_file = next(
f for f in tar.getmembers() if f.name.startswith("gene_norm_")
)
tar.extractall(path=tempdir_path, members=[tar_dump_file]) # noqa: S202
dump_file = tempdir_path / tar_dump_file.name
with tarfile.open(temp_tarfile, "r:gz") as tar:
tar_dump_file = next(
f for f in tar.getmembers() if f.name.startswith("gene_norm_")
)
tar.extractall(path=tempdir_path, members=[tar_dump_file]) # noqa: S202
dump_file = tempdir_path / tar_dump_file.name

self.drop_db()
system_call = f"psql {self.conninfo} -f {dump_file.absolute()}"
Expand Down
4 changes: 2 additions & 2 deletions src/gene/etl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
from .ncbi import NCBI

__all__ = [
"Ensembl",
"HGNC",
"NCBI",
"GeneNormalizerEtlError",
"Ensembl",
"GeneFileVersionError",
"GeneNormalizerEtlError",
"GeneSourceFetchError",
]
4 changes: 2 additions & 2 deletions src/gene/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ def _get_search_response(self, query: str, sources: set[str]) -> dict:

except DatabaseReadException as e:
_logger.error(
"Encountered DatabaseReadException looking up %s %s: ",
"Encountered DatabaseReadException %s looking up %s %s: ",
e,
item_type,
term,
e,
)
continue

Expand Down

0 comments on commit 6f342ed

Please sign in to comment.