forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_wheels.py
58 lines (56 loc) · 1.74 KB
/
test_wheels.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import glob
import os
import platform
import shutil
import subprocess
import sys
if os.name == "nt":
py_ver = platform.python_version()
is_32_bit = os.getenv("IS_32_BIT") == "true"
try:
wheel_dir = sys.argv[1]
wheel_path = glob.glob(f"{wheel_dir}/*.whl")[0]
except IndexError:
# Not passed
wheel_path = None
print(f"IS_32_BIT is {is_32_bit}")
print(f"Path to built wheel is {wheel_path}")
if is_32_bit:
sys.exit(0) # No way to test Windows 32-bit(no docker image)
if wheel_path is None:
raise ValueError("Wheel path must be passed in if on 64-bit Windows")
print(f"Pulling docker image to test Windows 64-bit Python {py_ver}")
subprocess.run(f"docker pull python:{py_ver}-windowsservercore", check=True)
pandas_base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
print(f"pandas project dir is {pandas_base_dir}")
dist_dir = os.path.join(pandas_base_dir, "dist")
print(f"Copying wheel into pandas_base_dir/dist ({dist_dir})")
os.mkdir(dist_dir)
shutil.copy(wheel_path, dist_dir)
print(os.listdir(dist_dir))
subprocess.run(
rf"docker run -v %cd%:c:\pandas "
f"python:{py_ver}-windowsservercore /pandas/ci/test_wheels_windows.bat",
check=True,
shell=True,
cwd=pandas_base_dir,
)
else:
import pandas as pd
pd.test(
extra_args=[
"-m not clipboard and not single_cpu",
"--skip-slow",
"--skip-network",
"--skip-db",
"-n=2",
]
)
pd.test(
extra_args=[
"-m not clipboard and single_cpu",
"--skip-slow",
"--skip-network",
"--skip-db",
]
)