diff --git a/.gitignore b/.gitignore index dd03479a..76838a30 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ tests/test_jupyter/*.txt .venv docs/jupyter_execute .DS_Store +docs/source/reference_guides/commands.md diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e906f2ac..3e2fa90b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -53,7 +53,7 @@ repos: mdformat-pyproject>=0.0.2, ] files: (docs/.) - exclude: (docs/source/reference_guides/hookspecs\.md|docs/source/api/.*\.md|docs/source/how_to_guides/capture_warnings\.md|docs/source/how_to_guides/hashing_inputs_of_tasks\.md|docs/source/how_to_guides/provisional_nodes_and_task_generators\.md|docs/source/how_to_guides/remote_files\.md|docs/source/how_to_guides/writing_custom_nodes\.md|docs/source/tutorials/defining_dependencies_products\.md|docs/source/tutorials/using_a_data_catalog\.md) + exclude: (docs/source/reference_guides/hookspecs\.md|docs/source/reference_guides/api/.*\.md|docs/source/how_to_guides/capture_warnings\.md|docs/source/how_to_guides/hashing_inputs_of_tasks\.md|docs/source/how_to_guides/provisional_nodes_and_task_generators\.md|docs/source/how_to_guides/remote_files\.md|docs/source/how_to_guides/writing_custom_nodes\.md|docs/source/tutorials/defining_dependencies_products\.md|docs/source/tutorials/using_a_data_catalog\.md) - repo: https://github.com/kynan/nbstripout rev: 0.9.1 hooks: diff --git a/docs/source/_static/css/custom.css b/docs/source/_static/css/custom.css index 7564f1ae..519593a8 100644 --- a/docs/source/_static/css/custom.css +++ b/docs/source/_static/css/custom.css @@ -127,3 +127,34 @@ body[data-md-color-scheme="slate"] .home-tile p { box-shadow: 0 12px 26px rgba(2, 6, 23, 0.46); } } + +.md-typeset dl.cli-reference { + margin: 0.75rem 0 1.25rem; +} + +.md-typeset dl.cli-reference dt { + margin: 0.85rem 0 0; + font-weight: 500; +} + +.md-typeset dl.cli-reference dd { + margin: 0.2rem 0 0.75rem 1.5rem; +} + +.md-typeset dl.cli-reference dd p { + margin: 0; +} + +.md-typeset dl.cli-reference dd p + p { + margin-top: 0.25rem; + color: var(--md-default-fg-color--light); +} + +.md-typeset dl.cli-reference dt a, +.md-typeset dl.cli-reference dt a:hover, +.md-typeset dl.cli-reference dt a:focus, +.md-typeset dl.cli-reference dt a:visited { + color: inherit; + text-decoration: none; + border-bottom: 0; +} diff --git a/docs/source/commands/build.md b/docs/source/commands/build.md deleted file mode 100644 index 5d5b29f2..00000000 --- a/docs/source/commands/build.md +++ /dev/null @@ -1,39 +0,0 @@ -# build - -Collect tasks, execute them, and report the results. - -## Usage - -```bash -pytask build [OPTIONS] [PATHS] -``` - -`pytask` without a subcommand runs `build` by default. - -## Examples - -```bash -# Run the project in the current directory. -pytask build - -# Select tasks by expression. -pytask build -k random_data - -# Show what would run without executing tasks. -pytask build --dry-run -``` - -## Arguments - ---8<-- "docs/source/_static/md/commands/build-arguments.md" - -## Options - ---8<-- "docs/source/_static/md/commands/build-options.md" - -## Related - -- [Invoking pytask](../tutorials/invoking_pytask.md) -- [Selecting tasks](../tutorials/selecting_tasks.md) -- [Debugging](../tutorials/debugging.md) -- [Configuration](../reference_guides/configuration.md) diff --git a/docs/source/commands/clean.md b/docs/source/commands/clean.md deleted file mode 100644 index 3e7b1038..00000000 --- a/docs/source/commands/clean.md +++ /dev/null @@ -1,35 +0,0 @@ -# clean - -Clean provided paths by removing files unknown to pytask. - -## Usage - -```bash -pytask clean [OPTIONS] [PATHS] -``` - -## Examples - -```bash -# Dry-run cleanup. -pytask clean - -# Remove unknown files immediately. -pytask clean --mode force - -# Exclude a path pattern. -pytask clean --exclude obsolete_folder -``` - -## Arguments - ---8<-- "docs/source/_static/md/commands/clean-arguments.md" - -## Options - ---8<-- "docs/source/_static/md/commands/clean-options.md" - -## Related - -- [Cleaning projects](../tutorials/cleaning_projects.md) -- [Configuration](../reference_guides/configuration.md) diff --git a/docs/source/commands/collect.md b/docs/source/commands/collect.md deleted file mode 100644 index 4793273d..00000000 --- a/docs/source/commands/collect.md +++ /dev/null @@ -1,35 +0,0 @@ -# collect - -Collect tasks and report information about them. - -## Usage - -```bash -pytask collect [OPTIONS] [PATHS] -``` - -## Examples - -```bash -# Show collected tasks. -pytask collect - -# Also show dependencies and products. -pytask collect --nodes - -# Select collected tasks by marker expression. -pytask collect -m "not slow" -``` - -## Arguments - ---8<-- "docs/source/_static/md/commands/collect-arguments.md" - -## Options - ---8<-- "docs/source/_static/md/commands/collect-options.md" - -## Related - -- [Collecting tasks](../tutorials/collecting_tasks.md) -- [Selecting tasks](../tutorials/selecting_tasks.md) diff --git a/docs/source/commands/dag.md b/docs/source/commands/dag.md deleted file mode 100644 index fb962fc6..00000000 --- a/docs/source/commands/dag.md +++ /dev/null @@ -1,34 +0,0 @@ -# dag - -Create a visualization of the directed acyclic graph. - -## Usage - -```bash -pytask dag [OPTIONS] [PATHS] -``` - -## Examples - -```bash -# Create a DAG as PDF. -pytask dag - -# Create a PNG instead. -pytask dag -o dag.png - -# Change the graph layout and direction. -pytask dag --layout dot --rank-direction LR -``` - -## Arguments - ---8<-- "docs/source/_static/md/commands/dag-arguments.md" - -## Options - ---8<-- "docs/source/_static/md/commands/dag-options.md" - -## Related - -- [Visualizing the DAG](../tutorials/visualizing_the_dag.md) diff --git a/docs/source/commands/index.md b/docs/source/commands/index.md deleted file mode 100644 index 2e8bde81..00000000 --- a/docs/source/commands/index.md +++ /dev/null @@ -1,23 +0,0 @@ -# Commands - -pytask exposes a command-based CLI. This section documents each command with usage, -examples, arguments, and all available options. - -## Available commands - ---8<-- "docs/source/_static/md/commands/command-list.md" - -## Global options - -Global options are available on the top-level `pytask` command. - ---8<-- "docs/source/_static/md/commands/root-options.md" - -## Help output - ---8<-- "docs/source/_static/md/help-page.md" - -## Default command behavior - -Running `pytask` without a subcommand is equivalent to running -[`pytask build`](build.md). diff --git a/docs/source/commands/markers.md b/docs/source/commands/markers.md deleted file mode 100644 index dced2555..00000000 --- a/docs/source/commands/markers.md +++ /dev/null @@ -1,32 +0,0 @@ -# markers - -Show all registered markers. - -## Usage - -```bash -pytask markers [OPTIONS] [PATHS] -``` - -## Examples - -```bash -# List all registered markers. -pytask markers - -# Load custom marker definitions from a hooks module. -pytask markers --hook-module hooks.py -``` - -## Arguments - ---8<-- "docs/source/_static/md/commands/markers-arguments.md" - -## Options - ---8<-- "docs/source/_static/md/commands/markers-options.md" - -## Related - -- [Markers](../tutorials/markers.md) -- [Extending pytask](../how_to_guides/extending_pytask.md) diff --git a/docs/source/commands/profile.md b/docs/source/commands/profile.md deleted file mode 100644 index e9a90312..00000000 --- a/docs/source/commands/profile.md +++ /dev/null @@ -1,34 +0,0 @@ -# profile - -Show information about resource consumption. - -## Usage - -```bash -pytask profile [OPTIONS] [PATHS] -``` - -## Examples - -```bash -# Show profiling information from previous successful runs. -pytask profile - -# Export profiling information as JSON. -pytask profile --export json - -# Export profiling information as CSV. -pytask profile --export csv -``` - -## Arguments - ---8<-- "docs/source/_static/md/commands/profile-arguments.md" - -## Options - ---8<-- "docs/source/_static/md/commands/profile-options.md" - -## Related - -- [Profiling tasks](../tutorials/profiling_tasks.md) diff --git a/docs/source/how_to_guides/bp_complex_task_repetitions.md b/docs/source/how_to_guides/bp_complex_task_repetitions.md index 33ceeffd..7b35a80e 100644 --- a/docs/source/how_to_guides/bp_complex_task_repetitions.md +++ b/docs/source/how_to_guides/bp_complex_task_repetitions.md @@ -99,8 +99,8 @@ When you are using the `.name` attributes of the dimensions and multi-dimensiona objects like in the example above, you ensure that the names of dimensions are included in all downstream tasks. -Thus, you can simply call [`pytask -k`](../commands/build.md#options) with the following -expression to execute all tasks related to the logit model. +Thus, you can simply call [`pytask -k`](../reference_guides/commands.md#pytask-build--k) +with the following expression to execute all tasks related to the logit model. ```console pytask -k logit diff --git a/docs/source/how_to_guides/capture_warnings.md b/docs/source/how_to_guides/capture_warnings.md index 4b01d91e..ef455494 100644 --- a/docs/source/how_to_guides/capture_warnings.md +++ b/docs/source/how_to_guides/capture_warnings.md @@ -71,14 +71,14 @@ configured by the `filterwarnings` configuration option. ## Disabling warnings summary Although not recommended, you can use the -[`--disable-warnings`](../commands/build.md#options) command-line option to suppress the +[`--disable-warnings`](../reference_guides/commands.md#pytask-build--disable-warnings) command-line option to suppress the warning summary entirely from the test run output. ## Debugging warnings Sometimes it is not clear which line of code triggered a warning. To find the location, you can turn warnings into exceptions and then use the -[`pytask build --pdb`](../commands/build.md#options) flag to enter the debugger. +[`pytask build --pdb`](../reference_guides/commands.md#pytask-build--pdb) flag to enter the debugger. You can use the configuration to convert warnings to errors by setting diff --git a/docs/source/how_to_guides/extending_pytask.md b/docs/source/how_to_guides/extending_pytask.md index a57cf375..8466e343 100644 --- a/docs/source/how_to_guides/extending_pytask.md +++ b/docs/source/how_to_guides/extending_pytask.md @@ -19,8 +19,9 @@ More general information about pluggy can be found in its There are two ways to add new [hook implementations](../glossary.md#hook-implementation). -1. Using the [`pytask build --hook-module`](../commands/build.md#options) commandline - option or the `hook_module` configuration value. +1. Using the + [`pytask build --hook-module`](../reference_guides/commands.md#pytask-build--hook-module) + commandline option or the `hook_module` configuration value. 1. Packaging your [plugin](../glossary.md#plugin) as a Python package to publish and share it. @@ -55,8 +56,8 @@ hook_module = ["myproject.hooks"] ``` In `hooks.py` we can add another commandline option to -[`pytask build`](../commands/build.md) by providing an additional -[hook implementation](../glossary.md#hook-implementation) for the +[`pytask build`](../reference_guides/commands.md#pytask-build) by providing an +additional [hook implementation](../glossary.md#hook-implementation) for the [hook specification](../glossary.md#hook-specification) `_pytask.hookspecs.pytask_extend_command_line_interface`. diff --git a/docs/source/how_to_guides/how_to_influence_build_order.md b/docs/source/how_to_guides/how_to_influence_build_order.md index 4c0a9806..100b9160 100644 --- a/docs/source/how_to_guides/how_to_influence_build_order.md +++ b/docs/source/how_to_guides/how_to_influence_build_order.md @@ -35,8 +35,8 @@ def task_second(): print("I'm first.") ``` -The execution yields (use [`-s`](../commands/build.md#options) to make the output -visible in the terminal) +The execution yields (use [`-s`](../reference_guides/commands.md#pytask-build--s) to +make the output visible in the terminal) --8<-- "docs/source/_static/md/try-first.md" diff --git a/docs/source/how_to_guides/portability.md b/docs/source/how_to_guides/portability.md index 57e2a846..6ffb23dd 100644 --- a/docs/source/how_to_guides/portability.md +++ b/docs/source/how_to_guides/portability.md @@ -14,8 +14,8 @@ Use this checklist when you move a project to another machine or environment. 1. **Update state once on the source machine.** -Run a normal build with [`pytask build`](../commands/build.md) so `pytask.lock` is up to -date: +Run a normal build with [`pytask build`](../reference_guides/commands.md#pytask-build) +so `pytask.lock` is up to date: ```` ```console @@ -85,7 +85,7 @@ tasks run. If tasks are removed or renamed, their old entries remain as stale da are ignored. To clean up stale entries without deleting the file, run -[`pytask build --clean-lockfile`](../commands/build.md#options): +[`pytask build --clean-lockfile`](../reference_guides/commands.md#pytask-build--clean-lockfile): ```console $ pytask build --clean-lockfile diff --git a/docs/source/index.md b/docs/source/index.md index 0ac50129..e7ebe7ff 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -70,5 +70,3 @@ If you want to know more about pytask, dive into one of the following topics.
API and implementation details for developers and plugin authors.
- -For command-line usage, see the [CLI reference](commands/index.md). diff --git a/docs/source/reference_guides/api.md b/docs/source/reference_guides/api.md deleted file mode 100644 index 5d073086..00000000 --- a/docs/source/reference_guides/api.md +++ /dev/null @@ -1,12 +0,0 @@ -# API Moved - -The API reference now lives in the top-level **API** section: - -- [API overview](../api/index.md) -- [CLI Imports](../api/cli_and_programmatic.md) -- [Functional Interfaces](../api/functional_interfaces.md) -- [Core Classes and Exceptions](../api/core_classes_and_exceptions.md) -- [Marks](../api/marks.md) -- [Nodes and Tasks](../api/nodes_and_tasks.md) -- [Outcomes, Reports, and Warnings](../api/outcomes_reports_and_warnings.md) -- [Utilities and Typing](../api/utilities_and_typing.md) diff --git a/docs/source/api/cli_and_programmatic.md b/docs/source/reference_guides/api/cli_and_programmatic.md similarity index 86% rename from docs/source/api/cli_and_programmatic.md rename to docs/source/reference_guides/api/cli_and_programmatic.md index b78f9b79..77e18a68 100644 --- a/docs/source/api/cli_and_programmatic.md +++ b/docs/source/reference_guides/api/cli_and_programmatic.md @@ -2,7 +2,8 @@ This page documents the public CLI-related imports from `pytask`. -For command usage and options, see the [CLI reference](../commands/index.md). +For command usage and options, see the +[command reference](../commands.md). ## Command Line Entry Point diff --git a/docs/source/api/core_classes_and_exceptions.md b/docs/source/reference_guides/api/core_classes_and_exceptions.md similarity index 100% rename from docs/source/api/core_classes_and_exceptions.md rename to docs/source/reference_guides/api/core_classes_and_exceptions.md diff --git a/docs/source/api/functional_interfaces.md b/docs/source/reference_guides/api/functional_interfaces.md similarity index 100% rename from docs/source/api/functional_interfaces.md rename to docs/source/reference_guides/api/functional_interfaces.md diff --git a/docs/source/api/index.md b/docs/source/reference_guides/api/index.md similarity index 100% rename from docs/source/api/index.md rename to docs/source/reference_guides/api/index.md diff --git a/docs/source/api/marks.md b/docs/source/reference_guides/api/marks.md similarity index 100% rename from docs/source/api/marks.md rename to docs/source/reference_guides/api/marks.md diff --git a/docs/source/api/nodes_and_tasks.md b/docs/source/reference_guides/api/nodes_and_tasks.md similarity index 100% rename from docs/source/api/nodes_and_tasks.md rename to docs/source/reference_guides/api/nodes_and_tasks.md diff --git a/docs/source/api/outcomes_reports_and_warnings.md b/docs/source/reference_guides/api/outcomes_reports_and_warnings.md similarity index 100% rename from docs/source/api/outcomes_reports_and_warnings.md rename to docs/source/reference_guides/api/outcomes_reports_and_warnings.md diff --git a/docs/source/api/utilities_and_typing.md b/docs/source/reference_guides/api/utilities_and_typing.md similarity index 100% rename from docs/source/api/utilities_and_typing.md rename to docs/source/reference_guides/api/utilities_and_typing.md diff --git a/docs/source/reference_guides/configuration.md b/docs/source/reference_guides/configuration.md index 5cdc6f0f..df2552e0 100644 --- a/docs/source/reference_guides/configuration.md +++ b/docs/source/reference_guides/configuration.md @@ -44,7 +44,7 @@ check_casing_of_paths = false SQLite is the legacy state format. pytask uses `pytask.lock` as the primary state backend for change detection. When no lockfile exists, pytask reads the configured database and writes `pytask.lock`. For downgrade compatibility, -[`pytask build`](../commands/build.md) also keeps the legacy database state updated. +[`pytask build`](commands.md#pytask-build) also keeps the legacy database state updated. The `database_url` option remains for backward compatibility and controls the legacy database location and dialect @@ -114,7 +114,7 @@ pytask can ignore files and directories and exclude some tasks or reduce the dur the collection. To ignore some file/folder via the command line, use the -[`--ignore`](../commands/build.md#options) flag multiple times. +[`--ignore`](commands.md#pytask-build--ignore) flag multiple times. ```console $ pytask --ignore some_file.py --ignore some_directory/* @@ -133,7 +133,7 @@ ignore = ["some_directory/*", "some_file.py"] ### `markers` pytask uses markers to attach additional information to task functions. To see which -markers are available, use the [`pytask markers`](../commands/markers.md) command. +markers are available, use the [`pytask markers`](commands.md#pytask-markers) command. ```console $ pytask markers @@ -201,7 +201,7 @@ pdbcls = "pdbp:Pdb" ``` The custom debugger will be used when you invoke the -[`--pdb`](../commands/build.md#options) flag for post-mortem debugging or when using +[`--pdb`](commands.md#pytask-build--pdb) flag for post-mortem debugging or when using `breakpoint()` in your task code. ### `show_errors_immediately` diff --git a/docs/source/developers_guide.md b/docs/source/reference_guides/developers_guide.md similarity index 100% rename from docs/source/developers_guide.md rename to docs/source/reference_guides/developers_guide.md diff --git a/docs/source/glossary.md b/docs/source/reference_guides/glossary.md similarity index 100% rename from docs/source/glossary.md rename to docs/source/reference_guides/glossary.md diff --git a/docs/source/reference_guides/index.md b/docs/source/reference_guides/index.md index 5f52e080..1bf1c578 100644 --- a/docs/source/reference_guides/index.md +++ b/docs/source/reference_guides/index.md @@ -3,10 +3,11 @@ Reference guides are articles which can be read alongside the code and provide additional details on the inner workings of pytask. +- [API](api/index.md) +- [Commands](commands.md) - [Configuration](configuration.md) -- [Lockfile](lockfile.md) - [Hookspecs](hookspecs.md) -- [Type Hints](../type_hints.md) -- [Developer's Guide](../developers_guide.md) -- [Glossary](../glossary.md) -- [API](../api/index.md) +- [Lockfile](lockfile.md) +- [Type Hints](type_hints.md) +- [Developer's Guide](developers_guide.md) +- [Glossary](glossary.md) diff --git a/docs/source/reference_guides/lockfile.md b/docs/source/reference_guides/lockfile.md index 15b29c39..ea4ac1bc 100644 --- a/docs/source/reference_guides/lockfile.md +++ b/docs/source/reference_guides/lockfile.md @@ -38,8 +38,8 @@ On each run, pytask: 1. Skips tasks whose states match; runs the rest. 1. Updates `pytask.lock` after each completed task (atomic write). 1. Updates `pytask.lock` after skipping unchanged tasks (unless - [`--dry-run`](../commands/build.md#options) or - [`--explain`](../commands/build.md#options) are active). + [`--dry-run`](commands.md#pytask-build--dry-run) or + [`--explain`](commands.md#pytask-build--explain) are active). ## Portability @@ -51,8 +51,8 @@ There are two portability concerns: ## Maintenance -Use [`pytask build --clean-lockfile`](../commands/build.md#options) to rewrite -`pytask.lock` with only currently collected tasks. The rewrite happens after a +Use [`pytask build --clean-lockfile`](commands.md#pytask-build--clean-lockfile) to +rewrite `pytask.lock` with only currently collected tasks. The rewrite happens after a successful build and recomputes current state values without executing tasks again. ## File Format Reference diff --git a/docs/source/type_hints.md b/docs/source/reference_guides/type_hints.md similarity index 100% rename from docs/source/type_hints.md rename to docs/source/reference_guides/type_hints.md diff --git a/docs/source/tutorials/capturing_output.md b/docs/source/tutorials/capturing_output.md index 575c79d0..ea11799a 100644 --- a/docs/source/tutorials/capturing_output.md +++ b/docs/source/tutorials/capturing_output.md @@ -44,7 +44,8 @@ There are three ways in which `pytask` can perform capturing: `sys.stderr`. You can influence output-capturing mechanisms from the command line with -[`-s`](../commands/build.md#options) and [`--capture`](../commands/build.md#options): +[`-s`](../reference_guides/commands.md#pytask-build--s) and +[`--capture`](../reference_guides/commands.md#pytask-build--capture): ```console $ pytask -s # disable all capturing diff --git a/docs/source/tutorials/cleaning_projects.md b/docs/source/tutorials/cleaning_projects.md index 7e7520f4..1d314ed6 100644 --- a/docs/source/tutorials/cleaning_projects.md +++ b/docs/source/tutorials/cleaning_projects.md @@ -2,20 +2,22 @@ Projects usually become cluttered with obsolete files after some time. -To clean the project, type [`pytask clean`](../commands/clean.md). +To clean the project, type +[`pytask clean`](../reference_guides/commands.md#pytask-clean). --8<-- "docs/source/_static/md/clean-dry-run.md" pytask performs a dry-run by default and lists all removable files. If you want to remove the files, use -[`pytask clean --mode`](../commands/clean.md#options) with one of the following modes. +[`pytask clean --mode`](../reference_guides/commands.md#pytask-clean--mode) with one of +the following modes. - `force` removes all files suggested in the `dry-run` without any confirmation. - `interactive` allows you to decide for every file whether to keep it or not. If you want to delete complete folders instead of single files, use -[`pytask clean --directories`](../commands/clean.md#options). +[`pytask clean --directories`](../reference_guides/commands.md#pytask-clean--directories). --8<-- "docs/source/_static/md/clean-dry-run-directories.md" @@ -23,8 +25,9 @@ If you want to delete complete folders instead of single files, use pytask excludes files that are under version control with git. -Use the [`pytask clean --exclude`](../commands/clean.md#options) option or the `exclude` -key in the configuration file to exclude files and directories. +Use the +[`pytask clean --exclude`](../reference_guides/commands.md#pytask-clean--exclude) option +or the `exclude` key in the configuration file to exclude files and directories. Values can be Unix filename patterns that, for example, support the wildcard character `*` for any characters. You find the documentation in `fnmatch`. @@ -44,4 +47,4 @@ exclude = ["obsolete_folder"] ## Further reading -- [command reference for `pytask clean`](../commands/clean.md). +- [command reference for `pytask clean`](../reference_guides/commands.md#pytask-clean). diff --git a/docs/source/tutorials/collecting_tasks.md b/docs/source/tutorials/collecting_tasks.md index 6144fc79..ca3acb39 100644 --- a/docs/source/tutorials/collecting_tasks.md +++ b/docs/source/tutorials/collecting_tasks.md @@ -1,7 +1,7 @@ # Collecting tasks If you want to inspect your project and see a summary of all the tasks, you can use the -[`pytask collect`](../commands/collect.md) command. +[`pytask collect`](../reference_guides/commands.md#pytask-collect) command. Let us take the following task. @@ -9,13 +9,14 @@ Let us take the following task. --8<-- "docs_src/tutorials/collecting_tasks.py" ``` -Now, running [`pytask collect`](../commands/collect.md) will produce the following -output. +Now, running [`pytask collect`](../reference_guides/commands.md#pytask-collect) will +produce the following output. --8<-- "docs/source/_static/md/collect.md" If you want to have more information regarding the dependencies and products of the -task, append the [`pytask collect --nodes`](../commands/collect.md#options) flag. +task, append the +[`pytask collect --nodes`](../reference_guides/commands.md#pytask-collect--nodes) flag. --8<-- "docs/source/_static/md/collect-nodes.md" @@ -24,6 +25,7 @@ patterns as usual. ## Further reading -- Read the [command reference for `pytask collect`](../commands/collect.md). +- Read the + [command reference for `pytask collect`](../reference_guides/commands.md#pytask-collect). - Read the tutorial on [selecting tasks](selecting_tasks.md). - Paths can be ignored with [`ignore`](../reference_guides/configuration.md#ignore). diff --git a/docs/source/tutorials/configuration.md b/docs/source/tutorials/configuration.md index 99de7719..8078809d 100644 --- a/docs/source/tutorials/configuration.md +++ b/docs/source/tutorials/configuration.md @@ -37,7 +37,7 @@ The first option is to let pytask try to find the configuration itself. configuration file with the correct section. Secondly, it is possible to pass the location of the configuration file via -[`pytask build -c`](../commands/build.md#options) like +[`pytask build -c`](../reference_guides/commands.md#pytask-build--config) like ```console $ pytask -c config/pyproject.toml diff --git a/docs/source/tutorials/debugging.md b/docs/source/tutorials/debugging.md index 64e4756d..e33317d5 100644 --- a/docs/source/tutorials/debugging.md +++ b/docs/source/tutorials/debugging.md @@ -5,9 +5,9 @@ help you to gain more information on the root cause. ## Post-mortem debugger -Using [`pytask build --pdb`](../commands/build.md#options) enables the post-mortem -debugger. Whenever an exception is raised inside a task, the prompt will enter the -debugger enabling you to find out the cause of the exception. +Using [`pytask build --pdb`](../reference_guides/commands.md#pytask-build--pdb) enables +the post-mortem debugger. Whenever an exception is raised inside a task, the prompt will +enter the debugger enabling you to find out the cause of the exception. --8<-- "docs/source/_static/md/pdb.md" @@ -19,28 +19,30 @@ debugger enabling you to find out the cause of the exception. !!! note A following tutorial explains [how to select a subset of tasks](selecting_tasks.md). - Combine it with the [`pytask build --pdb`](../commands/build.md#options) flag to debug + Combine it with the + [`pytask build --pdb`](../reference_guides/commands.md#pytask-build--pdb) flag to debug specific tasks. ## Tracing If you want to enter the debugger at the start of every task, use -[`pytask build --trace`](../commands/build.md#options). +[`pytask build --trace`](../reference_guides/commands.md#pytask-build--trace). --8<-- "docs/source/_static/md/trace.md" ## Tracebacks You can enrich the display of tracebacks by showing local variables in each stack frame. -Just execute [`pytask build --show-locals`](../commands/build.md#options). +Just execute +[`pytask build --show-locals`](../reference_guides/commands.md#pytask-build--show-locals). --8<-- "docs/source/_static/md/show-locals.md" ## Custom debugger If you want to use your custom debugger, make sure it is importable and use -[`pytask build --pdbcls`](../commands/build.md#options). Here, we change the standard -`pdb` debugger to IPython's implementation. +[`pytask build --pdbcls`](../reference_guides/commands.md#pytask-build--pdbcls). Here, +we change the standard `pdb` debugger to IPython's implementation. ```console $ pytask --pdbcls=IPython.terminal.debugger:TerminalPdb diff --git a/docs/source/tutorials/invoking_pytask.md b/docs/source/tutorials/invoking_pytask.md index c0a06c40..1834773c 100644 --- a/docs/source/tutorials/invoking_pytask.md +++ b/docs/source/tutorials/invoking_pytask.md @@ -35,9 +35,9 @@ $ pytask{escaped}"
-
-
-def _format_default(option: click.Option) -> str:
- default = option.default
- result = "-"
-
- if isinstance(default, bool):
- if option.secondary_opts:
- active = option.opts[0] if default else option.secondary_opts[0]
- result = active
- else:
- result = str(default).lower()
- elif default is None or (isinstance(default, tuple | list) and not default):
- result = "-"
- elif isinstance(default, enum.Enum):
- if str(default.value).startswith("