Skip to content

Commit

Permalink
docs: fix a round of broken link anchors (pantsbuild#21363)
Browse files Browse the repository at this point in the history
The end of the Docusourus build, has a lot of output along the lines of:

```
- Broken anchor on source page path = /stable/docs/using-pants/using-pants-in-ci:
   -> linking to /stable/reference/global-options#section-process-execution-local-parallelism
   -> linking to /stable/reference/global-options#section-rule-threads-core
   -> linking to /stable/reference/global-options#section-rule-threads-max
   -> linking to /stable/reference/global-options#section-pantsd
   -> linking to /stable/reference/global-options#section-pantsd-max-memory-usage
```
Most (but not all) were from having a `#section` prefix.
  • Loading branch information
cburroughs authored Aug 29, 2024
1 parent 97a6b2f commit 83810e2
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion docs/docs/docker/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ ARG VAR3=default

### Target build stage

When your `Dockerfile` is a multi-stage build file, you may specify which stage to build with the [`--docker-build-target-stage`](../../reference/subsystems/docker.mdx#section-build-target-stage) for all images, or provide a per image setting with the `docker_image` field [`target_stage`](../../reference/targets/docker_image.mdx#target_stage).
When your `Dockerfile` is a multi-stage build file, you may specify which stage to build with the [`--docker-build-target-stage`](../../reference/subsystems/docker.mdx#build_target_stage) for all images, or provide a per image setting with the `docker_image` field [`target_stage`](../../reference/targets/docker_image.mdx#target_stage).

```dockerfile
FROM python:3.8 AS base
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/getting-started/incremental-adoption.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ We would love to help you with adopting Pants. Please reach out through [Slack](

### 1. A basic `pants.toml`

Follow the [Getting Started](./index.mdx) guide to install Pants and [set up an initial `pants.toml`](./initial-configuration.mdx). Validate that running `pants count-loc ::` works properly. If you want to exclude a specific folder at first, you can use the [`pants_ignore`](../../reference/global-options.mdx#section-pants-ignore) option.
Follow the [Getting Started](./index.mdx) guide to install Pants and [set up an initial `pants.toml`](./initial-configuration.mdx). Validate that running `pants count-loc ::` works properly. If you want to exclude a specific folder at first, you can use the [`pants_ignore`](../../reference/global-options.mdx#pants_ignore) option.

Add the [relevant backends](../using-pants/key-concepts/backends.mdx) to `[GLOBAL].backend_packages`.

Expand Down Expand Up @@ -91,7 +91,7 @@ If you're migrating from another system that already uses the name `BUILD`, such

First, by default Pants recognizes `BUILD.extension` for any `extension` as a valid BUILD file. So you can use a name like `BUILD.pants` without changing configuration.

Second, you can [configure](../../reference/global-options.mdx#section-build-patterns) Pants to use a different set of file names entirely:
Second, you can [configure](../../reference/global-options.mdx#build_patterns) Pants to use a different set of file names entirely:

```toml title="pants.toml"
[GLOBAL]
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/jvm/java-and-scala.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ Pants `2.11.x` adds support for choosing JDK and Scala versions per target in yo

#### JDK

JDKs used by Pants are automatically fetched using [Coursier](https://get-coursier.io/), and are chosen using the [`[jvm].jdk` setting](../../reference/subsystems/jvm.mdx#section-jdk) to set a repository-wide default.
JDKs used by Pants are automatically fetched using [Coursier](https://get-coursier.io/), and are chosen using the [`[jvm].jdk` setting](../../reference/subsystems/jvm.mdx#jdk) to set a repository-wide default.

To override the default on a particular target, you can use the [`jdk=` field](../../reference/targets/java_source.mdx#jdk). It can be useful to use the [`parametrize` builtin](../using-pants/key-concepts/targets-and-build-files.mdx#parametrizing-targets) with the `jdk=` field, particularly to run test targets under multiple JDKs.

#### Scala version

The Scala version to use is configured on a resolve-by-resolve basis (see the "Third-party dependencies" section below) using the [`[scala].version_for_resolve` option](../../reference/subsystems/scala.mdx#section-version_for_resolve). The default Scala version for your repository will thus be whichever Scala version is configured for the "default" resolve, which is configured by the [`[jvm].default_resolve` option](../../reference/subsystems/jvm#default_resolve).
The Scala version to use is configured on a resolve-by-resolve basis (see the "Third-party dependencies" section below) using the [`[scala].version_for_resolve` option](../../reference/subsystems/scala.mdx#version_for_resolve). The default Scala version for your repository will thus be whichever Scala version is configured for the "default" resolve, which is configured by the [`[jvm].default_resolve` option](../../reference/subsystems/jvm#default_resolve).

To use multiple Scala versions in a repository, you would define multiple resolves, and then adjust the [`resolve` field](../../reference/targets/scalatest_test.mdx#resolve) of any targets which should be used with the non-`default_resolve` resolve.

Expand Down Expand Up @@ -109,7 +109,7 @@ scala_artifact(

Pants will use the right artifact for the Scala version corresponding for the resolve specified (or the default one).

Pants requires use of a lockfile for thirdparty dependencies. After adding or editing `jvm_artifact` targets, you will need to update affected lockfiles by running `pants generate-lockfiles`. The default lockfile is located at `3rdparty/jvm/default.lock`, but it can be relocated (as well as additional resolves declared) via the [`[jvm].resolves` option](../../reference/subsystems/jvm.mdx#section-resolves).
Pants requires use of a lockfile for thirdparty dependencies. After adding or editing `jvm_artifact` targets, you will need to update affected lockfiles by running `pants generate-lockfiles`. The default lockfile is located at `3rdparty/jvm/default.lock`, but it can be relocated (as well as additional resolves declared) via the [`[jvm].resolves` option](../../reference/subsystems/jvm.mdx#resolves).

:::note Thirdparty symbols and the `packages` argument
To efficiently determine which symbols are provided by thirdparty code (i.e., without hitting the network in order to compute dependencies in the common case), Pants relies on a static mapping of which artifacts provide which symbols, and defaults to treating each `jvm_artifact` as providing symbols within its `group`.
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/jvm/kotlin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ Pants supports choosing the JDK and Kotlin versions per target in your repositor

#### JDK

JDKs used by Pants are automatically fetched using [Coursier](https://get-coursier.io/), and are chosen using the [`[jvm].jdk` option](../../reference/subsystems/jvm.mdx#section-jdk) to set a repository-wide default.
JDKs used by Pants are automatically fetched using [Coursier](https://get-coursier.io/), and are chosen using the [`[jvm].jdk` option](../../reference/subsystems/jvm.mdx#jdk) to set a repository-wide default.

To override the default on a particular target, you can use the [`jdk=` field](../../reference/targets/kotlin_source.mdx#jdk). It can be useful to use the [`parametrize` builtin](../using-pants/key-concepts/targets-and-build-files.mdx#parametrizing-targets) with the `jdk=` field, particularly to run test targets under multiple JDKs.

#### Kotlin version

The Kotlin version to use is configured on a resolve-by-resolve basis (see the "Third-party dependencies" section below) using the [`[kotlin].version_for_resolve` option](../../reference/subsystems/kotlin.mdx#section-version_for_resolve). The default Kotlin version for your repository will thus be whichever Kotlin version is configured for the "default" resolve, which is configured by the [`[jvm].default_resolve` option](../../reference/subsystems/jvm#default_resolve).
The Kotlin version to use is configured on a resolve-by-resolve basis (see the "Third-party dependencies" section below) using the [`[kotlin].version_for_resolve` option](../../reference/subsystems/kotlin.mdx#version_for_resolve). The default Kotlin version for your repository will thus be whichever Kotlin version is configured for the "default" resolve, which is configured by the [`[jvm].default_resolve` option](../../reference/subsystems/jvm#default_resolve).

Each resolve must contain the following jars for the Kotlin runtime with the version matching the version specified for the resolve in the `[kotlin].version_for_resolve` option:

Expand Down Expand Up @@ -110,7 +110,7 @@ jvm_artifact(
)
```

Pants requires use of a lockfile for third-party dependencies. After adding or editing `jvm_artifact` targets, you will need to update affected lockfiles by running `pants generate-lockfiles`. The default lockfile is located at `3rdparty/jvm/default.lock`, but it can be relocated (as well as additional resolves declared) via the [`[jvm].resolves` option](../../reference/subsystems/jvm.mdx#section-resolves).
Pants requires use of a lockfile for third-party dependencies. After adding or editing `jvm_artifact` targets, you will need to update affected lockfiles by running `pants generate-lockfiles`. The default lockfile is located at `3rdparty/jvm/default.lock`, but it can be relocated (as well as additional resolves declared) via the [`[jvm].resolves` option](../../reference/subsystems/jvm.mdx#resolves).

:::note Thirdparty symbols and the `packages` argument
To efficiently determine which symbols are provided by third-party code (i.e., without hitting the network in order to compute dependencies in the common case), Pants relies on a static mapping of which artifacts provide which symbols, and defaults to treating each `jvm_artifact` as providing symbols within its `group`.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/python/goals/check.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ When you run `pants check ::`, Pants will skip any files belonging to skipped ta
:::caution MyPy may still try to check the skipped files!
The `skip_mypy` field only tells Pants not to provide the skipped files as direct input to MyPy. But MyPy, by default, will still try to check files that are [dependencies of the direct inputs](https://mypy.readthedocs.io/en/stable/running_mypy.html#following-imports). So if your skipped files are dependencies of unskipped files, they may still be checked.

To change this behavior, use MyPy's [`--follow-imports` option](https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-follow-imports), typically by setting it to `silent`. You can do so either by adding it to the [`args` option](../../../reference/subsystems/mypy.mdx#section-args) in the `[mypy]` section of your Pants config file, or by setting it in [`mypy.ini`](https://mypy.readthedocs.io/en/stable/config_file.html).
To change this behavior, use MyPy's [`--follow-imports` option](https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-follow-imports), typically by setting it to `silent`. You can do so either by adding it to the [`args` option](../../../reference/subsystems/mypy.mdx#args) in the `[mypy]` section of your Pants config file, or by setting it in [`mypy.ini`](https://mypy.readthedocs.io/en/stable/config_file.html).
:::

### First-party type stubs (`.pyi` files)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/python/goals/test.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ ignore_errors = true

`ignore_errors = true` means that those files will simply be left off of the final coverage report.

(Pants should autodiscover the config file `.coveragerc`. See [coverage-py](../../../reference/subsystems/coverage-py.mdx#section-config-discovery).)
(Pants should autodiscover the config file `.coveragerc`. See [coverage-py](../../../reference/subsystems/coverage-py.mdx#config-discovery).)

There's a proposal for Pants to fix this by generating multiple reports when necessary: [https://github.com/pantsbuild/pants/issues/11137](https://github.com/pantsbuild/pants/issues/11137). We'd appreciate your feedback.
:::
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/python/integrations/aws-lambda.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,6 @@ Pants implemented a new way to package Lambda functions in 2.17, which became th
- In Pants 2.18, the new behaviour is now the default behaviour. Layers can now be built using Pants, and this addition includes renaming the `python_awslambda` target to `python_aws_lambda_function`.
- In Pants 2.19 and later, the old Lambdex behaviour has been entirely removed.

If your code can be packaged without warnings using Pants 2.18, no change is required when upgrading to Pants 2.19 (except removing the `[lambdex]` section in `pants.toml` if that still remains). If not, [follow its instructions](/v2.18/docs/awslambda-python#migrating-from-pants-216-and-earlier) to upgrade to Pants 2.18 fully first, and upgrade to Pants 2.19 after that.
If your code can be packaged without warnings using Pants 2.18, no change is required when upgrading to Pants 2.19 (except removing the `[lambdex]` section in `pants.toml` if that still remains). If not, [follow its instructions](/2.18/docs/python/integrations/aws-lambda#migrating-from-pants-216-and-earlier) to upgrade to Pants 2.18 fully first, and upgrade to Pants 2.19 after that.

If you encounter a bug with the new behaviour, [please let us know](https://github.com/pantsbuild/pants/issues/new/choose). If you require advanced PEX features, [switch to using `pex_binary` directly](#advanced-using-pex-directly).
2 changes: 1 addition & 1 deletion docs/docs/python/overview/linters-and-formatters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Pants will copy all reports into the folder `dist/lint/<linter_name>`.

### Pylint and Flake8: how to add first-party plugins

See [`[pylint].source_plugins`](../../../reference/subsystems/pylint.mdx#section-source-plugins) and [`[flake8].source_plugins`](../../../reference/subsystems/flake8.mdx#section-source-plugins) for instructions to add plugins written by you.
See [`[pylint].source_plugins`](../../../reference/subsystems/pylint.mdx#source_plugins) and [`[flake8].source_plugins`](../../../reference/subsystems/flake8.mdx#source_plugins) for instructions to add plugins written by you.

### Bandit: less verbose logging

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/python/overview/lockfiles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ A lockfile will contain dependencies for all requested Python versions. By defau
You can use the following options to affect how the lockfile generator resolves dependencies for each resolve:

- [\[python\].resolves_to_constraints_file](../../../reference/subsystems/python.mdx#resolves_to_constraints_file): For each resolve, a path to a [Pip constraints file](https://pip.pypa.io/en/stable/user_guide/#constraints-files) to use when resolving that lockfile.
- [\[python\].resolve_to_no_binary](../../../reference/subsystems/python.mdx#resolve_to_no_binary): For each resolve, a list of projects that must only resolve to sdists and not wheels. Use the value `[":all:"]` to disable wheels for all packages.
- [\[python\].resolve_to_only_binary](../../../reference/subsystems/python.mdx#resolve_to_only_binary): For each resolve, a list of projects that must only resolve to wheels and not sdists. Use the value `[":all:"]` to disable sdists for all packages.
- [\[python\].resolves_to_no_binary](../../../reference/subsystems/python.mdx#resolves_to_no_binary): For each resolve, a list of projects that must only resolve to sdists and not wheels. Use the value `[":all:"]` to disable wheels for all packages.
- [\[python\].resolves_to_only_binary](../../../reference/subsystems/python.mdx#resolves_to_only_binary): For each resolve, a list of projects that must only resolve to wheels and not sdists. Use the value `[":all:"]` to disable sdists for all packages.

You can use the key `__default__` to set the value for all resolves at once.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/using-pants/advanced-target-selection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ python_tests(
)
```

You can then filter by tags with the global `--tag` [option](../../reference/global-options.mdx#section-tag), like this:
You can then filter by tags with the global `--tag` [option](../../reference/global-options.mdx#tag), like this:

```bash
pants --tag=integration_test list ::
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/using-pants/key-concepts/backends.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ The list of all backends (both stable and experimental) is also available via `p
| `pants.backend.experimental.tools.semgrep` | Enables semgrep, a fast multi-language static analysis engine: [https://semgrep.dev](https://semgrep.dev) | [`semgrep`](../../../reference/subsystems/semgrep.mdx) |
| `pants.backend.experimental.tools.workunit_logger` | Enables the workunit logger for debugging pants itself | [`workunit-logger`](../../../reference/subsystems/workunit-logger.mdx) |
| `pants.backend.experimental.tools.yamllint` | Enables yamllint, a linter for YAML files: [https://yamllint.readthedocs.io/](https://yamllint.readthedocs.io/) | [`yamllint`](../../../reference/subsystems/yamllint.mdx) |
| `pants.backend.experimental.visibility` | Enables `__dependencies_rules__` and `__dependents_rules__` | [Visibility](./targets-and-build-files.mdx#visibility) |
| `pants.backend.experimental.visibility` | Enables `__dependencies_rules__` and `__dependents_rules__` | [Visibility](../validating-dependencies) |
| `pants.backend.python.providers.experimental.pyenv` | Enables Pants to manage appropriate Python interpreters via pyenv | |
| `pants.backend.python.providers.experimental.pyenv.custom_install` | Enables customising how the pyenv provider builds a Python interpreter | |
2 changes: 1 addition & 1 deletion docs/docs/using-pants/restricted-internet-access.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Pants downloads the various JVM-related tools it uses from [Maven Central](https

If you use JVM code but cannot access Maven Central directly, then you probably have an internal mirror or a custom JVM package repository. So all you have to do is configure Pants to access this custom repository, and ensure that the tools it needs are available there.

To do so, set the [`repos`](../../reference/subsystems/coursier.mdx#section-repos) option on the `[coursier]` scope. E.g.,
To do so, set the [`repos`](../../reference/subsystems/coursier.mdx#repos) option on the `[coursier]` scope. E.g.,

```text title="pants.toml"
[coursier]
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/using-pants/troubleshooting-common-issues.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Alternatively, you can stop populating `pants_ignore` from your `.gitignore` by

## Import errors and missing dependencies

Because Pants runs processes in hermetic sandboxes (temporary directories), Pants must properly know about your [dependencies](./key-concepts/targets-and-build-files.mdx#dependencies-and-dependency-inference) to avoid import errors.
Because Pants runs processes in hermetic sandboxes (temporary directories), Pants must properly know about your [dependencies](../introduction/how-does-pants-work#dependency-inference) to avoid import errors.

Usually, you do not need to tell Pants about your dependencies thanks to dependency inference, but sometimes dependency inference is not set up properly or cannot work.

Expand Down Expand Up @@ -226,7 +226,7 @@ To temporarily run a single test at a time (albeit with reduced performance), yo
pants --process-execution-local-parallelism=1 test ::
```

A more sustainable solution for shared resources is to use the [`[pytest].execution_slot_var`](../../reference/subsystems/pytest.mdx#section-execution-slot-var) option, which sets an environment variable which test runs can consume to determine which copy of a resource to consume.
A more sustainable solution for shared resources is to use the [`[pytest].execution_slot_var`](../../reference/subsystems/pytest.mdx#execution_slot_var) option, which sets an environment variable which test runs can consume to determine which copy of a resource to consume.

## Snap-based Docker

Expand Down
Loading

0 comments on commit 83810e2

Please sign in to comment.