core-universal4 4.50.4.dev1__tar.gz → 4.50.4.dev2__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.dev2}/PKG-INFO +1 -1
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/applitools/core_universal/built_bins/core-linux +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/applitools/core_universal/built_bins/core-linux-arm64 +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2/core_universal4.egg-info}/PKG-INFO +1 -1
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/core_universal4.egg-info/SOURCES.txt +1 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/setup.cfg +1 -1
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/setup.py +72 -139
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/CHANGELOG.md +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/LICENSE +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/MANIFEST.in +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/README.rst +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/applitools/core_universal/__init__.py +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/applitools/core_universal/__main__.py +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/applitools/core_universal/instance.py +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/applitools/core_universal/server.py +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/core_universal4.egg-info/dependency_links.txt +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/core_universal4.egg-info/not-zip-safe +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/core_universal4.egg-info/requires.txt +0 -0
- {core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/core_universal4.egg-info/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +1,23 @@
|
|
|
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
|
+
|
|
11
|
+
Binary source:
|
|
12
|
+
- built_bins/ directory containing all platform binaries
|
|
13
|
+
- Makefile prepares this directory before building
|
|
14
|
+
|
|
15
|
+
Usage:
|
|
16
|
+
make core_universal/prepare_binaries # Prepare binaries first
|
|
17
|
+
python setup-legacy.py sdist # Build legacy sdist
|
|
18
|
+
|
|
19
|
+
For modern wheel builds, use setup.py with `make core_universal/dist`.
|
|
20
|
+
"""
|
|
1
21
|
import os
|
|
2
22
|
import sys
|
|
3
23
|
from shutil import rmtree
|
|
@@ -7,23 +27,8 @@ from setuptools import setup
|
|
|
7
27
|
from setuptools.command.build_py import build_py as _build_py
|
|
8
28
|
from setuptools.command.sdist import sdist as _sdist
|
|
9
29
|
|
|
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
30
|
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"
|
|
31
|
+
PKG_BUILT_BINS_DIR = "applitools/core_universal/built_bins"
|
|
27
32
|
|
|
28
33
|
PLAT_EXECUTABLE = {
|
|
29
34
|
"macosx_10_7_x86_64": "core-macos",
|
|
@@ -42,10 +47,6 @@ def get_included_platforms():
|
|
|
42
47
|
- INCLUDE_PLATFORMS environment variable (comma-separated)
|
|
43
48
|
- --include-platforms command-line argument (comma-separated)
|
|
44
49
|
|
|
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
50
|
If not specified, all platforms are included.
|
|
50
51
|
"""
|
|
51
52
|
# Check environment variable first
|
|
@@ -67,6 +68,7 @@ def get_included_platforms():
|
|
|
67
68
|
|
|
68
69
|
|
|
69
70
|
def current_plat():
|
|
71
|
+
"""Detect current platform."""
|
|
70
72
|
if platform == "darwin":
|
|
71
73
|
if os.uname().machine == "arm64":
|
|
72
74
|
return "macosx_11_0_arm64"
|
|
@@ -85,7 +87,7 @@ def current_plat():
|
|
|
85
87
|
|
|
86
88
|
|
|
87
89
|
def get_target_platform():
|
|
88
|
-
"""Get the target platform from environment variable
|
|
90
|
+
"""Get the target platform from environment variable or detect current."""
|
|
89
91
|
# Check if PLAT_NAME is specified in environment variable
|
|
90
92
|
if "PLAT_NAME" in os.environ:
|
|
91
93
|
return os.environ["PLAT_NAME"]
|
|
@@ -106,54 +108,32 @@ target_platform = get_target_platform()
|
|
|
106
108
|
selected_executable = PLAT_EXECUTABLE.get(
|
|
107
109
|
target_platform, PLAT_EXECUTABLE[current_plat()]
|
|
108
110
|
)
|
|
109
|
-
commands = set()
|
|
110
111
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
|
|
113
|
+
class build_py(_build_py):
|
|
114
|
+
"""Build command that copies platform binary from built_bins/ directory."""
|
|
115
|
+
|
|
115
116
|
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
|
|
117
|
+
# Legacy builds always use built_bins/ directory (from sdist)
|
|
118
|
+
source_dir = PKG_BUILT_BINS_DIR
|
|
119
|
+
|
|
120
|
+
if not os.path.isdir(source_dir):
|
|
131
121
|
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"
|
|
122
|
+
f"Binary source directory not found: {source_dir}\n"
|
|
123
|
+
f"Legacy builds require built_bins/ directory with pre-built binaries.\n"
|
|
124
|
+
f"This directory should be present in the source distribution."
|
|
144
125
|
)
|
|
145
126
|
|
|
146
127
|
if not self.dry_run and os.path.isdir(PKG_BIN_DIR):
|
|
147
128
|
rmtree(PKG_BIN_DIR)
|
|
148
129
|
|
|
149
|
-
# Use os.makedirs instead of self.mkpath for better reliability
|
|
150
130
|
os.makedirs(PKG_BIN_DIR, exist_ok=True)
|
|
151
131
|
|
|
152
132
|
_, ext = os.path.splitext(selected_executable)
|
|
153
133
|
target_name = os.path.join(PKG_BIN_DIR, "core" + ext)
|
|
154
134
|
built_file_name = os.path.join(source_dir, selected_executable)
|
|
155
135
|
|
|
156
|
-
# Verify the source file exists
|
|
136
|
+
# Verify the source file exists
|
|
157
137
|
if not os.path.isfile(built_file_name):
|
|
158
138
|
available_files = (
|
|
159
139
|
", ".join(os.listdir(source_dir))
|
|
@@ -161,112 +141,45 @@ class build_py(_build_py): # noqa
|
|
|
161
141
|
else "N/A"
|
|
162
142
|
)
|
|
163
143
|
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."
|
|
144
|
+
f"Binary not found: {built_file_name}\n"
|
|
145
|
+
f"Platform: {target_platform}\n"
|
|
146
|
+
f"Expected: {selected_executable}\n"
|
|
147
|
+
f"Available in {source_dir}: {available_files}"
|
|
171
148
|
)
|
|
172
149
|
|
|
173
|
-
self.announce(f"Copying {selected_executable} from {source_type}", 2)
|
|
174
150
|
self.copy_file(built_file_name, target_name)
|
|
175
151
|
os.chmod(target_name, 0o755)
|
|
176
152
|
return _build_py.get_data_files(self)
|
|
177
153
|
|
|
178
154
|
def run(self):
|
|
179
|
-
"""Run build_py and
|
|
155
|
+
"""Run build_py and remove built_bins from build directory."""
|
|
180
156
|
_build_py.run(self)
|
|
181
|
-
# Remove built_bins from build directory after
|
|
157
|
+
# Remove built_bins from build directory after build completes
|
|
182
158
|
built_bins_in_build = os.path.join(
|
|
183
159
|
self.build_lib, "applitools", "core_universal", "built_bins"
|
|
184
160
|
)
|
|
185
161
|
if os.path.isdir(built_bins_in_build):
|
|
186
|
-
self.announce(f"Removing {built_bins_in_build} from
|
|
162
|
+
self.announce(f"Removing {built_bins_in_build} from build", 2)
|
|
187
163
|
rmtree(built_bins_in_build)
|
|
188
164
|
|
|
189
165
|
|
|
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
|
|
166
|
+
class sdist(_sdist):
|
|
167
|
+
"""Sdist command that generates setup.cfg and removes pyproject.toml."""
|
|
212
168
|
|
|
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
|
|
225
|
-
|
|
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
169
|
def make_release_tree(self, base_dir, files):
|
|
253
170
|
# Create the source tree
|
|
254
171
|
super().make_release_tree(base_dir, files)
|
|
255
172
|
|
|
256
|
-
# Generate setup.cfg from pyproject.toml (required for
|
|
257
|
-
# This is needed because we remove pyproject.toml to force legacy mode
|
|
173
|
+
# Generate setup.cfg from pyproject.toml (required for legacy mode)
|
|
258
174
|
try:
|
|
259
|
-
import sys
|
|
260
|
-
|
|
261
175
|
if sys.version_info >= (3, 11):
|
|
262
176
|
import tomllib
|
|
263
177
|
else:
|
|
264
178
|
import tomli as tomllib
|
|
265
179
|
except ImportError:
|
|
266
180
|
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."
|
|
181
|
+
"Building legacy sdist requires tomllib (Python 3.11+) or tomli package.\n"
|
|
182
|
+
"Install with: pip install tomli"
|
|
270
183
|
)
|
|
271
184
|
|
|
272
185
|
with open("pyproject.toml", "rb") as f:
|
|
@@ -314,8 +227,6 @@ tag_date = 0
|
|
|
314
227
|
)
|
|
315
228
|
|
|
316
229
|
# 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
230
|
pyproject_toml = os.path.join(base_dir, "pyproject.toml")
|
|
320
231
|
if os.path.isfile(pyproject_toml):
|
|
321
232
|
self.announce(
|
|
@@ -326,8 +237,6 @@ tag_date = 0
|
|
|
326
237
|
os.remove(pyproject_toml)
|
|
327
238
|
|
|
328
239
|
# 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
240
|
bin_dir_in_sdist = os.path.join(base_dir, "applitools", "core_universal", "bin")
|
|
332
241
|
if os.path.isdir(bin_dir_in_sdist):
|
|
333
242
|
self.announce(f"Removing {bin_dir_in_sdist} from source distribution", 2)
|
|
@@ -363,5 +272,29 @@ tag_date = 0
|
|
|
363
272
|
2,
|
|
364
273
|
)
|
|
365
274
|
|
|
275
|
+
# Replace modern setup.py with setup-legacy.py for restricted environment compatibility
|
|
276
|
+
# The modern setup.py imports wheel directly and will fail in restricted environments
|
|
277
|
+
modern_setup_py = os.path.join(base_dir, "setup.py")
|
|
278
|
+
legacy_setup_py = os.path.join(base_dir, "setup-legacy.py")
|
|
279
|
+
|
|
280
|
+
if os.path.isfile(modern_setup_py) and os.path.isfile(legacy_setup_py):
|
|
281
|
+
self.announce(
|
|
282
|
+
f"Replacing {modern_setup_py} with {legacy_setup_py} "
|
|
283
|
+
"(modern setup.py requires wheel package)",
|
|
284
|
+
2,
|
|
285
|
+
)
|
|
286
|
+
# Copy setup-legacy.py content to setup.py
|
|
287
|
+
import shutil
|
|
288
|
+
|
|
289
|
+
shutil.copy2(legacy_setup_py, modern_setup_py)
|
|
290
|
+
|
|
291
|
+
# Remove setup-legacy.py from sdist (setup.py now contains the legacy code)
|
|
292
|
+
self.announce(
|
|
293
|
+
f"Removing {legacy_setup_py} from source distribution "
|
|
294
|
+
"(setup.py already contains legacy implementation)",
|
|
295
|
+
2,
|
|
296
|
+
)
|
|
297
|
+
os.remove(legacy_setup_py)
|
|
298
|
+
|
|
366
299
|
|
|
367
|
-
setup(cmdclass={
|
|
300
|
+
setup(cmdclass={"build_py": build_py, "sdist": sdist})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/applitools/core_universal/__init__.py
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/applitools/core_universal/__main__.py
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/applitools/core_universal/instance.py
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/applitools/core_universal/server.py
RENAMED
|
File without changes
|
|
File without changes
|
{core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/core_universal4.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/core_universal4.egg-info/requires.txt
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev1 → core_universal4-4.50.4.dev2}/core_universal4.egg-info/top_level.txt
RENAMED
|
File without changes
|