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

pantsbuild / pants / 19015773527

02 Nov 2025 05:33PM UTC coverage: 17.872% (-62.4%) from 80.3%
19015773527

Pull #22816

github

web-flow
Merge a12d75757 into 6c024e162
Pull Request #22816: Update Pants internal Python to 3.14

4 of 5 new or added lines in 3 files covered. (80.0%)

28452 existing lines in 683 files now uncovered.

9831 of 55007 relevant lines covered (17.87%)

0.18 hits per line

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

63.64
/src/python/pants/backend/python/typecheck/mypy/mypyc_integration_test.py
1
# Copyright 2022 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 os
1✔
7
import subprocess
1✔
8
import sys
1✔
9
import venv
1✔
10
from tempfile import TemporaryDirectory
1✔
11

12
import pytest
1✔
13

14
from pants.testutil.pants_integration_test import run_pants
1✔
15

16

17
@pytest.mark.platform_specific_behavior
1✔
18
def test_mypyc_build() -> None:
1✔
19
    dist_dir = "dist"
1✔
20
    pyver = f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
1✔
21

22
    pants_run = run_pants(
1✔
23
        [
24
            "--backend-packages=['pants.backend.python','pants.backend.python.typecheck.mypy']",
25
            f"--python-interpreter-constraints=['=={pyver}']",
26
            # mypy>=1.15.0 searches up the filesystem for config, and it will find our root
27
            # pyproject.toml and try to load the plugins specified there, but fail, since they
28
            # aren't in the default lockfile. So we hide the pyproject.toml from this run.
29
            "--pants-ignore=pyproject.toml",
30
            "package",
31
            "testprojects/src/python/mypyc_fib:dist",
32
        ],
33
        extra_env={"PYTHON": sys.executable},
34
    )
35
    pants_run.assert_success()
1✔
UNCOV
36
    wheels = os.listdir(dist_dir)
×
UNCOV
37
    assert len(wheels) == 1
×
UNCOV
38
    wheel = os.path.join(dist_dir, wheels[0])
×
39

UNCOV
40
    with TemporaryDirectory() as venvdir:
×
UNCOV
41
        venv.create(venvdir, with_pip=True, clear=True, symlinks=True)
×
UNCOV
42
        subprocess.run([os.path.join(venvdir, "bin", "pip"), "install", wheel], check=True)
×
UNCOV
43
        proc = subprocess.run(
×
44
            [
45
                os.path.join(venvdir, "bin", "python"),
46
                "-c",
47
                "import mypyc_fib.fib",
48
            ],
49
            check=True,
50
            capture_output=True,
51
        )
UNCOV
52
        assert proc.stdout.splitlines(keepends=False)[0] == b"compiled"
×
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