Skip to content

Commit

Permalink
Merge branch 'main' into py3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasraabe committed Aug 18, 2024
2 parents 3f5c07f + 49a9a27 commit a03d0fc
Show file tree
Hide file tree
Showing 13 changed files with 180 additions and 21 deletions.
9 changes: 4 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[default.extend-words]
ines = "ines"
thes = "thes" # profiling-tasks.md
18 changes: 18 additions & 0 deletions docs/source/_static/images/book-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/_static/images/books-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions docs/source/_static/images/coding-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions docs/source/_static/images/light-bulb-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 3 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}

Expand Down
4 changes: 2 additions & 2 deletions docs/source/how_to_guides/bp_structure_of_task_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <private function>` 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 <public
function>` (or classes) which provide the functionality. The complexity is hidden inside
Expand Down
85 changes: 85 additions & 0 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion src/_pytask/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
8 changes: 5 additions & 3 deletions src/_pytask/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
)
Expand Down Expand Up @@ -305,7 +305,7 @@ def __repr__(self) -> str:
return f"<Node at {self.path} is {'unknown' if self.is_unknown else 'known'}>"


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.
Expand All @@ -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
)
4 changes: 2 additions & 2 deletions tests/test_skipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a03d0fc

Please sign in to comment.