Skip to content

Commit

Permalink
Swap black and isort for ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
jogoodma committed May 21, 2024
1 parent f27d7e5 commit 7cee568
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 117 deletions.
18 changes: 7 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@ repos:
- id: check-toml
- id: check-json
- id: check-added-large-files
- repo: local
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.4
hooks:
- id: black
name: black
entry: poetry run black
language: system
types: [file, python]
- id: isort
name: isort
entry: poetry run isort
language: system
types: [file, python]
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
124 changes: 27 additions & 97 deletions poetry.lock

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

5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ agr-blast-service-configuration = {git = "https://github.com/alliance-genome/agr
typer = "^0.12.3"
biopython = "^1.83"
tqdm = "^4.66.4"

[tool.poetry.group.dev.dependencies]
black = "^24.4.2"
isort = "^5.13.2"
ruff = "^0.4.4"

[build-system]
requires = ["poetry-core"]
Expand Down
2 changes: 1 addition & 1 deletion src/blast_db_configuration/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def generate(
desc="Processing organisms",
unit="organism",
):
logger.debug(f"Processing %s %s", genus, species)
logger.debug("Processing %s %s", genus, species)
if genus == "Drosophila" and species == "melanogaster":
all_dbs.extend(create_dmel_metadata(dmel_annot_release))
else:
Expand Down
1 change: 0 additions & 1 deletion src/blast_db_configuration/db_metadata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
import urllib.request
from typing import Optional

import agr_blast_service_configuration.schemas.metadata as blast_metadata_schema

Expand Down
3 changes: 1 addition & 2 deletions src/blast_db_configuration/ncbi/genomes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import ftplib
import logging
import re
import urllib.error
from pathlib import Path
from functools import cache
from ftplib import FTP
Expand Down Expand Up @@ -56,7 +55,7 @@ def get_current_genome_assembly_files(
:param file_regex: Regular expression to match files (default: None)
:return: Tuple of (genome assembly directory, genome assembly file, md5 checksum file)
"""
if type(organism_group) is str:
if isinstance(organism_group, str):
organism_group = OrganismGroup(organism_group)

path = f"/genomes/refseq/{organism_group}/{genus}_{species.replace(' ', '_')}/latest_assembly_versions"
Expand Down
2 changes: 1 addition & 1 deletion src/blast_db_configuration/ncbi/taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get_taxonomy_id(genus: str, species: str) -> Optional[int]:
:return: NCBI taxonomy ID.
"""
try:
logger.debug(f"Searching for %s %s", genus, species)
logger.debug("Searching for %s %s", genus, species)
handle = Entrez.esearch(db="taxonomy", term=f"{genus} {species}[SCIN]")
record = Entrez.read(handle)
num_results = int(record["Count"])
Expand Down

0 comments on commit 7cee568

Please sign in to comment.