Skip to content

Commit

Permalink
wip smoke
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Dec 22, 2024
1 parent 7928805 commit 1a74f3f
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions mingw_smoketests.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,18 +283,18 @@ def test_site(self):
self.assertEqual(len(site.getsitepackages()), 1)

def test_c_ext_build(self):
# This will not work in in-tree build
if sysconfig.is_python_build():
raise unittest.SkipTest("in-tree build")

import tempfile
import sys
import subprocess
import textwrap
import venv
from pathlib import Path

with tempfile.TemporaryDirectory() as tmppro:
subprocess.check_call([sys.executable, "-m", "ensurepip", "--user"])
builder = venv.EnvBuilder(with_pip=True)
builder.create(tmppro)
venv_exe = os.path.join(tmppro, "bin", os.path.basename(sys.executable))

with Path(tmppro, "setup.py").open("w") as f:
f.write(
textwrap.dedent(
Expand Down Expand Up @@ -346,28 +346,19 @@ def test_c_ext_build(self):
)
)
subprocess.check_call(
[sys.executable, "-c", "import struct"],
)
subprocess.check_call(
[
sys.executable,
"-m",
"pip",
"install",
"wheel",
],
[venv_exe, "-c", "import struct"],
)
subprocess.check_call(
[
sys.executable,
venv_exe,
"-m",
"pip",
"install",
tmppro,
],
)
subprocess.check_call(
[sys.executable, "-c", "import cwrapper"],
[venv_exe, "-c", "import cwrapper"],
)


Expand Down

0 comments on commit 1a74f3f

Please sign in to comment.