core-universal4 4.50.4.dev1__tar.gz → 4.50.4.dev3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of core-universal4 might be problematic. Click here for more details.
- {core_universal4-4.50.4.dev1/core_universal4.egg-info → core_universal4-4.50.4.dev3}/PKG-INFO +1 -1
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/applitools/core_universal/built_bins/core-linux +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/applitools/core_universal/built_bins/core-linux-arm64 +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3/core_universal4.egg-info}/PKG-INFO +1 -1
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/SOURCES.txt +1 -0
- core_universal4-4.50.4.dev1/setup.py → core_universal4-4.50.4.dev3/setup-legacy.py +67 -139
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/setup.cfg +1 -1
- core_universal4-4.50.4.dev3/setup.py +153 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/CHANGELOG.md +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/LICENSE +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/MANIFEST.in +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/README.rst +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/applitools/core_universal/__init__.py +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/applitools/core_universal/__main__.py +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/applitools/core_universal/instance.py +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/applitools/core_universal/server.py +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/dependency_links.txt +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/not-zip-safe +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/requires.txt +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Legacy setup.py for restricted environments without wheel package.
|
|
3
|
+
|
|
4
|
+
This setup file:
|
|
5
|
+
- Builds source distributions (sdist) for restricted environments
|
|
6
|
+
- Generates setup.cfg from pyproject.toml during sdist build
|
|
7
|
+
- Removes pyproject.toml from sdist to force legacy mode
|
|
8
|
+
- Uses built_bins/ directory for platform binaries
|
|
9
|
+
- Works without wheel package installed
|
|
10
|
+
- Kept alongside setup.py in sdist for maximum compatibility
|
|
11
|
+
|
|
12
|
+
Binary source:
|
|
13
|
+
- built_bins/ directory containing all platform binaries
|
|
14
|
+
- Makefile prepares this directory before building
|
|
15
|
+
|
|
16
|
+
Usage for building sdist:
|
|
17
|
+
make core_universal/prepare_binaries # Prepare binaries first
|
|
18
|
+
python setup-legacy.py sdist # Build legacy sdist
|
|
19
|
+
|
|
20
|
+
Usage for installing from sdist:
|
|
21
|
+
# If wheel package is available (most environments):
|
|
22
|
+
pip install core_universal4-X.Y.Z.tar.gz
|
|
23
|
+
# This will use setup.py to build and install a wheel
|
|
24
|
+
|
|
25
|
+
# If wheel package is NOT available (truly restricted environments):
|
|
26
|
+
python setup-legacy.py install
|
|
27
|
+
# This will install directly without building a wheel
|
|
28
|
+
|
|
29
|
+
For modern wheel builds from source, use setup.py with `make core_universal/dist`.
|
|
30
|
+
"""
|
|
1
31
|
import os
|
|
2
32
|
import sys
|
|
3
33
|
from shutil import rmtree
|
|
@@ -7,23 +37,8 @@ from setuptools import setup
|
|
|
7
37
|
from setuptools.command.build_py import build_py as _build_py
|
|
8
38
|
from setuptools.command.sdist import sdist as _sdist
|
|
9
39
|
|
|
10
|
-
# Import bdist_wheel only if wheel package is available
|
|
11
|
-
# This allows the package to be built without wheel in restricted environments
|
|
12
|
-
try:
|
|
13
|
-
from setuptools.command.bdist_wheel import bdist_wheel as _bdist_wheel
|
|
14
|
-
|
|
15
|
-
HAS_WHEEL = True
|
|
16
|
-
except ImportError:
|
|
17
|
-
_bdist_wheel = None
|
|
18
|
-
HAS_WHEEL = False
|
|
19
|
-
|
|
20
40
|
PKG_BIN_DIR = "applitools/core_universal/bin"
|
|
21
|
-
|
|
22
|
-
# - Required for: bdist_wheel (wheel builds)
|
|
23
|
-
# - Not required for: sdist (source distributions - uses built_bins/ directly)
|
|
24
|
-
# - Default: applitools/core_universal/built_bins
|
|
25
|
-
# Note: Use 'or' to handle empty string same as unset (CI may set it to "")
|
|
26
|
-
USDK_BUILD_DIR = os.getenv("USDK_BUILD_DIR") or "applitools/core_universal/built_bins"
|
|
41
|
+
PKG_BUILT_BINS_DIR = "applitools/core_universal/built_bins"
|
|
27
42
|
|
|
28
43
|
PLAT_EXECUTABLE = {
|
|
29
44
|
"macosx_10_7_x86_64": "core-macos",
|
|
@@ -42,10 +57,6 @@ def get_included_platforms():
|
|
|
42
57
|
- INCLUDE_PLATFORMS environment variable (comma-separated)
|
|
43
58
|
- --include-platforms command-line argument (comma-separated)
|
|
44
59
|
|
|
45
|
-
Examples:
|
|
46
|
-
INCLUDE_PLATFORMS=manylinux1_x86_64,manylinux2014_aarch64 python setup.py sdist
|
|
47
|
-
python setup.py sdist --include-platforms=manylinux1_x86_64,manylinux2014_aarch64
|
|
48
|
-
|
|
49
60
|
If not specified, all platforms are included.
|
|
50
61
|
"""
|
|
51
62
|
# Check environment variable first
|
|
@@ -67,6 +78,7 @@ def get_included_platforms():
|
|
|
67
78
|
|
|
68
79
|
|
|
69
80
|
def current_plat():
|
|
81
|
+
"""Detect current platform."""
|
|
70
82
|
if platform == "darwin":
|
|
71
83
|
if os.uname().machine == "arm64":
|
|
72
84
|
return "macosx_11_0_arm64"
|
|
@@ -85,7 +97,7 @@ def current_plat():
|
|
|
85
97
|
|
|
86
98
|
|
|
87
99
|
def get_target_platform():
|
|
88
|
-
"""Get the target platform from environment variable
|
|
100
|
+
"""Get the target platform from environment variable or detect current."""
|
|
89
101
|
# Check if PLAT_NAME is specified in environment variable
|
|
90
102
|
if "PLAT_NAME" in os.environ:
|
|
91
103
|
return os.environ["PLAT_NAME"]
|
|
@@ -106,54 +118,32 @@ target_platform = get_target_platform()
|
|
|
106
118
|
selected_executable = PLAT_EXECUTABLE.get(
|
|
107
119
|
target_platform, PLAT_EXECUTABLE[current_plat()]
|
|
108
120
|
)
|
|
109
|
-
commands = set()
|
|
110
121
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
122
|
+
|
|
123
|
+
class build_py(_build_py):
|
|
124
|
+
"""Build command that copies platform binary from built_bins/ directory."""
|
|
125
|
+
|
|
115
126
|
def get_data_files(self):
|
|
116
|
-
#
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if os.path.isdir(PKG_BUILT_BINS_DIR):
|
|
122
|
-
# Installing from sdist - use built_bins/ directory
|
|
123
|
-
source_dir = PKG_BUILT_BINS_DIR
|
|
124
|
-
source_type = "sdist (built_bins/)"
|
|
125
|
-
elif USDK_BUILD_DIR and os.path.isdir(USDK_BUILD_DIR):
|
|
126
|
-
# Building wheel - use USDK_BUILD_DIR
|
|
127
|
-
source_dir = USDK_BUILD_DIR
|
|
128
|
-
source_type = "wheel build (USDK_BUILD_DIR)"
|
|
129
|
-
else:
|
|
130
|
-
# Neither source available - error
|
|
127
|
+
# Legacy builds always use built_bins/ directory (from sdist)
|
|
128
|
+
source_dir = PKG_BUILT_BINS_DIR
|
|
129
|
+
|
|
130
|
+
if not os.path.isdir(source_dir):
|
|
131
131
|
raise RuntimeError(
|
|
132
|
-
f"
|
|
133
|
-
f"
|
|
134
|
-
f"
|
|
135
|
-
f" Status: Not found\n\n"
|
|
136
|
-
f"For building wheels:\n"
|
|
137
|
-
f" Expected: USDK_BUILD_DIR environment variable pointing to binaries\n"
|
|
138
|
-
f" Current value: {USDK_BUILD_DIR!r}\n\n"
|
|
139
|
-
f"To fix this:\n"
|
|
140
|
-
f" 1. If installing from sdist: Ensure built_bins/ directory exists\n"
|
|
141
|
-
f" 2. If building wheel: Set USDK_BUILD_DIR to the directory containing binaries:\n"
|
|
142
|
-
f" export USDK_BUILD_DIR=/path/to/built/binaries\n"
|
|
143
|
-
f" python setup.py bdist_wheel"
|
|
132
|
+
f"Binary source directory not found: {source_dir}\n"
|
|
133
|
+
f"Legacy builds require built_bins/ directory with pre-built binaries.\n"
|
|
134
|
+
f"This directory should be present in the source distribution."
|
|
144
135
|
)
|
|
145
136
|
|
|
146
137
|
if not self.dry_run and os.path.isdir(PKG_BIN_DIR):
|
|
147
138
|
rmtree(PKG_BIN_DIR)
|
|
148
139
|
|
|
149
|
-
# Use os.makedirs instead of self.mkpath for better reliability
|
|
150
140
|
os.makedirs(PKG_BIN_DIR, exist_ok=True)
|
|
151
141
|
|
|
152
142
|
_, ext = os.path.splitext(selected_executable)
|
|
153
143
|
target_name = os.path.join(PKG_BIN_DIR, "core" + ext)
|
|
154
144
|
built_file_name = os.path.join(source_dir, selected_executable)
|
|
155
145
|
|
|
156
|
-
# Verify the source file exists
|
|
146
|
+
# Verify the source file exists
|
|
157
147
|
if not os.path.isfile(built_file_name):
|
|
158
148
|
available_files = (
|
|
159
149
|
", ".join(os.listdir(source_dir))
|
|
@@ -161,112 +151,45 @@ class build_py(_build_py): # noqa
|
|
|
161
151
|
else "N/A"
|
|
162
152
|
)
|
|
163
153
|
raise RuntimeError(
|
|
164
|
-
f"
|
|
165
|
-
f"
|
|
166
|
-
f"
|
|
167
|
-
f"
|
|
168
|
-
f"Available files in {source_dir}:\n"
|
|
169
|
-
f" {available_files}\n\n"
|
|
170
|
-
f"Make sure you have the binary for the target platform."
|
|
154
|
+
f"Binary not found: {built_file_name}\n"
|
|
155
|
+
f"Platform: {target_platform}\n"
|
|
156
|
+
f"Expected: {selected_executable}\n"
|
|
157
|
+
f"Available in {source_dir}: {available_files}"
|
|
171
158
|
)
|
|
172
159
|
|
|
173
|
-
self.announce(f"Copying {selected_executable} from {source_type}", 2)
|
|
174
160
|
self.copy_file(built_file_name, target_name)
|
|
175
161
|
os.chmod(target_name, 0o755)
|
|
176
162
|
return _build_py.get_data_files(self)
|
|
177
163
|
|
|
178
164
|
def run(self):
|
|
179
|
-
"""Run build_py and
|
|
165
|
+
"""Run build_py and remove built_bins from build directory."""
|
|
180
166
|
_build_py.run(self)
|
|
181
|
-
# Remove built_bins from build directory after
|
|
167
|
+
# Remove built_bins from build directory after build completes
|
|
182
168
|
built_bins_in_build = os.path.join(
|
|
183
169
|
self.build_lib, "applitools", "core_universal", "built_bins"
|
|
184
170
|
)
|
|
185
171
|
if os.path.isdir(built_bins_in_build):
|
|
186
|
-
self.announce(f"Removing {built_bins_in_build} from
|
|
172
|
+
self.announce(f"Removing {built_bins_in_build} from build", 2)
|
|
187
173
|
rmtree(built_bins_in_build)
|
|
188
174
|
|
|
189
175
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
# Full bdist_wheel implementation when wheel package is available
|
|
193
|
-
@commands.add
|
|
194
|
-
class bdist_wheel(_bdist_wheel): # noqa
|
|
195
|
-
def finalize_options(self):
|
|
196
|
-
super().finalize_options()
|
|
197
|
-
# Always set the platform name to match the target platform
|
|
198
|
-
self.plat_name = target_platform
|
|
199
|
-
# Also ensure the root_is_pure is False since we have platform-specific binaries
|
|
200
|
-
self.root_is_pure = False
|
|
201
|
-
|
|
202
|
-
def get_tag(self):
|
|
203
|
-
# Force the platform tag to match our target platform
|
|
204
|
-
# Use py3 tag to make wheels compatible with all Python 3.x versions
|
|
205
|
-
impl, abi, plat = super().get_tag()
|
|
206
|
-
return "py3", "none", target_platform
|
|
207
|
-
|
|
208
|
-
else:
|
|
209
|
-
# Stub implementation when wheel package is not available
|
|
210
|
-
# This allows setup.py to work in environments without wheel
|
|
211
|
-
from setuptools import Command
|
|
212
|
-
|
|
213
|
-
@commands.add
|
|
214
|
-
class bdist_wheel(Command): # noqa
|
|
215
|
-
"""Stub bdist_wheel command for environments without wheel package."""
|
|
216
|
-
|
|
217
|
-
description = "create a wheel distribution (requires wheel package)"
|
|
218
|
-
user_options = []
|
|
219
|
-
|
|
220
|
-
def initialize_options(self):
|
|
221
|
-
pass
|
|
222
|
-
|
|
223
|
-
def finalize_options(self):
|
|
224
|
-
pass
|
|
176
|
+
class sdist(_sdist):
|
|
177
|
+
"""Sdist command that generates setup.cfg and removes pyproject.toml."""
|
|
225
178
|
|
|
226
|
-
def run(self):
|
|
227
|
-
raise RuntimeError(
|
|
228
|
-
"bdist_wheel command requires the 'wheel' package. "
|
|
229
|
-
"Install it with: pip install wheel"
|
|
230
|
-
)
|
|
231
|
-
|
|
232
|
-
@staticmethod
|
|
233
|
-
def egg2dist(egginfo_path, distinfo_path):
|
|
234
|
-
"""Stub method to satisfy setuptools dist_info command.
|
|
235
|
-
|
|
236
|
-
This method is called by setuptools when generating metadata.
|
|
237
|
-
Since we're in a restricted environment without wheel, we raise
|
|
238
|
-
a clear error if this is actually invoked during metadata generation.
|
|
239
|
-
|
|
240
|
-
However, for legacy setup.py install mode, this should not be called.
|
|
241
|
-
"""
|
|
242
|
-
raise RuntimeError(
|
|
243
|
-
"egg2dist requires the 'wheel' package. "
|
|
244
|
-
"This error suggests pip is trying to use PEP 517 mode.\n"
|
|
245
|
-
"For restricted environments, use legacy mode:\n"
|
|
246
|
-
" pip install <package> --no-build-isolation --no-use-pep517"
|
|
247
|
-
)
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
@commands.add
|
|
251
|
-
class sdist(_sdist): # noqa
|
|
252
179
|
def make_release_tree(self, base_dir, files):
|
|
253
180
|
# Create the source tree
|
|
254
181
|
super().make_release_tree(base_dir, files)
|
|
255
182
|
|
|
256
|
-
# Generate setup.cfg from pyproject.toml (required for
|
|
257
|
-
# This is needed because we remove pyproject.toml to force legacy mode
|
|
183
|
+
# Generate setup.cfg from pyproject.toml (required for legacy mode)
|
|
258
184
|
try:
|
|
259
|
-
import sys
|
|
260
|
-
|
|
261
185
|
if sys.version_info >= (3, 11):
|
|
262
186
|
import tomllib
|
|
263
187
|
else:
|
|
264
188
|
import tomli as tomllib
|
|
265
189
|
except ImportError:
|
|
266
190
|
raise RuntimeError(
|
|
267
|
-
"Building sdist requires tomllib (Python 3.11+) or tomli package.\n"
|
|
268
|
-
"Install with: pip install tomli
|
|
269
|
-
"This is only needed for building sdist, not for wheels."
|
|
191
|
+
"Building legacy sdist requires tomllib (Python 3.11+) or tomli package.\n"
|
|
192
|
+
"Install with: pip install tomli"
|
|
270
193
|
)
|
|
271
194
|
|
|
272
195
|
with open("pyproject.toml", "rb") as f:
|
|
@@ -314,8 +237,6 @@ tag_date = 0
|
|
|
314
237
|
)
|
|
315
238
|
|
|
316
239
|
# Remove pyproject.toml from source distribution to force legacy mode
|
|
317
|
-
# This ensures pip uses setup.py install instead of PEP 517 build
|
|
318
|
-
# which is required for environments without wheel package
|
|
319
240
|
pyproject_toml = os.path.join(base_dir, "pyproject.toml")
|
|
320
241
|
if os.path.isfile(pyproject_toml):
|
|
321
242
|
self.announce(
|
|
@@ -326,8 +247,6 @@ tag_date = 0
|
|
|
326
247
|
os.remove(pyproject_toml)
|
|
327
248
|
|
|
328
249
|
# Remove bin/ directory from source distribution
|
|
329
|
-
# The universal sdist should only contain built_bins/ with all platform binaries
|
|
330
|
-
# Wheels will create bin/ with platform-specific binary during build
|
|
331
250
|
bin_dir_in_sdist = os.path.join(base_dir, "applitools", "core_universal", "bin")
|
|
332
251
|
if os.path.isdir(bin_dir_in_sdist):
|
|
333
252
|
self.announce(f"Removing {bin_dir_in_sdist} from source distribution", 2)
|
|
@@ -363,5 +282,14 @@ tag_date = 0
|
|
|
363
282
|
2,
|
|
364
283
|
)
|
|
365
284
|
|
|
285
|
+
# Keep both setup.py and setup-legacy.py in sdist
|
|
286
|
+
# - setup.py: For environments that can build wheels (requires wheel package)
|
|
287
|
+
# - setup-legacy.py: For truly restricted environments (Amazon Fire TV)
|
|
288
|
+
# Users can choose which one to use based on their environment
|
|
289
|
+
self.announce(
|
|
290
|
+
"Keeping both setup.py and setup-legacy.py in source distribution",
|
|
291
|
+
2,
|
|
292
|
+
)
|
|
293
|
+
|
|
366
294
|
|
|
367
|
-
setup(cmdclass={
|
|
295
|
+
setup(cmdclass={"build_py": build_py, "sdist": sdist})
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Modern PEP 517 setup.py for core_universal.
|
|
3
|
+
|
|
4
|
+
This setup file:
|
|
5
|
+
- Builds platform-specific wheels for modern environments
|
|
6
|
+
- Uses pyproject.toml for all metadata (PEP 517)
|
|
7
|
+
- Requires wheel package for building wheels
|
|
8
|
+
- Uses built_bins/ directory for platform binaries
|
|
9
|
+
|
|
10
|
+
Binary source:
|
|
11
|
+
- built_bins/ directory containing all platform binaries
|
|
12
|
+
- Makefile prepares this directory before building
|
|
13
|
+
|
|
14
|
+
Usage:
|
|
15
|
+
make core_universal/prepare_binaries # Prepare binaries first
|
|
16
|
+
python -m build --wheel # Build wheels
|
|
17
|
+
|
|
18
|
+
For restricted environments without wheel package, use setup-legacy.py instead.
|
|
19
|
+
"""
|
|
20
|
+
import os
|
|
21
|
+
import sys
|
|
22
|
+
from shutil import rmtree
|
|
23
|
+
from sys import platform
|
|
24
|
+
|
|
25
|
+
from setuptools import setup
|
|
26
|
+
from setuptools.command.bdist_wheel import bdist_wheel as _bdist_wheel
|
|
27
|
+
from setuptools.command.build_py import build_py as _build_py
|
|
28
|
+
|
|
29
|
+
PKG_BIN_DIR = "applitools/core_universal/bin"
|
|
30
|
+
PKG_BUILT_BINS_DIR = "applitools/core_universal/built_bins"
|
|
31
|
+
|
|
32
|
+
PLAT_EXECUTABLE = {
|
|
33
|
+
"macosx_10_7_x86_64": "core-macos",
|
|
34
|
+
"macosx_11_0_arm64": "core-macos-arm64",
|
|
35
|
+
"manylinux1_x86_64": "core-linux",
|
|
36
|
+
"manylinux2014_aarch64": "core-linux-arm64",
|
|
37
|
+
"musllinux_1_2_x86_64": "core-alpine",
|
|
38
|
+
"win_amd64": "core-win.exe",
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def current_plat():
|
|
43
|
+
if platform == "darwin":
|
|
44
|
+
if os.uname().machine == "arm64":
|
|
45
|
+
return "macosx_11_0_arm64"
|
|
46
|
+
return "macosx_10_7_x86_64"
|
|
47
|
+
elif platform == "win32":
|
|
48
|
+
return "win_amd64"
|
|
49
|
+
elif platform in ("linux", "linux2"):
|
|
50
|
+
if os.uname().machine == "aarch64":
|
|
51
|
+
return "manylinux2014_aarch64"
|
|
52
|
+
if os.path.exists("/etc/alpine-release"):
|
|
53
|
+
return "musllinux_1_2_x86_64"
|
|
54
|
+
else:
|
|
55
|
+
return "manylinux1_x86_64"
|
|
56
|
+
else:
|
|
57
|
+
raise Exception("Platform is not supported", platform)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def get_target_platform():
|
|
61
|
+
"""Get the target platform from environment variable or command line arguments."""
|
|
62
|
+
# Check if PLAT_NAME is specified in environment variable
|
|
63
|
+
if "PLAT_NAME" in os.environ:
|
|
64
|
+
return os.environ["PLAT_NAME"]
|
|
65
|
+
|
|
66
|
+
# Check if --plat-name is specified in command line arguments
|
|
67
|
+
for i, arg in enumerate(sys.argv):
|
|
68
|
+
if arg == "--plat-name" and i + 1 < len(sys.argv):
|
|
69
|
+
return sys.argv[i + 1]
|
|
70
|
+
elif arg.startswith("--plat-name="):
|
|
71
|
+
return arg.split("=", 1)[1]
|
|
72
|
+
|
|
73
|
+
# Fall back to current platform
|
|
74
|
+
return current_plat()
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# Select executable based on target platform
|
|
78
|
+
target_platform = get_target_platform()
|
|
79
|
+
selected_executable = PLAT_EXECUTABLE.get(
|
|
80
|
+
target_platform, PLAT_EXECUTABLE[current_plat()]
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class build_py(_build_py):
|
|
85
|
+
"""Build command that copies platform binary from built_bins/ directory."""
|
|
86
|
+
|
|
87
|
+
def get_data_files(self):
|
|
88
|
+
# Check if binary source directory exists
|
|
89
|
+
if not os.path.isdir(PKG_BUILT_BINS_DIR):
|
|
90
|
+
raise RuntimeError(
|
|
91
|
+
f"Binary source directory not found: {PKG_BUILT_BINS_DIR}\n"
|
|
92
|
+
f"Run 'make core_universal/prepare_binaries' to prepare binaries before building.\n\n"
|
|
93
|
+
f"For source installs without wheel package, use setup-legacy.py instead."
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
if not self.dry_run and os.path.isdir(PKG_BIN_DIR):
|
|
97
|
+
rmtree(PKG_BIN_DIR)
|
|
98
|
+
|
|
99
|
+
os.makedirs(PKG_BIN_DIR, exist_ok=True)
|
|
100
|
+
|
|
101
|
+
_, ext = os.path.splitext(selected_executable)
|
|
102
|
+
target_name = os.path.join(PKG_BIN_DIR, "core" + ext)
|
|
103
|
+
built_file_name = os.path.join(PKG_BUILT_BINS_DIR, selected_executable)
|
|
104
|
+
|
|
105
|
+
# Verify the source file exists
|
|
106
|
+
if not os.path.isfile(built_file_name):
|
|
107
|
+
available_files = (
|
|
108
|
+
", ".join(os.listdir(PKG_BUILT_BINS_DIR))
|
|
109
|
+
if os.path.isdir(PKG_BUILT_BINS_DIR)
|
|
110
|
+
else "N/A"
|
|
111
|
+
)
|
|
112
|
+
raise RuntimeError(
|
|
113
|
+
f"Binary not found: {built_file_name}\n"
|
|
114
|
+
f"Platform: {target_platform}\n"
|
|
115
|
+
f"Expected: {selected_executable}\n"
|
|
116
|
+
f"Available in {PKG_BUILT_BINS_DIR}: {available_files}\n\n"
|
|
117
|
+
f"Run 'make core_universal/prepare_binaries' to prepare all platform binaries."
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
self.copy_file(built_file_name, target_name)
|
|
121
|
+
os.chmod(target_name, 0o755)
|
|
122
|
+
return _build_py.get_data_files(self)
|
|
123
|
+
|
|
124
|
+
def run(self):
|
|
125
|
+
"""Run build_py and clean up built_bins directory."""
|
|
126
|
+
_build_py.run(self)
|
|
127
|
+
# Remove built_bins from build directory (wheels should only contain bin/)
|
|
128
|
+
built_bins_in_build = os.path.join(
|
|
129
|
+
self.build_lib, "applitools", "core_universal", "built_bins"
|
|
130
|
+
)
|
|
131
|
+
if os.path.isdir(built_bins_in_build):
|
|
132
|
+
self.announce(f"Removing {built_bins_in_build} from wheel build", 2)
|
|
133
|
+
rmtree(built_bins_in_build)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
class bdist_wheel(_bdist_wheel):
|
|
137
|
+
"""Custom bdist_wheel to set platform-specific tags."""
|
|
138
|
+
|
|
139
|
+
def finalize_options(self):
|
|
140
|
+
super().finalize_options()
|
|
141
|
+
# Always set the platform name to match the target platform
|
|
142
|
+
self.plat_name = target_platform
|
|
143
|
+
# Ensure root_is_pure is False since we have platform-specific binaries
|
|
144
|
+
self.root_is_pure = False
|
|
145
|
+
|
|
146
|
+
def get_tag(self):
|
|
147
|
+
# Force the platform tag to match our target platform
|
|
148
|
+
# Use py3 tag to make wheels compatible with all Python 3.x versions
|
|
149
|
+
impl, abi, plat = super().get_tag()
|
|
150
|
+
return "py3", "none", target_platform
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
setup(cmdclass={"build_py": build_py, "bdist_wheel": bdist_wheel})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/applitools/core_universal/__init__.py
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/applitools/core_universal/__main__.py
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/applitools/core_universal/instance.py
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/applitools/core_universal/server.py
RENAMED
|
File without changes
|
|
File without changes
|
{core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/requires.txt
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/top_level.txt
RENAMED
|
File without changes
|