Skip to content

Commit d3b04f9

Browse files
WorkerPantshuonw
andauthored
Update doc_url calls for new website (Cherry-pick of #20583) (#20588)
This PR fixes #20427 by updating our use of `doc_url` to reflect the new website structure. It does this semi-automatically, spread across separate commits: 1. Update the `doc_url` function to reflect the new website structure, including support for unversioned URLs like https://www.pantsbuild.org/community/getting-help 2. Apply automated rewrites (see below for details) 3. Do one or two manual fix-ups The automatic rewrites were done by: 1. finding the args passed to `doc_url`: `rg --only-matching "doc_url\([^)]*\)" . | cut -f2 -d\( | cut -f1 -d\) | tr \' \" | sort -u` 2. put them into CSV file, then use https://github.com/pantsbuild/pantsbuild.org/blob/92d5ce8d3442890c3fbeb0fade620b762ae2aa7e/old_site_redirects.js to find the new URL for each one 3. transform the CSV into a long series of `s@...@...@` substitutions for `sed` 4. apply them with `git ls-files '*.py' '*.rs' | xargs sed -i '' "..."` 5. do a basic check that the appropriate files that call `doc_url` were updated: identify non-updated files via `comm -13 <(git diff --name-only be42bc0^...be42bc0) <( rg --files-with-matches doc_url | sort)`. The files without updates are expected, e.g. - `src/python/pants/util/docutil.py` that defines `doc_url` itself (and the test file etc.) - `src/python/pants/backend/codegen/avro/target_types.py` that didn't have an immediately obvious replacement, with more examples in #20584 This is marked for cherry-picking to 2.20.x. There _are_ redirects for the URLs for 2.20, but it seems a bit annoying to rely on them, if we don't have to. <details> ```csv old,new "getting-help","community/getting-help" "advanced-target-selection","docs/using-pants/advanced-target-selection" "anonymous-telemetry","docs/using-pants/anonymous-telemetry" "awslambda-python","docs/python/integrations/aws-lambda" "enabling-backends","docs/using-pants/key-concepts/backends" "google-cloud-function-python","docs/python/integrations/google-cloud-functions" "installation","docs/getting-started/installing-pants" "macros","docs/writing-plugins/macros" "options","docs/using-pants/key-concepts/options" "options#addremove-semantics","docs/using-pants/key-concepts/options#addremove-semantics" "options#config-file-entries","docs/using-pants/key-concepts/options#config-file-entries" "options#config-file-interpolation","docs/using-pants/key-concepts/options#config-file-interpolation" "options#pantsrc-file","docs/using-pants/key-concepts/options#pantsrc-file" "options#reading-individual-option-values-from-files","docs/using-pants/key-concepts/options#reading-individual-option-values-from-files" "pex","docs/python/overview/pex" "plugin-upgrade-guide","docs/writing-plugins/common-plugin-tasks/plugin-upgrade-guide" "plugins-overview","docs/writing-plugins/overview" "plugins-setup-py","docs/writing-plugins/common-plugin-tasks/custom-python-artifact-kwargs" "protobuf-go","docs/go/integrations/protobuf" "protobuf-python","docs/python/integrations/protobuf-and-grpc" "python-check-goal","docs/python/goals/check" "python-distributions","docs/python/overview/building-distributions" "python-interpreter-compatibility","docs/python/overview/interpreter-compatibility" "python-lockfiles#lockfiles-for-tools","docs/python/overview/lockfiles#lockfiles-for-tools" "python-test-goal","docs/python/goals/test" "python-test-goal#pytest-version-and-plugins","docs/python/goals/test#pytest-version-and-plugins" "python-third-party-dependencies","docs/python/overview/third-party-dependencies" "python-third-party-dependencies#local-requirements","docs/python/overview/third-party-dependencies#local-requirements" "python-third-party-dependencies#multiple-lockfiles","docs/python/overview/lockfiles#multiple-lockfiles" "python-third-party-dependencies#user-lockfiles","docs/python/overview/third-party-dependencies#user-lockfiles" "reference-deploy_jar#coderesolvecode","reference/targets/deploy_jar#resolve" "reference-global#remote_oauth_bearer_token","reference/global-options#remote_oauth_bearer_token" "remote-caching-execution","docs/using-pants/remote-caching-and-execution" "source-roots","docs/using-pants/key-concepts/source-roots" "tagging-docker-images","docs/docker/tagging-docker-images" "target-api-concepts","docs/writing-plugins/the-target-api/concepts" "targets","docs/using-pants/key-concepts/targets-and-build-files" "targets#field-default-values","docs/using-pants/key-concepts/targets-and-build-files#field-default-values" "targets#dependencies-and-dependency-inference","docs/using-pants/key-concepts/targets-and-build-files#dependencies-and-dependency-inference" "thrift-python","docs/python/integrations/thrift" "troubleshooting","docs/using-pants/troubleshooting-common-issues" "troubleshooting#import-errors-and-missing-dependencies","docs/using-pants/troubleshooting-common-issues#import-errors-and-missing-dependencies" "upgrade-tips","docs/releases/upgrade-tips" ``` ```python import pandas as pd print("\n".join( f"""s@\\(doc_url.*[\\"']\\){r.old}\\([\\"']\\)@\\1{r.new}\\2@g;""" for _, r in pd.read_csv("replacements.csv").iterrows() )) ``` ```shell git ls-files '*.py' '*.rs' | xargs sed -i '' " s@\(doc_url.*[\"']\)getting-help\([\"']\)@\1community/getting-help\2@g; s@\(doc_url.*[\"']\)advanced-target-selection\([\"']\)@\1docs/using-pants/advanced-target-selection\2@g; s@\(doc_url.*[\"']\)anonymous-telemetry\([\"']\)@\1docs/using-pants/anonymous-telemetry\2@g; s@\(doc_url.*[\"']\)awslambda-python\([\"']\)@\1docs/python/integrations/aws-lambda\2@g; s@\(doc_url.*[\"']\)enabling-backends\([\"']\)@\1docs/using-pants/key-concepts/backends\2@g; s@\(doc_url.*[\"']\)google-cloud-function-python\([\"']\)@\1docs/python/integrations/google-cloud-functions\2@g; s@\(doc_url.*[\"']\)installation\([\"']\)@\1docs/getting-started/installing-pants\2@g; s@\(doc_url.*[\"']\)macros\([\"']\)@\1docs/writing-plugins/macros\2@g; s@\(doc_url.*[\"']\)options\([\"']\)@\1docs/using-pants/key-concepts/options\2@g; s@\(doc_url.*[\"']\)options#addremove-semantics\([\"']\)@\1docs/using-pants/key-concepts/options#addremove-semantics\2@g; s@\(doc_url.*[\"']\)options#config-file-entries\([\"']\)@\1docs/using-pants/key-concepts/options#config-file-entries\2@g; s@\(doc_url.*[\"']\)options#config-file-interpolation\([\"']\)@\1docs/using-pants/key-concepts/options#config-file-interpolation\2@g; s@\(doc_url.*[\"']\)options#pantsrc-file\([\"']\)@\1docs/using-pants/key-concepts/options#pantsrc-file\2@g; s@\(doc_url.*[\"']\)options#reading-individual-option-values-from-files\([\"']\)@\1docs/using-pants/key-concepts/options#reading-individual-option-values-from-files\2@g; s@\(doc_url.*[\"']\)pex\([\"']\)@\1docs/python/overview/pex\2@g; s@\(doc_url.*[\"']\)plugin-upgrade-guide\([\"']\)@\1docs/writing-plugins/common-plugin-tasks/plugin-upgrade-guide\2@g; s@\(doc_url.*[\"']\)plugins-overview\([\"']\)@\1docs/writing-plugins/overview\2@g; s@\(doc_url.*[\"']\)plugins-setup-py\([\"']\)@\1docs/writing-plugins/common-plugin-tasks/custom-python-artifact-kwargs\2@g; s@\(doc_url.*[\"']\)protobuf-go\([\"']\)@\1docs/go/integrations/protobuf\2@g; s@\(doc_url.*[\"']\)protobuf-python\([\"']\)@\1docs/python/integrations/protobuf-and-grpc\2@g; s@\(doc_url.*[\"']\)python-check-goal\([\"']\)@\1docs/python/goals/check\2@g; s@\(doc_url.*[\"']\)python-distributions\([\"']\)@\1docs/python/overview/building-distributions\2@g; s@\(doc_url.*[\"']\)python-interpreter-compatibility\([\"']\)@\1docs/python/overview/interpreter-compatibility\2@g; s@\(doc_url.*[\"']\)python-lockfiles#lockfiles-for-tools\([\"']\)@\1docs/python/overview/lockfiles#lockfiles-for-tools\2@g; s@\(doc_url.*[\"']\)python-test-goal\([\"']\)@\1docs/python/goals/test\2@g; s@\(doc_url.*[\"']\)python-test-goal#pytest-version-and-plugins\([\"']\)@\1docs/python/goals/test#pytest-version-and-plugins\2@g; s@\(doc_url.*[\"']\)python-third-party-dependencies\([\"']\)@\1docs/python/overview/third-party-dependencies\2@g; s@\(doc_url.*[\"']\)python-third-party-dependencies#local-requirements\([\"']\)@\1docs/python/overview/third-party-dependencies#local-requirements\2@g; s@\(doc_url.*[\"']\)python-third-party-dependencies#multiple-lockfiles\([\"']\)@\1docs/python/overview/lockfiles#multiple-lockfiles\2@g; s@\(doc_url.*[\"']\)python-third-party-dependencies#user-lockfiles\([\"']\)@\1docs/python/overview/third-party-dependencies#user-lockfiles\2@g; s@\(doc_url.*[\"']\)reference-deploy_jar#coderesolvecode\([\"']\)@\1reference/targets/deploy_jar#resolve\2@g; s@\(doc_url.*[\"']\)reference-global#remote_oauth_bearer_token\([\"']\)@\1reference/global-options#remote_oauth_bearer_token\2@g; s@\(doc_url.*[\"']\)remote-caching-execution\([\"']\)@\1docs/using-pants/remote-caching-and-execution\2@g; s@\(doc_url.*[\"']\)source-roots\([\"']\)@\1docs/using-pants/key-concepts/source-roots\2@g; s@\(doc_url.*[\"']\)tagging-docker-images\([\"']\)@\1docs/docker/tagging-docker-images\2@g; s@\(doc_url.*[\"']\)target-api-concepts\([\"']\)@\1docs/writing-plugins/the-target-api/concepts\2@g; s@\(doc_url.*[\"']\)targets\([\"']\)@\1docs/using-pants/key-concepts/targets-and-build-files\2@g; s@\(doc_url.*[\"']\)targets#field-default-values\([\"']\)@\1docs/using-pants/key-concepts/targets-and-build-files#field-default-values\2@g; s@\(doc_url.*[\"']\)targets#dependencies-and-dependency-inference\([\"']\)@\1docs/using-pants/key-concepts/targets-and-build-files#dependencies-and-dependency-inference\2@g; s@\(doc_url.*[\"']\)thrift-python\([\"']\)@\1docs/python/integrations/thrift\2@g; s@\(doc_url.*[\"']\)troubleshooting\([\"']\)@\1docs/using-pants/troubleshooting-common-issues\2@g; s@\(doc_url.*[\"']\)troubleshooting#import-errors-and-missing-dependencies\([\"']\)@\1docs/using-pants/troubleshooting-common-issues#import-errors-and-missing-dependencies\2@g; s@\(doc_url.*[\"']\)upgrade-tips\([\"']\)@\1docs/releases/upgrade-tips\2@g; " ``` </details> Co-authored-by: Huon Wilson <[email protected]>
1 parent be760d0 commit d3b04f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+122
-88
lines changed

src/python/pants/backend/awslambda/python/target_types.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class PythonAWSLambda(_AWSLambdaBaseTarget):
191191
f"""
192192
A self-contained Python function suitable for uploading to AWS Lambda.
193193
194-
See {doc_url('awslambda-python')}.
194+
See {doc_url('docs/python/integrations/aws-lambda')}.
195195
"""
196196
)
197197

@@ -207,7 +207,7 @@ class PythonAWSLambdaLayer(_AWSLambdaBaseTarget):
207207
f"""
208208
A Python layer suitable for uploading to AWS Lambda.
209209
210-
See {doc_url('awslambda-python')}.
210+
See {doc_url('docs/python/integrations/aws-lambda')}.
211211
"""
212212
)
213213

src/python/pants/backend/codegen/protobuf/python/python_protobuf_subsystem.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class PythonProtobufSubsystem(Subsystem):
3535
f"""
3636
Options related to the Protobuf Python backend.
3737
38-
See {doc_url('protobuf-python')}.
38+
See {doc_url('docs/python/integrations/protobuf-and-grpc')}.
3939
"""
4040
)
4141

src/python/pants/backend/codegen/protobuf/target_types.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ class ProtobufSourceTarget(Target):
6666
A single Protobuf file used to generate various languages.
6767
6868
See language-specific docs:
69-
Python: {doc_url('protobuf-python')}
70-
Go: {doc_url('protobuf-go')}
69+
Python: {doc_url('docs/python/integrations/protobuf-and-grpc')}
70+
Go: {doc_url('docs/go/integrations/protobuf')}
7171
"""
7272
)
7373

src/python/pants/backend/codegen/thrift/target_types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class ThriftSourceTarget(Target):
7272
A single Thrift file used to generate various languages.
7373
7474
See language-specific docs:
75-
Python: {doc_url('thrift-python')}
75+
Python: {doc_url('docs/python/integrations/thrift')}
7676
"""
7777
)
7878

src/python/pants/backend/codegen/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def find_python_runtime_library_or_raise_error(
5454
No `python_requirement` target was found with the module `{runtime_library_module}`
5555
in your project{for_resolve_str}, so the Python code generated from the target
5656
{codegen_address} will not work properly. See
57-
{doc_url('python-third-party-dependencies')} for how to add a requirement, such as
57+
{doc_url('docs/python/overview/third-party-dependencies')} for how to add a requirement, such as
5858
adding to requirements.txt. Usually you will want to use the
5959
`{recommended_requirement_name}` project at {recommended_requirement_url}.
6060

src/python/pants/backend/docker/target_types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class DockerImageTagsField(StringSequenceField):
149149
150150
{_interpolation_help.format(kind="tag")}
151151
152-
See {doc_url('tagging-docker-images')}.
152+
See {doc_url('docs/docker/tagging-docker-images')}.
153153
"""
154154
)
155155

src/python/pants/backend/google_cloud_function/python/target_types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class PythonGoogleCloudFunction(Target):
125125
f"""
126126
A self-contained Python function suitable for uploading to Google Cloud Function.
127127
128-
See {doc_url('google-cloud-function-python')}.
128+
See {doc_url('docs/python/integrations/google-cloud-functions')}.
129129
"""
130130
)
131131

src/python/pants/backend/python/dependency_inference/rules.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ async def _handle_unowned_imports(
346346
347347
If you do not expect an import to be inferrable, add `# pants: no-infer-dep` to the
348348
import line. Otherwise, see
349-
{doc_url('troubleshooting#import-errors-and-missing-dependencies')} for common problems.
349+
{doc_url('docs/using-pants/troubleshooting-common-issues#import-errors-and-missing-dependencies')} for common problems.
350350
"""
351351
)
352352
if unowned_dependency_behavior is UnownedDependencyUsage.LogWarning:

src/python/pants/backend/python/goals/pytest_runner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ async def validate_pytest_cov_included(_pytest: PyTest):
243243
`{_pytest.install_from_resolve}` used to install pytest is missing
244244
`pytest-cov`, which is needed to collect coverage data.
245245
246-
See {doc_url("python-test-goal#pytest-version-and-plugins")} for details
246+
See {doc_url("docs/python/goals/test#pytest-version-and-plugins")} for details
247247
on how to set up a custom resolve for use by pytest.
248248
"""
249249
)

src/python/pants/backend/python/goals/repl.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def maybe_get_resolve(t: Target) -> str | None:
5454
raise NoCompatibleResolveException.bad_input_roots(
5555
root_targets,
5656
maybe_get_resolve=maybe_get_resolve,
57-
doc_url_slug="python-third-party-dependencies#multiple-lockfiles",
57+
doc_url_slug="docs/python/overview/lockfiles#multiple-lockfiles",
5858
workaround=softwrap(
5959
f"""
6060
To work around this, choose which resolve you want to use from above. Then, run

src/python/pants/backend/python/lint/flake8/subsystem.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class Flake8(PythonToolBase):
108108
example, if your plugin is at `build-support/flake8/custom_plugin.py`, add
109109
`'build-support/flake8'` to `[source].root_patterns` in `pants.toml`. This is
110110
necessary for Pants to know how to tell Flake8 to discover your plugin. See
111-
{doc_url('source-roots')}
111+
{doc_url('docs/using-pants/key-concepts/source-roots')}
112112
113113
You must also set `[flake8:local-plugins]` in your Flake8 config file.
114114
@@ -123,7 +123,7 @@ class Flake8(PythonToolBase):
123123
directory or a subdirectory.
124124
125125
To instead load third-party plugins, add them to a custom resolve alongside
126-
flake8 itself, as described in {doc_url("python-lockfiles#lockfiles-for-tools")}.
126+
flake8 itself, as described in {doc_url("docs/python/overview/lockfiles#lockfiles-for-tools")}.
127127
"""
128128
),
129129
)

src/python/pants/backend/python/lint/pylint/subsystem.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class Pylint(PythonToolBase):
106106
example, if your plugin is at `build-support/pylint/custom_plugin.py`, add
107107
`'build-support/pylint'` to `[source].root_patterns` in `pants.toml`. This is
108108
necessary for Pants to know how to tell Pylint to discover your plugin. See
109-
{doc_url('source-roots')}
109+
{doc_url('docs/using-pants/key-concepts/source-roots')}
110110
111111
You must also set `load-plugins=$module_name` in your Pylint config file.
112112
@@ -115,7 +115,7 @@ class Pylint(PythonToolBase):
115115
directory or a subdirectory.
116116
117117
To instead load third-party plugins, add them to a custom resolve alongside
118-
pylint itself, as described in {doc_url("python-lockfiles#lockfiles-for-tools")}.
118+
pylint itself, as described in {doc_url("docs/python/overview/lockfiles#lockfiles-for-tools")}.
119119
"""
120120
),
121121
)

src/python/pants/backend/python/packaging/pyoxidizer/rules.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ async def package_pyoxidizer_binary(
133133
The `{PyOxidizerTarget.alias}` target {field_set.address} must include
134134
in its `dependencies` field at least one `python_distribution` target that produces a
135135
`.whl` file. For example, if using `{GenerateSetupField.alias}=True`, then make sure
136-
`{WheelField.alias}=True`. See {doc_url('python-distributions')}.
136+
`{WheelField.alias}=True`. See {doc_url('docs/python/overview/building-distributions')}.
137137
"""
138138
)
139139
)

src/python/pants/backend/python/packaging/pyoxidizer/target_types.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ class PyOxidizerDependenciesField(Dependencies):
7878
7979
The distribution(s) must generate at least one wheel file. For example, if using
8080
`{GenerateSetupField.alias}=True`, then make sure `{WheelField.alias}=True`. See
81-
{doc_url('python-distributions')}.
81+
{doc_url('docs/python/overview/building-distributions')}.
8282
8383
Usually, you only need to specify a single `python_distribution`. However, if
8484
that distribution depends on another first-party distribution in your repository, you
8585
must specify that dependency too, otherwise PyOxidizer would try installing the
8686
distribution from PyPI. Note that a `python_distribution` target might depend on
8787
another `python_distribution` target even if it is not included in its own `dependencies`
88-
field, as explained at {doc_url('python-distributions')}; if code from one distribution
88+
field, as explained at {doc_url('docs/python/overview/building-distributions')}; if code from one distribution
8989
imports code from another distribution, then there is a dependency and you must
9090
include both `python_distribution` targets in the `dependencies` field of this
9191
`pyoxidizer_binary` target.
@@ -146,7 +146,7 @@ class PyOxidizerTarget(Target):
146146
A single-file Python executable with a Python interpreter embedded, built via PyOxidizer.
147147
148148
To use this target, first create a `python_distribution` target with the code you want
149-
included in your binary, per {doc_url('python-distributions')}. Then add this
149+
included in your binary, per {doc_url('docs/python/overview/building-distributions')}. Then add this
150150
`python_distribution` target to the `dependencies` field. See the `help` for
151151
`dependencies` for more information.
152152

src/python/pants/backend/python/subsystems/python_tool_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class PythonToolRequirementsBase(Subsystem):
5858
If specified, install the tool using the lockfile for this named resolve.
5959
6060
This resolve must be defined in `[python].resolves`, as described in
61-
{doc_url("python-third-party-dependencies#user-lockfiles")}.
61+
{doc_url("docs/python/overview/third-party-dependencies#user-lockfiles")}.
6262
6363
The resolve's entire lockfile will be installed, unless specific requirements are
6464
listed via the `requirements` option, in which case only those requirements

src/python/pants/backend/python/subsystems/repos.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,19 @@ class PythonRepos(Subsystem):
7878
7979
This feature is intended to be used with `[python-repos].find_links`, rather than PEP
8080
440 direct reference requirements (see
81-
{doc_url("python-third-party-dependencies#local-requirements")}.
81+
{doc_url("docs/python/overview/third-party-dependencies#local-requirements")}.
8282
`[python-repos].find_links` must be configured to a valid absolute path for the
8383
current machine.
8484
8585
Tip: you can avoid each user needing to manually configure this option and
8686
`[python-repos].find_links` by using a common file location, along with Pants's
87-
interpolation support ({doc_url('options#config-file-interpolation')}. For example,
87+
interpolation support ({doc_url('docs/using-pants/key-concepts/options#config-file-interpolation')}. For example,
8888
in `pants.toml`, you could set both options to `%(buildroot)s/python_wheels`
8989
to point to the directory `python_wheels` in the root of
9090
your repository; or, use the path `%(env.HOME)s/pants_wheels` for the path
9191
`~/pants_wheels`. If you are not able to use a common path like this, then we
9292
recommend setting that each user set these options via a `.pants.rc` file
93-
({doc_url('options#pantsrc-file')}.
93+
({doc_url('docs/using-pants/key-concepts/options#pantsrc-file')}.
9494
9595
Note: Only takes effect if using Pex lockfiles, i.e. using the
9696
`generate-lockfiles` goal.

src/python/pants/backend/python/subsystems/setup.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def interpreter_constraints(self) -> tuple[str, ...]:
106106
if different parts of your codebase run against different python interpreter
107107
versions in a single repo.
108108
109-
See {doc_url("python-interpreter-compatibility")} for details.
109+
See {doc_url("docs/python/overview/interpreter-compatibility")} for details.
110110
"""
111111
),
112112
)
@@ -126,7 +126,7 @@ def interpreter_constraints(self) -> tuple[str, ...]:
126126
interpreter constraints, update `[python].interpreter_constraints`, the
127127
`interpreter_constraints` field, and relevant tool options like
128128
`[isort].interpreter_constraints` to tell Pants which interpreters your code
129-
actually uses. See {doc_url('python-interpreter-compatibility')}.
129+
actually uses. See {doc_url('docs/python/overview/interpreter-compatibility')}.
130130
131131
All elements must be the minor and major Python version, e.g. `'2.7'` or `'3.10'`. Do
132132
not include the patch version.
@@ -187,7 +187,7 @@ def interpreter_constraints(self) -> tuple[str, ...]:
187187
resolve with the `resolve` field.
188188
189189
If a target can work with multiple resolves, you can either use the `parametrize`
190-
mechanism or manually create a distinct target per resolve. See {doc_url("targets")}
190+
mechanism or manually create a distinct target per resolve. See {doc_url("docs/using-pants/key-concepts/targets-and-build-files")}
191191
for information about `parametrize`.
192192
193193
For example:
@@ -231,7 +231,7 @@ def interpreter_constraints(self) -> tuple[str, ...]:
231231
Use this version of Pip for resolving requirements and generating lockfiles.
232232
233233
The value used here must be one of the Pip versions supported by the underlying PEX
234-
version. See {doc_url("pex")} for details.
234+
version. See {doc_url("docs/python/overview/pex")} for details.
235235
236236
N.B.: The `latest` value selects the latest of the choices listed by PEX which is not
237237
necessarily the latest Pip version released on PyPI.

src/python/pants/backend/python/subsystems/twine.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class TwineSubsystem(PythonToolBase):
7878
7979
This option cannot be overridden via environment targets, so if you need a different
8080
value than what the rest of your organization is using, override the value via an
81-
environment variable, CLI argument, or `.pants.rc` file. See {doc_url('options')}.
81+
environment variable, CLI argument, or `.pants.rc` file. See {doc_url('docs/using-pants/key-concepts/options')}.
8282
"""
8383
),
8484
)

src/python/pants/backend/python/target_types.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class InterpreterConstraintsField(StringSequenceField):
113113
114114
If the field is not set, it will default to the option `[python].interpreter_constraints`.
115115
116-
See {doc_url('python-interpreter-compatibility')} for how these interpreter
116+
See {doc_url('docs/python/overview/interpreter-compatibility')} for how these interpreter
117117
constraints are merged with the constraints of dependencies.
118118
"""
119119
)
@@ -459,7 +459,7 @@ class PexPlatformsField(StringSequenceField):
459459
f"""\
460460
The platforms field is a hack. The abbreviated information it provides is sometimes insufficient,
461461
leading to hard-to-debug build issues. Use complete_platforms instead.
462-
See {doc_url('pex')} for details.
462+
See {doc_url('docs/python/overview/pex')} for details.
463463
"""
464464
)
465465
help = help_text(
@@ -508,7 +508,7 @@ class PexCompletePlatformsField(SpecialCasedDependencies):
508508
complete platform JSON as described by Pex
509509
(https://pex.readthedocs.io/en/latest/buildingpex.html#complete-platform).
510510
511-
See {doc_url('pex')} for details.
511+
See {doc_url('docs/python/overview/pex')} for details.
512512
"""
513513
)
514514

@@ -797,7 +797,7 @@ class PexBinary(Target):
797797
A Python target that can be converted into an executable PEX file.
798798
799799
PEX files are self-contained executable files that contain a complete Python environment
800-
capable of running the target. For more information, see {doc_url('pex')}.
800+
capable of running the target. For more information, see {doc_url('docs/python/overview/pex')}.
801801
"""
802802
)
803803

@@ -1059,7 +1059,7 @@ class PythonTestTarget(Target):
10591059
target and then be included in the `dependencies` field. (You can use the
10601060
`python_test_utils` target to generate these `python_source` targets.)
10611061
1062-
See {doc_url('python-test-goal')}
1062+
See {doc_url('docs/python/goals/test')}
10631063
"""
10641064
)
10651065

@@ -1398,7 +1398,7 @@ class PythonRequirementTarget(Target):
13981398
requirement into a `python_requirement` target automatically. For Poetry, use
13991399
`poetry_requirements`.
14001400
1401-
See {doc_url('python-third-party-dependencies')}.
1401+
See {doc_url('docs/python/overview/third-party-dependencies')}.
14021402
"""
14031403
)
14041404

@@ -1443,7 +1443,7 @@ class PythonProvidesField(ScalarField, AsyncFieldMixin):
14431443
in the `setup()` function:
14441444
(https://packaging.python.org/guides/distributing-packages-using-setuptools/#setup-args).
14451445
1446-
See {doc_url('plugins-setup-py')} for how to write a plugin to dynamically generate kwargs.
1446+
See {doc_url('docs/writing-plugins/common-plugin-tasks/custom-python-artifact-kwargs')} for how to write a plugin to dynamically generate kwargs.
14471447
"""
14481448
)
14491449

@@ -1677,7 +1677,7 @@ class PythonDistribution(Target):
16771677
f"""
16781678
A publishable Python setuptools distribution (e.g. an sdist or wheel).
16791679
1680-
See {doc_url('python-distributions')}.
1680+
See {doc_url('docs/python/overview/building-distributions')}.
16811681
"""
16821682
)
16831683

@@ -1786,6 +1786,6 @@ class VCSVersion(Target):
17861786
a subset of that config in this target's fields.
17871787
17881788
If you need functionality that is not currently exposed here, please reach out to us at
1789-
{doc_url("getting-help")}.
1789+
{doc_url("community/getting-help")}.
17901790
"""
17911791
)

src/python/pants/backend/python/target_types_rules.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ async def resolve_python_distribution_entry_points(
423423
target type {target.alias}.
424424
425425
Alternatively, you can use a module like "project.app:main".
426-
See {doc_url('python-distributions')}.
426+
See {doc_url('docs/python/overview/building-distributions')}.
427427
"""
428428
)
429429
)

src/python/pants/backend/python/typecheck/mypy/subsystem.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class MyPy(PythonToolBase):
114114
115115
To instead load third-party plugins, set the option `[mypy].install_from_resolve`
116116
to a resolve whose lockfile includes those plugins, and set the `plugins` option
117-
in `mypy.ini`. See {doc_url('python-check-goal')}.
117+
in `mypy.ini`. See {doc_url('docs/python/goals/check')}.
118118
"""
119119
),
120120
)
@@ -161,7 +161,7 @@ def check_and_warn_if_python_version_configured(self, config: FileContent | None
161161
f"""
162162
You set {formatted_configured}. Normally, Pants would automatically set this
163163
for you based on your code's interpreter constraints
164-
({doc_url('python-interpreter-compatibility')}). Instead, it will
164+
({doc_url('docs/python/overview/interpreter-compatibility')}). Instead, it will
165165
use what you set.
166166
167167
(Allowing Pants to automatically set the option allows Pants to partition your

src/python/pants/backend/python/util_rules/local_dists.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async def isolate_local_dist_wheels(
7373
code will be used directly from sources, without a distribution being built,
7474
and any native extensions in it will not be built.
7575
76-
See {doc_url('python-distributions')} for details on how to set up a
76+
See {doc_url('docs/python/overview/building-distributions')} for details on how to set up a
7777
{tgt.target.alias} target to produce a wheel.
7878
"""
7979
)

src/python/pants/backend/python/util_rules/local_dists_pep660.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ async def isolate_local_dist_pep660_wheels(
281281
code will be used directly from sources, without a distribution being built,
282282
and any native extensions in it will not be built.
283283
284-
See {doc_url('python-distributions')} for details on how to set up a
284+
See {doc_url('docs/python/overview/building-distributions')} for details on how to set up a
285285
{tgt.target.alias} target to produce a wheel.
286286
"""
287287
)

src/python/pants/backend/python/util_rules/package_dists.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494

9595
class SetupPyError(Exception):
9696
def __init__(self, msg: str):
97-
super().__init__(f"{msg} See {doc_url('python-distributions')}.")
97+
super().__init__(f"{msg} See {doc_url('docs/python/overview/building-distributions')}.")
9898

9999

100100
class InvalidSetupPyArgs(SetupPyError):
@@ -116,7 +116,7 @@ def __init__(self, msg: str):
116116
super().__init__(
117117
softwrap(
118118
f"""
119-
{msg} See {doc_url('python-distributions')} for
119+
{msg} See {doc_url('docs/python/overview/building-distributions')} for
120120
how python_sources targets are mapped to distributions.
121121
"""
122122
)

0 commit comments

Comments
 (0)