Skip to content

Commit

Permalink
update config & pre-commit dependencies
Browse files Browse the repository at this point in the history
move isort and mypy config to pyproject.toml
  • Loading branch information
dhimmel committed Nov 1, 2021
1 parent 6c2b154 commit edde267
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 22 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
rev: v4.0.1
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: mixed-line-ending
- id: check-case-conflict
- id: check-yaml
- repo: https://github.com/timothycrosley/isort
rev: 5.6.4
rev: 5.9.3
hooks:
- id: isort
- repo: https://github.com/python/black
rev: 20.8b1
rev: 21.10b0
hooks:
- id: black
language_version: python3
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
rev: 3.9.2
hooks:
- id: flake8
language_version: python3
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.790
rev: v0.910-1
hooks:
- id: mypy
args: ["--strict", "--show-error-codes"]
Expand Down
5 changes: 2 additions & 3 deletions nxontology/tests/ontology_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,7 @@ def test_similarities(ontology: Ontology) -> None:
```
Confirm the changes to ontology_utils_test_metal_sim.tsv are desired before committing.
"""
# type ignored due to https://github.com/python/mypy/issues/6910
nxo = ontology.ctor() # type: ignore [misc]
nxo = ontology.ctor()
nxo.freeze()
tsv = get_similarity_tsv(nxo)
expect_tsv = ontology.sim_path.read_text()
Expand All @@ -290,7 +289,7 @@ def export_similarity_tsvs() -> None:
Regenerate ontology_utils_test_metal_sim.tsv
"""
for ontology in test_ontologies:
nxo = ontology.ctor() # type: ignore [misc]
nxo = ontology.ctor()
tsv = get_similarity_tsv(nxo)
ontology.sim_path.write_text(tsv)

Expand Down
33 changes: 33 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,36 @@ build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
# including this section enables version inference

# https://pycqa.github.io/isort/docs/configuration/config_files.html
[tool.isort]
profile = "black"
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 88

# https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file
[tool.mypy]
python_version = "3.7"

[[tool.mypy.overrides]]
module = [
"*.tests.*",
]
disallow_untyped_defs = false
disallow_untyped_decorators = false

[[tool.mypy.overrides]]
module = [
"fire.*",
"fsspec.*",
"networkx.*",
"setuptools.*",
"pandas.*",
"pytest.*",
"_pytest.*",
"pygraphviz.*",
]
ignore_missing_imports = true
14 changes: 0 additions & 14 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,3 @@ ignore =
E501
E731
W503

[isort]
profile = black
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
use_parentheses = True
line_length = 88

[mypy-fire.*,fsspec.*,networkx.*,setuptools.*,pandas.*,pytest.*,_pytest.*,pygraphviz.*]
ignore_missing_imports = True
[mypy-*.tests.*]
disallow_untyped_defs = False
disallow_untyped_decorators = False

0 comments on commit edde267

Please sign in to comment.