Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
690cc79
Add mypy.
tobiasraabe Dec 4, 2021
148b8fd
Type path.py.
tobiasraabe Dec 4, 2021
665f2c6
Fix type hints in mark.expression.
tobiasraabe Dec 4, 2021
9194ee7
more types.
tobiasraabe Dec 5, 2021
943e430
Typed some more modules.
tobiasraabe Dec 5, 2021
c868672
typed compat.
tobiasraabe Dec 5, 2021
8383b53
Typed mark.structures.
tobiasraabe Dec 5, 2021
cba78a9
Fix or ignore all typing issues in package code.
tobiasraabe Dec 5, 2021
a998981
fix.
tobiasraabe Dec 5, 2021
9b51936
add comment.
tobiasraabe Dec 5, 2021
9af1b3b
typed dag.py.
tobiasraabe Dec 5, 2021
2e9dc5e
Type database.py.
tobiasraabe Dec 5, 2021
f7002da
type cli.py.
tobiasraabe Dec 5, 2021
fccf49c
Finished typing in parametrize except for task function.
tobiasraabe Dec 7, 2021
8ad6905
Fix parametrize.
tobiasraabe Dec 7, 2021
05d2000
Merge branch 'main' into typing
tobiasraabe Dec 9, 2021
1d922f1
Type shared.py.
tobiasraabe Dec 9, 2021
0a9dd22
Add new pre-commit hook.
tobiasraabe Dec 9, 2021
4bdb7af
Typed profile.py.
tobiasraabe Dec 10, 2021
2fbe593
Type clean.py,
tobiasraabe Dec 10, 2021
ad98743
Type live.py.
tobiasraabe Dec 10, 2021
1f2e420
type logging.py.
tobiasraabe Dec 10, 2021
e822ad4
type graph.py.
tobiasraabe Dec 10, 2021
2b8a11b
typed collect.py.
tobiasraabe Dec 10, 2021
1b9f992
finish.
tobiasraabe Dec 10, 2021
505a23e
fix types.
tobiasraabe Dec 10, 2021
25d661b
partially typed capture.py.
tobiasraabe Dec 11, 2021
de4cf8b
Type debugging.py.
tobiasraabe Dec 12, 2021
9e2b211
Type mark/.
tobiasraabe Dec 12, 2021
e0fc09c
Type nodes.py.
tobiasraabe Dec 12, 2021
08fbb4d
Typed hookspecs.py.
tobiasraabe Dec 12, 2021
2cc36ad
Fix tests.
tobiasraabe Dec 12, 2021
2b52661
Add tmep files for sync.
tobiasraabe Dec 12, 2021
ce8105f
Fix.
tobiasraabe Dec 12, 2021
c1f4358
Use mypy with py 3.9.
tobiasraabe Dec 12, 2021
02191c5
Fix typing issue.
tobiasraabe Dec 12, 2021
fe30ca9
Now satisfy flake8.
tobiasraabe Dec 12, 2021
21eae92
Fix docs.
tobiasraabe Dec 13, 2021
f7e0086
better guard for literal.
tobiasraabe Dec 13, 2021
730acde
remove dep.
tobiasraabe Dec 13, 2021
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
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ repos:
flake8-print,
flake8-pytest-style,
flake8-todo,
flake8-typing-imports,
flake8-unused-arguments,
pep8-naming,
pydocstyle,
Expand Down Expand Up @@ -94,6 +95,21 @@ repos:
hooks:
- id: tryceratops
exclude: (console\.py|test_mark_expression\.py)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.910-1'
hooks:
- id: mypy
args: [
--no-strict-optional,
--ignore-missing-imports,
]
additional_dependencies: [
types-attrs,
types-click,
types-setuptools
]
pass_filenames: false
language_version: "3.9"
- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
1 change: 0 additions & 1 deletion docs/rtd_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
- nbsphinx
- sphinx
- sphinx-autoapi
- sphinx-autodoc-typehints
- sphinx-click
- sphinx-copybutton
- sphinx-panels
Expand Down
1 change: 1 addition & 0 deletions docs/source/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ all releases are available on `PyPI <https://pypi.org/project/pytask>`_ and
------------------

- :gh:`159` removes files for creating a conda package which is handled by conda-forge.
- :gh:`160` adds rudimentary typing to pytask.
- :gh:`161` removes a workaround for pyreadline which is also removed in pytest 7.
- :gh:`163` allow forward slashes in expressions and marker expressions.
- :gh:`164` allows to use backward slashes in expressions and marker expressions.
Expand Down
1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_copybutton",
"sphinx_autodoc_typehints",
"sphinx_click",
"sphinx_panels",
"autoapi.extension",
Expand Down
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ dependencies:
- nbsphinx
- sphinx
- sphinx-autoapi
- sphinx-autodoc-typehints
- sphinx-click
- sphinx-copybutton
- sphinx-panels
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,20 @@ write_to = "src/_pytask/_version.py"

[tool.tryceratops]
ignore = ["TC003"]


[tool.mypy]
files = ["src", "tests"]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true


[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
ignore_errors = true
13 changes: 10 additions & 3 deletions src/_pytask/build.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"""Implement the build command."""
import sys
from typing import Any
from typing import Dict
from typing import TYPE_CHECKING

import click
from _pytask.config import hookimpl
Expand All @@ -13,13 +16,17 @@
from _pytask.session import Session


if TYPE_CHECKING:
from typing import NoReturn


@hookimpl(tryfirst=True)
def pytask_extend_command_line_interface(cli):
def pytask_extend_command_line_interface(cli: click.Group) -> None:
"""Extend the command line interface."""
cli.add_command(build)


def main(config_from_cli):
def main(config_from_cli: Dict[str, Any]) -> Session:
"""Run pytask.

This is the main command to run pytask which usually receives kwargs from the
Expand Down Expand Up @@ -100,7 +107,7 @@ def main(config_from_cli):
default=None,
help="Print errors with tracebacks as soon as the task fails.",
)
def build(**config_from_cli):
def build(**config_from_cli: Any) -> "NoReturn":
"""Collect and execute tasks and report the results.

This is the default command of pytask which searches given paths or the current
Expand Down
Loading