Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc_url calls for new website #20583

Merged
merged 6 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/python/pants/backend/awslambda/python/target_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class PythonAWSLambda(_AWSLambdaBaseTarget):
f"""
A self-contained Python function suitable for uploading to AWS Lambda.

See {doc_url('awslambda-python')}.
See {doc_url('docs/python/integrations/aws-lambda')}.
"""
)

Expand All @@ -207,7 +207,7 @@ class PythonAWSLambdaLayer(_AWSLambdaBaseTarget):
f"""
A Python layer suitable for uploading to AWS Lambda.

See {doc_url('awslambda-python')}.
See {doc_url('docs/python/integrations/aws-lambda')}.
"""
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class PythonProtobufSubsystem(Subsystem):
f"""
Options related to the Protobuf Python backend.

See {doc_url('protobuf-python')}.
See {doc_url('docs/python/integrations/protobuf-and-grpc')}.
"""
)

Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/backend/codegen/protobuf/target_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class ProtobufSourceTarget(Target):
A single Protobuf file used to generate various languages.
See language-specific docs:
Python: {doc_url('protobuf-python')}
Go: {doc_url('protobuf-go')}
Python: {doc_url('docs/python/integrations/protobuf-and-grpc')}
Go: {doc_url('docs/go/integrations/protobuf')}
"""
)

Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/codegen/thrift/target_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ThriftSourceTarget(Target):
A single Thrift file used to generate various languages.
See language-specific docs:
Python: {doc_url('thrift-python')}
Python: {doc_url('docs/python/integrations/thrift')}
"""
)

Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/codegen/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def find_python_runtime_library_or_raise_error(
No `python_requirement` target was found with the module `{runtime_library_module}`
in your project{for_resolve_str}, so the Python code generated from the target
{codegen_address} will not work properly. See
{doc_url('python-third-party-dependencies')} for how to add a requirement, such as
{doc_url('docs/python/overview/third-party-dependencies')} for how to add a requirement, such as
adding to requirements.txt. Usually you will want to use the
`{recommended_requirement_name}` project at {recommended_requirement_url}.

Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/docker/target_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class DockerImageTagsField(StringSequenceField):
{_interpolation_help.format(kind="tag")}
See {doc_url('tagging-docker-images')}.
See {doc_url('docs/docker/tagging-docker-images')}.
"""
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class PythonGoogleCloudFunction(Target):
f"""
A self-contained Python function suitable for uploading to Google Cloud Function.

See {doc_url('google-cloud-function-python')}.
See {doc_url('docs/python/integrations/google-cloud-functions')}.
"""
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ async def _handle_unowned_imports(
If you do not expect an import to be inferrable, add `# pants: no-infer-dep` to the
import line. Otherwise, see
{doc_url('troubleshooting#import-errors-and-missing-dependencies')} for common problems.
{doc_url('docs/using-pants/troubleshooting-common-issues#import-errors-and-missing-dependencies')} for common problems.
"""
)
if unowned_dependency_behavior is UnownedDependencyUsage.LogWarning:
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/python/goals/pytest_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ async def validate_pytest_cov_included(_pytest: PyTest):
`{_pytest.install_from_resolve}` used to install pytest is missing
`pytest-cov`, which is needed to collect coverage data.
See {doc_url("python-test-goal#pytest-version-and-plugins")} for details
See {doc_url("docs/python/goals/test#pytest-version-and-plugins")} for details
on how to set up a custom resolve for use by pytest.
"""
)
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/python/goals/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def maybe_get_resolve(t: Target) -> str | None:
raise NoCompatibleResolveException.bad_input_roots(
root_targets,
maybe_get_resolve=maybe_get_resolve,
doc_url_slug="python-third-party-dependencies#multiple-lockfiles",
doc_url_slug="docs/python/overview/lockfiles#multiple-lockfiles",
workaround=softwrap(
f"""
To work around this, choose which resolve you want to use from above. Then, run
Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/backend/python/lint/flake8/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Flake8(PythonToolBase):
example, if your plugin is at `build-support/flake8/custom_plugin.py`, add
`'build-support/flake8'` to `[source].root_patterns` in `pants.toml`. This is
necessary for Pants to know how to tell Flake8 to discover your plugin. See
{doc_url('source-roots')}
{doc_url('docs/using-pants/key-concepts/source-roots')}

You must also set `[flake8:local-plugins]` in your Flake8 config file.

Expand All @@ -123,7 +123,7 @@ class Flake8(PythonToolBase):
directory or a subdirectory.

To instead load third-party plugins, add them to a custom resolve alongside
flake8 itself, as described in {doc_url("python-lockfiles#lockfiles-for-tools")}.
flake8 itself, as described in {doc_url("docs/python/overview/lockfiles#lockfiles-for-tools")}.
"""
),
)
Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/backend/python/lint/pylint/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Pylint(PythonToolBase):
example, if your plugin is at `build-support/pylint/custom_plugin.py`, add
`'build-support/pylint'` to `[source].root_patterns` in `pants.toml`. This is
necessary for Pants to know how to tell Pylint to discover your plugin. See
{doc_url('source-roots')}
{doc_url('docs/using-pants/key-concepts/source-roots')}

You must also set `load-plugins=$module_name` in your Pylint config file.

Expand All @@ -115,7 +115,7 @@ class Pylint(PythonToolBase):
directory or a subdirectory.

To instead load third-party plugins, add them to a custom resolve alongside
pylint itself, as described in {doc_url("python-lockfiles#lockfiles-for-tools")}.
pylint itself, as described in {doc_url("docs/python/overview/lockfiles#lockfiles-for-tools")}.
"""
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ async def package_pyoxidizer_binary(
The `{PyOxidizerTarget.alias}` target {field_set.address} must include
in its `dependencies` field at least one `python_distribution` target that produces a
`.whl` file. For example, if using `{GenerateSetupField.alias}=True`, then make sure
`{WheelField.alias}=True`. See {doc_url('python-distributions')}.
`{WheelField.alias}=True`. See {doc_url('docs/python/overview/building-distributions')}.
"""
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ class PyOxidizerDependenciesField(Dependencies):

The distribution(s) must generate at least one wheel file. For example, if using
`{GenerateSetupField.alias}=True`, then make sure `{WheelField.alias}=True`. See
{doc_url('python-distributions')}.
{doc_url('docs/python/overview/building-distributions')}.

Usually, you only need to specify a single `python_distribution`. However, if
that distribution depends on another first-party distribution in your repository, you
must specify that dependency too, otherwise PyOxidizer would try installing the
distribution from PyPI. Note that a `python_distribution` target might depend on
another `python_distribution` target even if it is not included in its own `dependencies`
field, as explained at {doc_url('python-distributions')}; if code from one distribution
field, as explained at {doc_url('docs/python/overview/building-distributions')}; if code from one distribution
imports code from another distribution, then there is a dependency and you must
include both `python_distribution` targets in the `dependencies` field of this
`pyoxidizer_binary` target.
Expand Down Expand Up @@ -146,7 +146,7 @@ class PyOxidizerTarget(Target):
A single-file Python executable with a Python interpreter embedded, built via PyOxidizer.

To use this target, first create a `python_distribution` target with the code you want
included in your binary, per {doc_url('python-distributions')}. Then add this
included in your binary, per {doc_url('docs/python/overview/building-distributions')}. Then add this
`python_distribution` target to the `dependencies` field. See the `help` for
`dependencies` for more information.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PythonToolRequirementsBase(Subsystem):
If specified, install the tool using the lockfile for this named resolve.

This resolve must be defined in `[python].resolves`, as described in
{doc_url("python-third-party-dependencies#user-lockfiles")}.
{doc_url("docs/python/overview/third-party-dependencies#user-lockfiles")}.

The resolve's entire lockfile will be installed, unless specific requirements are
listed via the `requirements` option, in which case only those requirements
Expand Down
6 changes: 3 additions & 3 deletions src/python/pants/backend/python/subsystems/repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ class PythonRepos(Subsystem):

This feature is intended to be used with `[python-repos].find_links`, rather than PEP
440 direct reference requirements (see
{doc_url("python-third-party-dependencies#local-requirements")}.
{doc_url("docs/python/overview/third-party-dependencies#local-requirements")}.
`[python-repos].find_links` must be configured to a valid absolute path for the
current machine.

Tip: you can avoid each user needing to manually configure this option and
`[python-repos].find_links` by using a common file location, along with Pants's
interpolation support ({doc_url('options#config-file-interpolation')}. For example,
interpolation support ({doc_url('docs/using-pants/key-concepts/options#config-file-interpolation')}. For example,
in `pants.toml`, you could set both options to `%(buildroot)s/python_wheels`
to point to the directory `python_wheels` in the root of
your repository; or, use the path `%(env.HOME)s/pants_wheels` for the path
`~/pants_wheels`. If you are not able to use a common path like this, then we
recommend setting that each user set these options via a `.pants.rc` file
({doc_url('options#pantsrc-file')}.
({doc_url('docs/using-pants/key-concepts/options#pantsrc-file')}.

Note: Only takes effect if using Pex lockfiles, i.e. using the
`generate-lockfiles` goal.
Expand Down
8 changes: 4 additions & 4 deletions src/python/pants/backend/python/subsystems/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def interpreter_constraints(self) -> tuple[str, ...]:
if different parts of your codebase run against different python interpreter
versions in a single repo.

See {doc_url("python-interpreter-compatibility")} for details.
See {doc_url("docs/python/overview/interpreter-compatibility")} for details.
"""
),
)
Expand All @@ -126,7 +126,7 @@ def interpreter_constraints(self) -> tuple[str, ...]:
interpreter constraints, update `[python].interpreter_constraints`, the
`interpreter_constraints` field, and relevant tool options like
`[isort].interpreter_constraints` to tell Pants which interpreters your code
actually uses. See {doc_url('python-interpreter-compatibility')}.
actually uses. See {doc_url('docs/python/overview/interpreter-compatibility')}.

All elements must be the minor and major Python version, e.g. `'2.7'` or `'3.10'`. Do
not include the patch version.
Expand Down Expand Up @@ -187,7 +187,7 @@ def interpreter_constraints(self) -> tuple[str, ...]:
resolve with the `resolve` field.

If a target can work with multiple resolves, you can either use the `parametrize`
mechanism or manually create a distinct target per resolve. See {doc_url("targets")}
mechanism or manually create a distinct target per resolve. See {doc_url("docs/using-pants/key-concepts/targets-and-build-files")}
for information about `parametrize`.

For example:
Expand Down Expand Up @@ -231,7 +231,7 @@ def interpreter_constraints(self) -> tuple[str, ...]:
Use this version of Pip for resolving requirements and generating lockfiles.

The value used here must be one of the Pip versions supported by the underlying PEX
version. See {doc_url("pex")} for details.
version. See {doc_url("docs/python/overview/pex")} for details.

N.B.: The `latest` value selects the latest of the choices listed by PEX which is not
necessarily the latest Pip version released on PyPI.
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/python/subsystems/twine.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class TwineSubsystem(PythonToolBase):

This option cannot be overridden via environment targets, so if you need a different
value than what the rest of your organization is using, override the value via an
environment variable, CLI argument, or `.pants.rc` file. See {doc_url('options')}.
environment variable, CLI argument, or `.pants.rc` file. See {doc_url('docs/using-pants/key-concepts/options')}.
"""
),
)
Expand Down
18 changes: 9 additions & 9 deletions src/python/pants/backend/python/target_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class InterpreterConstraintsField(StringSequenceField):

If the field is not set, it will default to the option `[python].interpreter_constraints`.

See {doc_url('python-interpreter-compatibility')} for how these interpreter
See {doc_url('docs/python/overview/interpreter-compatibility')} for how these interpreter
constraints are merged with the constraints of dependencies.
"""
)
Expand Down Expand Up @@ -459,7 +459,7 @@ class PexPlatformsField(StringSequenceField):
f"""\
The platforms field is a hack. The abbreviated information it provides is sometimes insufficient,
leading to hard-to-debug build issues. Use complete_platforms instead.
See {doc_url('pex')} for details.
See {doc_url('docs/python/overview/pex')} for details.
"""
)
help = help_text(
Expand Down Expand Up @@ -508,7 +508,7 @@ class PexCompletePlatformsField(SpecialCasedDependencies):
complete platform JSON as described by Pex
(https://pex.readthedocs.io/en/latest/buildingpex.html#complete-platform).

See {doc_url('pex')} for details.
See {doc_url('docs/python/overview/pex')} for details.
"""
)

Expand Down Expand Up @@ -797,7 +797,7 @@ class PexBinary(Target):
A Python target that can be converted into an executable PEX file.

PEX files are self-contained executable files that contain a complete Python environment
capable of running the target. For more information, see {doc_url('pex')}.
capable of running the target. For more information, see {doc_url('docs/python/overview/pex')}.
"""
)

Expand Down Expand Up @@ -1059,7 +1059,7 @@ class PythonTestTarget(Target):
target and then be included in the `dependencies` field. (You can use the
`python_test_utils` target to generate these `python_source` targets.)

See {doc_url('python-test-goal')}
See {doc_url('docs/python/goals/test')}
"""
)

Expand Down Expand Up @@ -1398,7 +1398,7 @@ class PythonRequirementTarget(Target):
requirement into a `python_requirement` target automatically. For Poetry, use
`poetry_requirements`.

See {doc_url('python-third-party-dependencies')}.
See {doc_url('docs/python/overview/third-party-dependencies')}.
"""
)

Expand Down Expand Up @@ -1443,7 +1443,7 @@ class PythonProvidesField(ScalarField, AsyncFieldMixin):
in the `setup()` function:
(https://packaging.python.org/guides/distributing-packages-using-setuptools/#setup-args).

See {doc_url('plugins-setup-py')} for how to write a plugin to dynamically generate kwargs.
See {doc_url('docs/writing-plugins/common-plugin-tasks/custom-python-artifact-kwargs')} for how to write a plugin to dynamically generate kwargs.
"""
)

Expand Down Expand Up @@ -1677,7 +1677,7 @@ class PythonDistribution(Target):
f"""
A publishable Python setuptools distribution (e.g. an sdist or wheel).

See {doc_url('python-distributions')}.
See {doc_url('docs/python/overview/building-distributions')}.
"""
)

Expand Down Expand Up @@ -1786,6 +1786,6 @@ class VCSVersion(Target):
a subset of that config in this target's fields.

If you need functionality that is not currently exposed here, please reach out to us at
{doc_url("getting-help")}.
{doc_url("community/getting-help")}.
"""
)
2 changes: 1 addition & 1 deletion src/python/pants/backend/python/target_types_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ async def resolve_python_distribution_entry_points(
target type {target.alias}.

Alternatively, you can use a module like "project.app:main".
See {doc_url('python-distributions')}.
See {doc_url('docs/python/overview/building-distributions')}.
"""
)
)
Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/backend/python/typecheck/mypy/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class MyPy(PythonToolBase):

To instead load third-party plugins, set the option `[mypy].install_from_resolve`
to a resolve whose lockfile includes those plugins, and set the `plugins` option
in `mypy.ini`. See {doc_url('python-check-goal')}.
in `mypy.ini`. See {doc_url('docs/python/goals/check')}.
"""
),
)
Expand Down Expand Up @@ -161,7 +161,7 @@ def check_and_warn_if_python_version_configured(self, config: FileContent | None
f"""
You set {formatted_configured}. Normally, Pants would automatically set this
for you based on your code's interpreter constraints
({doc_url('python-interpreter-compatibility')}). Instead, it will
({doc_url('docs/python/overview/interpreter-compatibility')}). Instead, it will
use what you set.

(Allowing Pants to automatically set the option allows Pants to partition your
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/python/util_rules/local_dists.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async def isolate_local_dist_wheels(
code will be used directly from sources, without a distribution being built,
and any native extensions in it will not be built.

See {doc_url('python-distributions')} for details on how to set up a
See {doc_url('docs/python/overview/building-distributions')} for details on how to set up a
{tgt.target.alias} target to produce a wheel.
"""
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ async def isolate_local_dist_pep660_wheels(
code will be used directly from sources, without a distribution being built,
and any native extensions in it will not be built.
See {doc_url('python-distributions')} for details on how to set up a
See {doc_url('docs/python/overview/building-distributions')} for details on how to set up a
{tgt.target.alias} target to produce a wheel.
"""
)
Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/backend/python/util_rules/package_dists.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

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


class InvalidSetupPyArgs(SetupPyError):
Expand All @@ -116,7 +116,7 @@ def __init__(self, msg: str):
super().__init__(
softwrap(
f"""
{msg} See {doc_url('python-distributions')} for
{msg} See {doc_url('docs/python/overview/building-distributions')} for
how python_sources targets are mapped to distributions.
"""
)
Expand Down
Loading
Loading