• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 20147226056

11 Dec 2025 08:58PM UTC coverage: 78.827% (-1.5%) from 80.293%
20147226056

push

github

web-flow
Forwarded the `style` and `complete-platform` args from pants.toml to PEX (#22910)

## Context

After Apple switched to the `arm64` architecture, some package
publishers stopped releasing `x86_64` variants of their packages for
`darwin`. As a result, generating a universal lockfile now fails because
no single package version is compatible with both `x86_64` and `arm64`
on `darwin`.

The solution is to use the `--style` and `--complete-platform` flags
with PEX. For example:
```
pex3 lock create \
    --style strict \
    --complete-platform 3rdparty/platforms/manylinux_2_28_aarch64.json \
    --complete-platform 3rdparty/platforms/macosx_26_0_arm64.json \
    -r 3rdparty/python/requirements_pyarrow.txt \
    -o python-pyarrow.lock
```

See the Slack discussion here:
https://pantsbuild.slack.com/archives/C046T6T9U/p1760098582461759

## Reproduction

* `BUILD`
```
python_requirement(
    name="awswrangler",
    requirements=["awswrangler==3.12.1"],
    resolve="awswrangler",
)
```
* Run `pants generate-lockfiles --resolve=awswrangler` on macOS with an
`arm64` CPU
```
pip: ERROR: Cannot install awswrangler==3.12.1 because these package versions have conflicting dependencies.
pip: ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
pip:  
pip:  The conflict is caused by:
pip:      awswrangler 3.12.1 depends on pyarrow<18.0.0 and >=8.0.0; sys_platform == "darwin" and platform_machine == "x86_64"
pip:      awswrangler 3.12.1 depends on pyarrow<21.0.0 and >=18.0.0; sys_platform != "darwin" or platform_machine != "x86_64"
pip:  
pip:  Additionally, some packages in these conflicts have no matching distributions available for your environment:
pip:      pyarrow
pip:  
pip:  To fix this you could try to:
pip:  1. loosen the range of package versions you've specified
pip:  2. remove package versions to allow pip to attempt to solve the dependency conflict
```

## Implementation
... (continued)

77 of 100 new or added lines in 6 files covered. (77.0%)

868 existing lines in 42 files now uncovered.

74471 of 94474 relevant lines covered (78.83%)

3.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/python/pants/backend/javascript/lint/prettier/subsystem.py
1
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

UNCOV
4
from __future__ import annotations
×
5

UNCOV
6
import os
×
UNCOV
7
from collections.abc import Iterable
×
8

UNCOV
9
from pants.backend.javascript.subsystems.nodejs_tool import NodeJSToolBase
×
UNCOV
10
from pants.core.util_rules.config_files import ConfigFilesRequest
×
UNCOV
11
from pants.option.option_types import ArgsListOption, SkipOption
×
UNCOV
12
from pants.util.strutil import help_text
×
13

14

UNCOV
15
class Prettier(NodeJSToolBase):
×
UNCOV
16
    options_scope = "prettier"
×
UNCOV
17
    name = "Prettier"
×
UNCOV
18
    help = help_text(
×
19
        """
20
        The Prettier utility for formatting JS/TS (and others) code
21
        (https://prettier.io/).
22
        """
23
    )
24

UNCOV
25
    default_version = "prettier@3.6.2"
×
26

UNCOV
27
    skip = SkipOption("fmt", "lint")
×
UNCOV
28
    args = ArgsListOption(example="--version")
×
29

UNCOV
30
    def config_request(self, dirs: Iterable[str]) -> ConfigFilesRequest:
×
31
        """Prettier will use the closest configuration file to the file currently being formatted,
32
        so add all of them In the event of multiple configuration files, Prettier has an order of
33
        precedence specified here: https://prettier.io/docs/en/configuration.html."""
34

35
        config_files = (
×
36
            *[f"prettier.config{ext}" for ext in [".js", ".cjs"]],
37
            *[
38
                f".prettierrc{ext}"
39
                for ext in [
40
                    "",
41
                    ".json",
42
                    ".yml",
43
                    ".yaml",
44
                    ".json5",
45
                    ".js",
46
                    ".cjs",
47
                    ".toml",
48
                ]
49
            ],
50
        )
51
        check_existence = [os.path.join(d, file) for file in config_files for d in ("", *dirs)]
×
52
        return ConfigFilesRequest(
×
53
            discovery=True,
54
            check_existence=check_existence,
55
        )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc