Skip to content

Commit 844e6ad

Browse files
committed
Merge branch 'main' into restructure_jvm_docs
2 parents 659e3d3 + cc33747 commit 844e6ad

File tree

32 files changed

+307
-93
lines changed

32 files changed

+307
-93
lines changed

CONTRIBUTORS.md

+6
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Created as part of the release process.
4848
+ Chris Heisterkamp
4949
+ Chris Livingston
5050
+ Chris Pesto
51+
+ Chris Smith
5152
+ Chris Targett
5253
+ Chris Williams
5354
+ Christoph Proeschel
@@ -75,6 +76,7 @@ Created as part of the release process.
7576
+ David Taylor
7677
+ David Turner
7778
+ Derek Young
79+
+ Dimitar Kovachev
7880
+ Dimitrios Bariamis
7981
+ Divij Rajkumar
8082
+ Dominic Hamon
@@ -83,6 +85,7 @@ Created as part of the release process.
8385
+ Drew Rothstein
8486
+ Dumitru Daniliuc
8587
+ Dylan Herman
88+
+ Dương Đỗ Minh Châu
8689
+ Ebube Chuba
8790
+ Eitan Adler
8891
+ Ekaterina Tyurina
@@ -175,6 +178,7 @@ Created as part of the release process.
175178
+ Kaushik Srenevasan
176179
+ Ken Howard
177180
+ Ken Kawamoto
181+
+ Kevin Oliveira
178182
+ Kevin Oliver
179183
+ Kevin Sweeney
180184
+ Koki Nishihara
@@ -262,6 +266,7 @@ Created as part of the release process.
262266
+ Pierre Chevalier
263267
+ Pierre DAL-PRA
264268
+ Qicheng Ma
269+
+ Ramon Buckland
265270
+ Raph Estrada
266271
+ Raúl Cuza
267272
+ Rhuan Barreto
@@ -347,6 +352,7 @@ Created as part of the release process.
347352
+ offsetcyan
348353
+ olivercoleman-switchdin
349354
+ philipp-sontag-by
355+
+ purajit
350356
+ sww
351357
+ twunderlich-grapl
352358
+ wimax-grapl

docs/docs/helm/deployments.mdx

+7-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ Continuing with the example in the previous section, we can deploy it into Kuber
341341
3. Post-process the Kubernetes manifests generated by Helm by replacing all references to first-party Docker images by their real final registry destination.
342342
4. Initiate the deployment of the final Kubernetes resources resulting from the post-processing.
343343

344-
The `experimental-deploy` goal also supports default Helm pass-through arguments that allow to change the deployment behaviour to be either atomic or a dry-run or even what is the Kubernetes config file (the `kubeconfig` file) and target context to be used in the deployment.
344+
The `experimental-deploy` goal also supports default Helm pass-through arguments that allow to change the deployment behaviour to be atomic or even what is the Kubernetes config file (the `kubeconfig` file) and target context to be used in the deployment.
345345

346346
Please note that the list of valid pass-through arguments has been limited to those that do not alter the reproducibility of the deployment (i.e. `--create-namespace` is not a valid pass-through argument). Those arguments will have equivalent fields in the `helm_deployment` target.
347347

@@ -351,6 +351,12 @@ For example, to make an atomic deployment into a non-default Kubernetes context
351351
pants experimental-deploy src/deployments:prod -- --kube-context my-custom-kube-context --atomic
352352
```
353353

354+
To perform a dry run, use the `--dry-run` flag of the `experimental-deploy` goal.
355+
356+
```
357+
pants experimental-deploy --dry-run src/deployments:prod
358+
```
359+
354360
:::note How does Pants authenticate with the Kubernetes cluster?
355361
Short answer is: it doesn't.
356362
Pants will invoke Helm under the hood with the appropriate arguments to only perform the deployment. Any authentication steps that may be needed to perform the given deployment have to be done before invoking the `experimental-deploy` goal. If you are planning to run the deployment procedure from your CI/CD pipelines, ensure that all necessary preliminary steps (including authentication with the cluster) are done before the one that triggers the deployment.

docs/docs/python/overview/linters-and-formatters.mdx

+14-13
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,20 @@ Pants does several things to speed up running formatters and linters:
2626

2727
Linter/formatter support is implemented in separate [backends](../../using-pants/key-concepts/backends.mdx) so that they are easy to opt in to individually:
2828

29-
| Backend | Tool |
30-
| :-------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------- |
31-
| `pants.backend.python.lint.bandit` | [Bandit](https://bandit.readthedocs.io/en/latest/): security linter |
32-
| `pants.backend.python.lint.black` | [Black](https://black.readthedocs.io/en/stable/): code formatter |
33-
| `pants.backend.python.lint.docformatter` | [Docformatter](https://pypi.org/project/docformatter/): docstring formatter |
34-
| `pants.backend.python.lint.flake8` | [Flake8](https://flake8.pycqa.org/en/latest/): style and bug linter |
35-
| `pants.backend.python.lint.isort` | [isort](https://readthedocs.org/projects/isort/): import statement formatter |
36-
| `pants.backend.python.lint.pydocstyle` | [Pydocstyle](https://pypi.org/project/pydocstyle/): docstring linter |
37-
| `pants.backend.python.lint.pylint` | [Pylint](https://pylint.pycqa.org/): style and bug linter |
38-
| `pants.backend.python.lint.yapf` | [Yapf](https://github.com/google/yapf): code formatter |
39-
| `pants.backend.python.lint.autoflake` | [Autoflake](https://github.com/myint/autoflake): remove unused imports |
40-
| `pants.backend.python.lint.pyupgrade` | [Pyupgrade](https://github.com/asottile/pyupgrade): automatically update code to use modern Python idioms like `f-strings` |
41-
| `pants.backend.experimental.python.lint.ruff` | [Ruff](https://beta.ruff.rs/docs/): an extremely fast Python linter, written in Rust. |
29+
| Backend | Tool |
30+
| :--------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------- |
31+
| `pants.backend.python.lint.bandit` | [Bandit](https://bandit.readthedocs.io/en/latest/): security linter |
32+
| `pants.backend.python.lint.black` | [Black](https://black.readthedocs.io/en/stable/): code formatter |
33+
| `pants.backend.python.lint.docformatter` | [Docformatter](https://pypi.org/project/docformatter/): docstring formatter |
34+
| `pants.backend.python.lint.flake8` | [Flake8](https://flake8.pycqa.org/en/latest/): style and bug linter |
35+
| `pants.backend.python.lint.isort` | [isort](https://readthedocs.org/projects/isort/): import statement formatter |
36+
| `pants.backend.python.lint.pydocstyle` | [Pydocstyle](https://pypi.org/project/pydocstyle/): docstring linter |
37+
| `pants.backend.python.lint.pylint` | [Pylint](https://pylint.pycqa.org/): style and bug linter |
38+
| `pants.backend.python.lint.yapf` | [Yapf](https://github.com/google/yapf): code formatter |
39+
| `pants.backend.python.lint.autoflake` | [Autoflake](https://github.com/myint/autoflake): remove unused imports |
40+
| `pants.backend.python.lint.pyupgrade` | [Pyupgrade](https://github.com/asottile/pyupgrade): automatically update code to use modern Python idioms like `f-strings` |
41+
| `pants.backend.experimental.python.lint.ruff.check` | [Ruff (for linting)](https://docs.astral.sh/ruff/linter/): an extremely fast Python linter, written in Rust. |
42+
| `pants.backend.experimental.python.lint.ruff.format` | [Ruff (for formatting)](https://docs.astral.sh/ruff/formatter/): an extremely fast Python code formatter, written in Rust. |
4243

4344
To enable, add the appropriate backends in `pants.toml`:
4445

docs/docs/python/overview/pex.mdx

+4-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ In these cases you can override the default shebang using the [`shebang`](../../
8787

8888
Pants makes use of the [Pex](https://github.com/pex-tool/pex) command-line tool internally for building PEXes. The Pex version that Pants uses is specified by the `version` option under the `pex-cli` subsystem. The known Pex versions are specified by the `known_versions` option under the `pex-cli` subsystem. You can see all Pex tool options and their current values by running `pants help-advanced pex-cli`. To upgrade the Pex version, update these option values accordingly. For instance, in `pants.toml`, to upgrade to Pex 2.1.143:
8989

90-
```[pex-cli]
90+
```
91+
[pex-cli]
9192
version = "v2.1.143"
9293
known_versions = [
9394
"v2.1.143|macos_arm64|7dba8776000b4f75bc9af850cb65b2dc7720ea211733e8cb5243c0b210ef3c19|4194291",
@@ -101,6 +102,7 @@ The Pex version determines which Pip versions are supported. To see the lists of
101102

102103
The Pip version that Pex uses is determined by the `pip_version` option in Pants. To upgrade the Pip version, update this option value accordingly. For instance, in `pants.toml`, to set the Pip version to be the latest supported by Pex:
103104

104-
```[python]
105+
```
106+
[python]
105107
pip_version = "latest"
106108
```

docs/docs/terraform/index.mdx

+6
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,9 @@ Apply complete! Resources: 4 added, 0 changed, 0 destroyed.
175175
```
176176

177177
You can set auto approve by adding `-auto-approve` to the `[download-terraform].args` setting in `pants.toml`. You can also set it for a single pants invocation with `--download-terraform-args='-auto-approve'`, for example `pants experimental-deploy "--download-terraform-args='-auto-approve'"`.
178+
179+
To run `terraform plan`, use the `--dry-run` flag of the `experimental-deploy` goal.
180+
181+
```
182+
pants experimental-deploy --dry-run ::
183+
```

docs/docs/using-pants/key-concepts/backends.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ The list of all backends (both stable and experimental) is also available via `p
9898
| `pants.backend.experimental.python.framework.django` | Enables better support for projects using Django: [https://www.djangoproject.com](https://www.djangoproject.com) | |
9999
| `pants.backend.experimental.python.framework.stevedore` | Enables better support for projects using stevedore: [https://docs.openstack.org/stevedore/](https://docs.openstack.org/stevedore/) | |
100100
| `pants.backend.experimental.python.lint.add_trailing_comma` | Enables add-trailing-comma, a Python code formatter: [https://github.com/asottile/add-trailing-comma](https://github.com/asottile/add-trailing-comma) | [`add-trailing-comma`](../../../reference/subsystems/add-trailing-comma.mdx) |
101-
| `pants.backend.experimental.python.lint.ruff` | Enables Ruff, an extremely fast Python linter: [https://beta.ruff.rs/docs/](https://beta.ruff.rs/docs/) | [Linters and formatters](../../python/overview/linters-and-formatters.mdx) |
101+
| `pants.backend.experimental.python.lint.ruff.check` | Enables Ruff (for `lint`), an extremely fast Python linter: [https://docs.astral.sh/ruff/linter/](https://docs.astral.sh/ruff/linter/) | [Linters and formatters](../../python/overview/linters-and-formatters.mdx) |
102+
| `pants.backend.experimental.python.lint.ruff.format` | Enables Ruff (for `fmt`), an extremely fast Python code formatter: [https://docs.astral.sh/ruff/formatter/](https://docs.astral.sh/ruff/formatter/) | [Linters and formatters](../../python/overview/linters-and-formatters.mdx) |
102103
| `pants.backend.experimental.python.packaging.pyoxidizer` | Enables `pyoxidizer_binary` target. | [PyOxidizer](../../python/integrations/pyoxidizer.mdx) |
103104
| `pants.backend.experimental.python.typecheck.pyright` | Enables Pyright, a Python type checker: [https://github.com/microsoft/pyright](https://github.com/microsoft/pyright) | |
104105
| `pants.backend.experimental.python.typecheck.pytype` | Enables Pytype, a Python type checker: [https://google.github.io/pytype/](https://google.github.io/pytype/) | |

docs/docs/using-pants/key-concepts/options.mdx

+2-3
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ repo_host = "repo.%(domain)s"
105105
indexes.add = ["https://%(env.PY_REPO)s@%(repo_host)s/index"]
106106
```
107107

108-
Learn more about exporting environment variables in the
109-
[`.pants.bootstrap`](../using-pants/key-concepts/options.mdx#pantsbootstrap-file)) Bash script that is sourced
110-
before Pants runs.
108+
Learn more about exporting environment variables in the [`.pants.bootstrap`](#pantsbootstrap-file))
109+
Bash script that is sourced before Pants runs.
111110

112111
## Option types
113112

src/python/pants/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.20.0.dev7
1+
2.20.0a0

src/python/pants/backend/BUILD

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ __dependents_rules__(
3636
"[/build_files/fmt/yapf/register.py]",
3737
"[/python/lint/black/rules.py]",
3838
"[/python/lint/black/subsystem.py]",
39-
"[/python/lint/ruff/rules.py]",
39+
"[/python/lint/ruff/fmt_rules.py]",
40+
"[/python/lint/ruff/check_rules.py]",
4041
"[/python/lint/ruff/subsystem.py]",
4142
"[/python/lint/yapf/rules.py]",
4243
"[/python/lint/yapf/subsystem.py]",

src/python/pants/backend/build_files/fmt/ruff/integration_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from pants.backend.build_files.fmt.ruff.register import RuffRequest
99
from pants.backend.build_files.fmt.ruff.register import rules as ruff_build_rules
10-
from pants.backend.python.lint.ruff.rules import rules as ruff_fmt_rules
10+
from pants.backend.python.lint.ruff.check_rules import rules as ruff_fmt_rules
1111
from pants.backend.python.lint.ruff.subsystem import Ruff
1212
from pants.backend.python.lint.ruff.subsystem import rules as ruff_subsystem_rules
1313
from pants.backend.python.target_types import PythonSourcesGeneratorTarget

src/python/pants/backend/build_files/fmt/ruff/register.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from pants.backend.build_files.fmt.base import FmtBuildFilesRequest
55
from pants.backend.python.lint.ruff import subsystem as ruff_subsystem
6-
from pants.backend.python.lint.ruff.rules import _run_ruff_fmt
6+
from pants.backend.python.lint.ruff.fmt_rules import _run_ruff_fmt
77
from pants.backend.python.lint.ruff.subsystem import Ruff
88
from pants.backend.python.subsystems.python_tool_base import get_lockfile_interpreter_constraints
99
from pants.core.goals.fmt import FmtResult
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md).
1+
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
22
# Licensed under the Apache License, Version 2.0 (see LICENSE).
33

44
python_sources()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md).
2+
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3+
4+
python_sources()

src/python/pants/backend/experimental/python/lint/ruff/check/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md).
2+
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3+
4+
"""Linter & formatter for Python.
5+
6+
See https://www.pantsbuild.org/docs/python-linters-and-formatters and https://docs.astral.sh/ruff/
7+
"""
8+
9+
from pants.backend.python.lint.ruff import check_rules as ruff_rules
10+
from pants.backend.python.lint.ruff import skip_field, subsystem
11+
12+
13+
def rules():
14+
return (*ruff_rules.rules(), *skip_field.rules(), *subsystem.rules())
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
2+
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3+
4+
python_sources()

src/python/pants/backend/experimental/python/lint/ruff/format/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
2+
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3+
4+
"""Linter & formatter for Python.
5+
6+
See https://www.pantsbuild.org/docs/python-linters-and-formatters and https://docs.astral.sh/ruff/
7+
"""
8+
9+
from pants.backend.python.lint.ruff import fmt_rules as ruff_fmt_rules
10+
from pants.backend.python.lint.ruff import skip_field, subsystem
11+
12+
13+
def rules():
14+
return (*ruff_fmt_rules.rules(), *skip_field.rules(), *subsystem.rules())

src/python/pants/backend/experimental/python/lint/ruff/register.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
See https://www.pantsbuild.org/docs/python-linters-and-formatters and https://docs.astral.sh/ruff/
77
"""
88

9-
from pants.backend.python.lint.ruff import rules as ruff_rules
10-
from pants.backend.python.lint.ruff import skip_field, subsystem
9+
from pants.backend.experimental.python.lint.ruff.check import register as ruff_check
10+
from pants.base.deprecated import warn_or_error
1111

1212

1313
def rules():
14-
return (*ruff_rules.rules(), *skip_field.rules(), *subsystem.rules())
14+
warn_or_error(
15+
"2.23.0.dev0",
16+
"The `pants.backend.experimental.python.lint.ruff` backend",
17+
hint="Use `pants.backend.experimental.python.lint.ruff.check` instead.",
18+
start_version="2.20.0.dev7",
19+
)
20+
return ruff_check.rules()

src/python/pants/backend/go/util_rules/assembly.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,17 @@ def _asm_args(
8686
# See:
8787
# - https://github.com/golang/go/blob/245e95dfabd77f337373bf2d6bb47cd353ad8d74/src/cmd/go/internal/work/gc.go#L370-L372
8888
# - https://github.com/golang/go/blob/245e95dfabd77f337373bf2d6bb47cd353ad8d74/src/cmd/internal/objabi/path.go#L43-L67
89+
# From Go 1.22+ this flag has been removed, since we're already passing the package path, asm can make that determination,
90+
# and there's no need to pass the flag anymore.
91+
# See:
92+
# - https://cs.opensource.google/go/go/+/72946ae8674a295e7485982fe57c65c7142b2c14
8993
maybe_assembling_stdlib_runtime_args = (
9094
["-compiling-runtime"]
91-
if import_path in ("runtime", "reflect", "syscall", "internal/bytealg")
92-
or import_path.startswith("runtime/internal")
95+
if not goroot.is_compatible_version("1.22")
96+
and (
97+
import_path in ("runtime", "reflect", "syscall", "internal/bytealg")
98+
or import_path.startswith("runtime/internal")
99+
)
93100
else []
94101
)
95102

0 commit comments

Comments
 (0)