diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5a4e6bce..ec86d5d8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: hooks: - id: sort-all - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.2 + rev: v0.5.7 hooks: - id: ruff-format - id: ruff @@ -62,11 +62,10 @@ repos: hooks: - id: nbstripout exclude: (docs) -- repo: https://github.com/codespell-project/codespell - rev: v2.3.0 +- repo: https://github.com/crate-ci/typos + rev: v1.23.6 hooks: - - id: codespell - additional_dependencies: [tomli] + - id: typos exclude: (\.ipynb) - repo: meta hooks: diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 00000000..f21c76f8 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,3 @@ +[default.extend-words] +ines = "ines" +thes = "thes" # profiling-tasks.md diff --git a/docs/source/_static/images/book-light.svg b/docs/source/_static/images/book-light.svg new file mode 100644 index 00000000..6315fadb --- /dev/null +++ b/docs/source/_static/images/book-light.svg @@ -0,0 +1,18 @@ + + + + + + + + + diff --git a/docs/source/_static/images/books-light.svg b/docs/source/_static/images/books-light.svg new file mode 100644 index 00000000..c3d02e81 --- /dev/null +++ b/docs/source/_static/images/books-light.svg @@ -0,0 +1 @@ + diff --git a/docs/source/_static/images/coding-light.svg b/docs/source/_static/images/coding-light.svg new file mode 100644 index 00000000..9a395f00 --- /dev/null +++ b/docs/source/_static/images/coding-light.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + diff --git a/docs/source/_static/images/light-bulb-light.svg b/docs/source/_static/images/light-bulb-light.svg new file mode 100644 index 00000000..aa4936f7 --- /dev/null +++ b/docs/source/_static/images/light-bulb-light.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + diff --git a/docs/source/conf.py b/docs/source/conf.py index efe99979..33088775 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -82,14 +82,12 @@ } intersphinx_mapping = { - "click": ("https://click.palletsprojects.com/en/8.0.x/", None), - "deepdiff": ("https://zepworks.com/deepdiff/current/", None), + "click": ("https://click.palletsprojects.com/en/8.0.x", None), + "deepdiff": ("https://zepworks.com/deepdiff/current", None), "networkx": ("https://networkx.org/documentation/stable", None), - "nx": ("https://networkx.org/documentation/stable", None), "pandas": ("https://pandas.pydata.org/docs", None), - "pd": ("https://pandas.pydata.org/docs", None), "pluggy": ("https://pluggy.readthedocs.io/en/latest", None), - "pygraphviz": ("https://pygraphviz.github.io/documentation/stable/", None), + "pygraphviz": ("https://pygraphviz.github.io/documentation/stable", None), "python": ("https://docs.python.org/3.10", None), } diff --git a/docs/source/how_to_guides/bp_structure_of_task_files.md b/docs/source/how_to_guides/bp_structure_of_task_files.md index 84e16789..90c32231 100644 --- a/docs/source/how_to_guides/bp_structure_of_task_files.md +++ b/docs/source/how_to_guides/bp_structure_of_task_files.md @@ -81,13 +81,13 @@ The body of the task function should contain two things: The rest of the module is made of {term}`private functions ` with a leading underscore which are used to accomplish this and only this task. -Here is an example of a task module which conforms to all advices. +Here is an example of a task module which conforms to all advice. ```{literalinclude} ../../../docs_src/how_to_guides/bp_structure_of_task_files.py ``` ```{seealso} -The structure of the task module is greatly inspired by John Ousterhout's "A Philosopy +The structure of the task module is greatly inspired by John Ousterhout's "A Philosophy of Software Design" in which he coins the name "deep modules". In short, deep modules have simple interfaces which are defined by one or a few {term}`public functions ` (or classes) which provide the functionality. The complexity is hidden inside diff --git a/docs/source/index.md b/docs/source/index.md index 62cf34dc..b53d3581 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -57,6 +57,27 @@ gutter: 3 :text-align: center :img-top: _static/images/light-bulb.svg :class-img-top: index-card-image +:class-item: only-light +:shadow: md + +```{button-link} tutorials/index.html +--- +click-parent: +ref-type: ref +class: stretched-link index-card-link +--- +Tutorials +``` + +Tutorials help you to get started with pytask and how you manage your first project. + +```` + +````{grid-item-card} +:text-align: center +:img-top: _static/images/light-bulb-light.svg +:class-img-top: index-card-image +:class-item: only-dark :shadow: md ```{button-link} tutorials/index.html @@ -76,6 +97,28 @@ Tutorials help you to get started with pytask and how you manage your first proj :text-align: center :img-top: _static/images/book.svg :class-img-top: index-card-image +:class-item: only-light +:shadow: md + +```{button-link} how_to_guides/index.html +--- +click-parent: +ref-type: ref +class: stretched-link index-card-link +--- +How-to Guides +``` + +How-to guides provide instructions for very specific and advanced tasks and document +best-practices. + +```` + +````{grid-item-card} +:text-align: center +:img-top: _static/images/book-light.svg +:class-img-top: index-card-image +:class-item: only-dark :shadow: md ```{button-link} how_to_guides/index.html @@ -96,6 +139,27 @@ best-practices. :text-align: center :img-top: _static/images/books.svg :class-img-top: index-card-image +:class-item: only-light +:shadow: md + +```{button-link} explanations/index.html +--- +click-parent: +ref-type: ref +class: stretched-link index-card-link +--- +Explanations +``` + +Explanations deal with key topics and concepts which underlie the package. + +```` + +````{grid-item-card} +:text-align: center +:img-top: _static/images/books-light.svg +:class-img-top: index-card-image +:class-item: only-dark :shadow: md ```{button-link} explanations/index.html @@ -115,6 +179,27 @@ Explanations deal with key topics and concepts which underlie the package. :text-align: center :img-top: _static/images/coding.svg :class-img-top: index-card-image +:class-item: only-light +:shadow: md + +```{button-link} reference_guides/index.html +--- +click-parent: +ref-type: ref +class: stretched-link index-card-link +--- +Reference Guides +``` + +Reference guides explain the implementation and provide an entry-point for developers. + +```` + +````{grid-item-card} +:text-align: center +:img-top: _static/images/coding-light.svg +:class-img-top: index-card-image +:class-item: only-dark :shadow: md ```{button-link} reference_guides/index.html diff --git a/pyproject.toml b/pyproject.toml index 025f574c..b961c2e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -205,9 +205,6 @@ disable_error_code = ["import-not-found"] module = ["_pytask.hookspecs"] disable_error_code = ["empty-body"] -[tool.codespell] -skip = "*.js,*/termynal.css" - [tool.refurb] python_version = "3.8" diff --git a/src/_pytask/capture.py b/src/_pytask/capture.py index 9e0f1244..ca42da0e 100644 --- a/src/_pytask/capture.py +++ b/src/_pytask/capture.py @@ -491,7 +491,7 @@ def start(self) -> None: def done(self) -> None: """Stop capturing. - Stop capturing, restore streams, return original capture file, seeked to + Stop capturing, restore streams, return original capture file, sought to position zero. """ diff --git a/src/_pytask/clean.py b/src/_pytask/clean.py index a4980f3e..3e372549 100644 --- a/src/_pytask/clean.py +++ b/src/_pytask/clean.py @@ -236,7 +236,7 @@ def _find_all_unknown_paths( return list( itertools.chain.from_iterable( [ - _find_all_unkown_paths_per_recursive_node(node, include_directories) + _find_all_unknown_paths_per_recursive_node(node, include_directories) for node in recursive_nodes ] ) @@ -305,7 +305,7 @@ def __repr__(self) -> str: return f"" -def _find_all_unkown_paths_per_recursive_node( +def _find_all_unknown_paths_per_recursive_node( node: _RecursivePathNode, include_directories: bool ) -> Generator[Path, None, None]: """Return unknown paths per recursive file node. @@ -318,4 +318,6 @@ def _find_all_unkown_paths_per_recursive_node( yield node.path else: for n in node.sub_nodes: - yield from _find_all_unkown_paths_per_recursive_node(n, include_directories) + yield from _find_all_unknown_paths_per_recursive_node( + n, include_directories + ) diff --git a/tests/test_skipping.py b/tests/test_skipping.py index 81e20c69..07e21759 100644 --- a/tests/test_skipping.py +++ b/tests/test_skipping.py @@ -261,7 +261,7 @@ def test_pytask_execute_task_setup(marker_name, force, expectation): @pytest.mark.end_to_end() -def test_skip_has_precendence_over_ancestor_failed(runner, tmp_path): +def test_skip_has_precedence_over_ancestor_failed(runner, tmp_path): source = """ from pathlib import Path @@ -278,7 +278,7 @@ def task_example_2(path=Path("file.txt")): ... @pytest.mark.end_to_end() -def test_skipif_has_precendence_over_ancestor_failed(runner, tmp_path): +def test_skipif_has_precedence_over_ancestor_failed(runner, tmp_path): source = """ from pathlib import Path import pytask