• 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

90.91
/src/python/pants/vcs/hunk.py
1
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3
from dataclasses import dataclass
11✔
4

5
from pants.engine.collection import Collection
11✔
6

7

8
@dataclass(frozen=True)
11✔
9
class TextBlock:
11✔
10
    """Block of lines in a file.
11

12
    Lines are 1 indexed, `start` is inclusive.
13

14
    TextBlock is used as a part of unified diff hunk, thus it can be empty,
15
    i.e. count can be equal to 0. In the special case when the file is empty
16
    start = 0 and count = 0.
17
    """
18

19
    start: int
11✔
20
    count: int
11✔
21

22
    def __init__(self, start: int, count: int):
11✔
23
        object.__setattr__(self, "start", start)
1✔
24
        object.__setattr__(self, "count", count)
1✔
25

26
        self.__post_init__()
1✔
27

28
    def __post_init__(self):
11✔
29
        if self.count < 0:
1✔
30
            raise ValueError(f"{self.count=} can't be negative")
×
31

32
    @property
11✔
33
    def end(self) -> int:
11✔
UNCOV
34
        return self.start + self.count
×
35

36

37
class TextBlocks(Collection[TextBlock]):
11✔
38
    pass
11✔
39

40

41
@dataclass(frozen=True)
11✔
42
class Hunk:
11✔
43
    """Hunk of difference in unified format.
44

45
    https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html
46

47
    In the special case when file is created left = None.
48
    In the special case when file is deleted right = None.
49
    """
50

51
    left: TextBlock | None
11✔
52
    right: TextBlock | None
11✔
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