Skip to content
Merged
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
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,13 @@ repos:
name: mypy
entry: mypy
args: [--config-file=pyproject.toml, --pretty]
language: python
language: system
types: [python]
require_serial: true
pass_filenames: true
pass_filenames: false
exclude: >-
(?x)^(
.github/.*|
docs/.*|
tests/.*|
src/.*
tests/.*
)$
82 changes: 81 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ docs = [
"sphinx-autobuild",
"click~=8.1.0"
]
pre-commit = ["pre-commit~=4.3"]
pre-commit = [
"mypy~=2.1.0",
"pre-commit~=4.3",
# stub versions track the runtime package version (typeshed convention)
"types-PyYAML~=6.0",
"types-tabulate~=0.9.0"
]
tests = [
'pgtest~=1.3',
"pytest~=7.0",
Expand All @@ -143,6 +149,80 @@ Source = "https://github.com/aiidateam/aiida-workgraph"
[tool.flit.sdist]
exclude = ["docs/", "tests/"]

[tool.mypy]
enable_error_code = [
'deprecated', # use of an @deprecated-marked function, method or class
'exhaustive-match', # 'match' statement that does not cover all cases
'ignore-without-code', # bare '# type: ignore' without an [error-code]
'mutable-override', # unsound covariant override of a mutable attribute
'possibly-undefined', # variable possibly used before it is assigned
'redundant-expr', # expression whose value is statically known
'redundant-self', # redundant explicit 'Self' annotation on first argument
'truthy-bool', # non-bool object always truthy in a boolean context
'truthy-iterable', # Iterable always truthy in a boolean context (e.g. generator)
'unimported-reveal', # 'reveal_type' used without importing it
'unused-awaitable' # awaitable value that is never awaited
]
files = ['src/aiida_workgraph']
python_version = "3.10"
show_error_codes = true
strict = true
warn_unreachable = true

# Third-party dependencies that ship no type information (no py.typed / stubs).
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
'aiida_pythonjob',
'aiida_pythonjob.*',
'kiwipy',
'kiwipy.*',
'node_graph',
'node_graph.*'
]

# Modules not yet annotated for strict type checking
# Update this list as typing enforced throughout the code base
[[tool.mypy.overrides]]
ignore_errors = true
module = [
'aiida_workgraph.cli.cmd_task',
'aiida_workgraph.cli.cmd_workgraph',
'aiida_workgraph.config',
'aiida_workgraph.decorator',
'aiida_workgraph.engine.awaitable_manager',
'aiida_workgraph.engine.context_manager',
'aiida_workgraph.engine.error_handler_manager',
'aiida_workgraph.engine.task_actions',
'aiida_workgraph.engine.task_manager',
'aiida_workgraph.engine.task_state',
'aiida_workgraph.engine.workgraph',
'aiida_workgraph.executors.builtins',
'aiida_workgraph.executors.test',
'aiida_workgraph.manager',
'aiida_workgraph.orm.utils',
'aiida_workgraph.orm.workgraph',
'aiida_workgraph.properties.builtins',
'aiida_workgraph.property',
'aiida_workgraph.serialization',
'aiida_workgraph.socket',
'aiida_workgraph.socket_spec',
'aiida_workgraph.task',
'aiida_workgraph.tasks.aiida',
'aiida_workgraph.tasks.builtins',
'aiida_workgraph.tasks.function_task',
'aiida_workgraph.tasks.graph_task',
'aiida_workgraph.tasks.monitors',
'aiida_workgraph.tasks.pythonjob_tasks',
'aiida_workgraph.tasks.shelljob_task',
'aiida_workgraph.tasks.subgraph_task',
'aiida_workgraph.tasks.tests',
'aiida_workgraph.utils',
'aiida_workgraph.utils.control',
'aiida_workgraph.utils.logging',
'aiida_workgraph.workgraph'
]

[tool.ruff]
line-length = 120

Expand Down
Loading
Loading