Skip to content

Commit

Permalink
DEV: resolve ruff issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcar17 committed Jul 5, 2024
1 parent 6773e8a commit 53e25db
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
14 changes: 12 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ piqtree_random_trees = "piqtree2._app:piqtree_random_trees"
version = {attr = "piqtree2.__version__"}

[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
"iqtree2",
".bzr",
".direnv",
".eggs",
Expand Down Expand Up @@ -89,7 +89,7 @@ target-version = "py39"
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["ALL"]
ignore = ["EXE002"]
ignore = ["EXE002", "FA100", "E501", "D"]

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
Expand All @@ -102,6 +102,16 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
"tests/**/*.py" = [
"S101", # asserts allowed in tests...
"INP001", # __init__.py files are not required...
"ANN",
"N802",
"N803"
]
"noxfile.py" = [
"S101", # asserts allowed in tests...
"INP001", # __init__.py files are not required...
"ANN",
"N802",
"N803"
]

[tool.ruff.format]
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ def DATA_DIR():
return pathlib.Path(__file__).parent / "data"


@pytest.fixture(scope="function")
@pytest.fixture()
def tmp_dir(tmp_path_factory):
return tmp_path_factory.mktemp("cli")
2 changes: 1 addition & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from cogent3 import get_app, load_aligned_seqs, make_tree


@pytest.fixture
@pytest.fixture()
def three_otu(DATA_DIR):
aln = load_aligned_seqs(DATA_DIR / "example.fasta", moltype="dna")
aln = aln.take_seqs(["Human", "Rhesus", "Mouse"])
Expand Down
2 changes: 1 addition & 1 deletion tests/test_fit_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from cogent3 import get_app, load_aligned_seqs, make_tree


@pytest.fixture
@pytest.fixture()
def three_otu(DATA_DIR):
aln = load_aligned_seqs(DATA_DIR / "example.fasta", moltype="dna")
aln = aln.take_seqs(["Human", "Rhesus", "Mouse"])
Expand Down
3 changes: 1 addition & 2 deletions tests/test_options.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# testing the display of functions
import pytest

from piqtree2 import available_models


@pytest.mark.parametrize("model_type", (None, "nucleotide", "protein"))
@pytest.mark.parametrize("model_type", [(None, "nucleotide", "protein")])
def test_available_models(model_type):
table = available_models(model_type)
assert table.shape[0] > 0

0 comments on commit 53e25db

Please sign in to comment.