Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin lint tools versions #1429

Open
wants to merge 4 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 88

[*.{json,yml}]
[*.{json,yml,yaml}]
indent_size = 2

[*.{md,rst}]
Expand Down
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 6.0.1
hooks:
- id: isort
name: isort (python)
args: [--check-only, --diff, src/cobra, setup.py, tests]
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
args: [--check, --diff, src/cobra, setup.py, tests]
- repo: https://github.com/pycqa/flake8
rev: 7.1.2
hooks:
- id: flake8
args: [src/cobra, setup.py, tests]
additional_dependencies:
- flake8-docstrings
- flake8-bugbear
2 changes: 1 addition & 1 deletion src/cobra/core/gene.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ def from_symbolic(cls, sympy_gpr: Union[spl.BooleanFunction, Symbol]) -> "GPR":
"""

def _sympy_to_ast(
sympy_expr: Union[spl.BooleanFunction, Symbol]
sympy_expr: Union[spl.BooleanFunction, Symbol],
) -> Union[BoolOp, Name]:
if sympy_expr.func is spl.Or:
return BoolOp(
Expand Down
2 changes: 1 addition & 1 deletion src/cobra/io/dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@


def _fix_type(
value: Union[str, float, bool, Set, Dict]
value: Union[str, float, bool, Set, Dict],
) -> Union[str, float, bool, List, OrderedDict]:
"""Convert possible types to correct Python types.

Expand Down
2 changes: 1 addition & 1 deletion tests/test_core/test_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


def test_solution_contains_only_reaction_specific_values(
solved_model: Tuple[Solution, "Model"]
solved_model: Tuple[Solution, "Model"],
) -> None:
"""Test solution contains specific reaction values."""
solution, model = solved_model
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ commands =
[testenv:isort]
skip_install = True
deps=
isort
isort ==6.0.1
commands=
isort --check-only --diff {toxinidir}/src/cobra {toxinidir}/setup.py {toxinidir}/tests

[testenv:black]
skip_install = True
deps=
black
black ==25.1.0
commands=
black --check --diff {toxinidir}/src/cobra {toxinidir}/setup.py {toxinidir}/tests

[testenv:flake8]
skip_install = True
deps=
flake8
flake8 ==7.1.2
flake8-docstrings
flake8-bugbear
commands=
Expand Down
Loading