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

pantsbuild / pants / 18198316586

02 Oct 2025 03:50PM UTC coverage: 78.82% (-1.4%) from 80.265%
18198316586

push

github

web-flow
Bump serde from 1.0.226 to 1.0.228 in /src/rust (#22723)

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.226 to
1.0.228.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/serde/releases">serde's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.228</h2>
<ul>
<li>Allow building documentation with
<code>RUSTDOCFLAGS='--cfg=docsrs'</code> set for the whole dependency
graph (<a
href="https://redirect.github.com/serde-rs/serde/issues/2995">#2995</a>)</li>
</ul>
<h2>v1.0.227</h2>
<ul>
<li>Documentation improvements (<a
href="https://redirect.github.com/serde-rs/serde/issues/2991">#2991</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/serde-rs/serde/commit/a866b336f"><code>a866b33</code></a>
Release 1.0.228</li>
<li><a
href="https://github.com/serde-rs/serde/commit/5adc9e816"><code>5adc9e8</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2995">#2995</a>
from dtolnay/rustdocflags</li>
<li><a
href="https://github.com/serde-rs/serde/commit/ab581789f"><code>ab58178</code></a>
Workaround for RUSTDOCFLAGS='--cfg=docsrs'</li>
<li><a
href="https://github.com/serde-rs/serde/commit/415d9fc56"><code>415d9fc</code></a>
Release 1.0.227</li>
<li><a
href="https://github.com/serde-rs/serde/commit/7c58427e1"><code>7c58427</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2991">#2991</a>
from dtolnay/inlinecoredoc</li>
<li><a
href="https://github.com/serde-rs/serde/commit/9d3410e3f"><code>9d3410e</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2992">#2992</a>
from dtolnay/inplaceseed</li>
<li><a
href="https://github.com/serde-rs/serde/commit/2fb6748bf1ff93... (continued)

73576 of 93347 relevant lines covered (78.82%)

2.9 hits per line

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

52.73
/src/python/pants/backend/python/goals/package_dists_integration_test.py
1
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
1✔
5

6
import hashlib
1✔
7
import os
1✔
8
import subprocess
1✔
9
import sys
1✔
10
import venv
1✔
11
from pathlib import Path
1✔
12
from tempfile import TemporaryDirectory
1✔
13
from textwrap import dedent
1✔
14

15
import pytest
1✔
16

17
from pants.testutil.pants_integration_test import run_pants, setup_tmpdir
1✔
18
from pants.util.dirutil import safe_rmtree
1✔
19

20

21
@pytest.mark.platform_specific_behavior
1✔
22
def test_native_code() -> None:
1✔
23
    dist_dir = "dist"
1✔
24
    pyver = f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
1✔
25

26
    pants_run = run_pants(
1✔
27
        [
28
            "--backend-packages=pants.backend.python",
29
            f"--python-interpreter-constraints=['=={pyver}']",
30
            "package",
31
            "testprojects/src/python/native:dist",
32
        ],
33
        extra_env={"PYTHON": sys.executable},
34
    )
35
    pants_run.assert_success()
1✔
36
    wheels = os.listdir(dist_dir)
1✔
37
    assert len(wheels) == 1
1✔
38
    wheel = os.path.join(dist_dir, wheels[0])
1✔
39

40
    with TemporaryDirectory() as venvdir:
1✔
41
        venv.create(venvdir, with_pip=True, clear=True, symlinks=True)
1✔
42
        subprocess.run([os.path.join(venvdir, "bin", "pip"), "install", wheel], check=True)
1✔
43
        proc = subprocess.run(
1✔
44
            [
45
                os.path.join(venvdir, "bin", "python"),
46
                "-c",
47
                "from native import name; print(name.get_name())",
48
            ],
49
            check=True,
50
            capture_output=True,
51
        )
52
        assert proc.stdout == b"Professor Native\n"
1✔
53

54

55
def package_determinism(expected_artifact_count: int, files: dict[str, str]) -> None:
1✔
56
    """Tests that the given sources can be `package`d reproducibly."""
57

58
    def digest(path: str) -> tuple[str, str]:
×
59
        d = hashlib.sha256(Path(path).read_bytes()).hexdigest()
×
60
        return path, d
×
61

62
    def run_and_digest(address: str) -> dict[str, str]:
×
63
        safe_rmtree("dist")
×
64
        pants_run = run_pants(
×
65
            [
66
                "--backend-packages=pants.backend.python",
67
                "--no-pantsd",
68
                "package",
69
                address,
70
            ],
71
        )
72
        pants_run.assert_success()
×
73
        return dict(digest(os.path.join("dist", f)) for f in os.listdir("dist"))
×
74

75
    with setup_tmpdir(files) as source_dir:
×
76
        one = run_and_digest(f"{source_dir}:dist")
×
77
        two = run_and_digest(f"{source_dir}:dist")
×
78

79
    assert len(one) == expected_artifact_count
×
80
    assert one == two
×
81

82

83
def test_deterministic_package_data() -> None:
1✔
84
    package_determinism(
×
85
        2,
86
        {
87
            "BUILD": dedent(
88
                """\
89
                python_distribution(
90
                    name="dist",
91
                    dependencies=["{tmpdir}/a", "{tmpdir}/b"],
92
                    provides=python_artifact(name="det", version="2.3.4"),
93
                )
94
                """
95
            ),
96
            "a/BUILD": dedent(
97
                """\
98
                python_sources(dependencies=[":resources"])
99
                resources(name="resources", sources=["*.txt"])
100
                """
101
            ),
102
            "a/source.py": "",
103
            "a/a.txt": "",
104
            "b/BUILD": dedent(
105
                """\
106
                python_sources(dependencies=[":resources"])
107
                resources(name="resources", sources=["*.txt"])
108
                """
109
            ),
110
            "b/source.py": "",
111
            "b/b.txt": "",
112
        },
113
    )
114

115

116
def test_output_path() -> None:
1✔
117
    dist_dir = "dist"
×
118
    output_path = os.path.join("nondefault", "output_dir")
×
119
    files = {
×
120
        "foo/BUILD": dedent(
121
            f"""\
122
            python_sources()
123

124
            python_distribution(
125
                name="dist",
126
                dependencies=[":foo"],
127
                provides=python_artifact(name="foo", version="2.3.4"),
128
                output_path="{output_path}"
129
            )
130
            """
131
        ),
132
        "foo/source.py": "",
133
    }
134
    pyver = f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
×
135

136
    with setup_tmpdir(files) as source_dir:
×
137
        pants_run = run_pants(
×
138
            [
139
                "--backend-packages=pants.backend.python",
140
                f"--python-interpreter-constraints=['=={pyver}']",
141
                "package",
142
                f"{source_dir}/foo:dist",
143
            ],
144
            extra_env={"PYTHON": sys.executable},
145
        )
146
        pants_run.assert_success()
×
147
        dist_output_path = os.path.join(dist_dir, output_path)
×
148
        dist_entries = os.listdir(os.path.join(dist_dir, output_path))
×
149
        assert len(dist_entries) == 2
×
150
        for entry in dist_entries:
×
151
            assert os.path.isfile(os.path.join(dist_output_path, entry))
×
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