core-universal4 4.50.4.dev2__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.dev2/core_universal4.egg-info → core_universal4-4.50.4.dev3}/PKG-INFO +1 -1
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3/core_universal4.egg-info}/PKG-INFO +1 -1
- core_universal4-4.50.4.dev2/setup.py → core_universal4-4.50.4.dev3/setup-legacy.py +20 -25
- {core_universal4-4.50.4.dev2 → 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.dev2 → core_universal4-4.50.4.dev3}/CHANGELOG.md +0 -0
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/LICENSE +0 -0
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/MANIFEST.in +0 -0
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/README.rst +0 -0
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/applitools/core_universal/__init__.py +0 -0
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/applitools/core_universal/__main__.py +0 -0
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/applitools/core_universal/built_bins/core-linux +0 -0
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/applitools/core_universal/built_bins/core-linux-arm64 +0 -0
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/applitools/core_universal/instance.py +0 -0
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/applitools/core_universal/server.py +0 -0
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/SOURCES.txt +0 -0
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/dependency_links.txt +0 -0
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/not-zip-safe +0 -0
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/requires.txt +0 -0
- {core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/top_level.txt +0 -0
|
@@ -7,16 +7,26 @@ This setup file:
|
|
|
7
7
|
- Removes pyproject.toml from sdist to force legacy mode
|
|
8
8
|
- Uses built_bins/ directory for platform binaries
|
|
9
9
|
- Works without wheel package installed
|
|
10
|
+
- Kept alongside setup.py in sdist for maximum compatibility
|
|
10
11
|
|
|
11
12
|
Binary source:
|
|
12
13
|
- built_bins/ directory containing all platform binaries
|
|
13
14
|
- Makefile prepares this directory before building
|
|
14
15
|
|
|
15
|
-
Usage:
|
|
16
|
+
Usage for building sdist:
|
|
16
17
|
make core_universal/prepare_binaries # Prepare binaries first
|
|
17
18
|
python setup-legacy.py sdist # Build legacy sdist
|
|
18
19
|
|
|
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`.
|
|
20
30
|
"""
|
|
21
31
|
import os
|
|
22
32
|
import sys
|
|
@@ -272,29 +282,14 @@ tag_date = 0
|
|
|
272
282
|
2,
|
|
273
283
|
)
|
|
274
284
|
|
|
275
|
-
#
|
|
276
|
-
#
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
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)
|
|
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
|
+
)
|
|
298
293
|
|
|
299
294
|
|
|
300
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.dev2 → core_universal4-4.50.4.dev3}/applitools/core_universal/__init__.py
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/applitools/core_universal/__main__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/applitools/core_universal/instance.py
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/applitools/core_universal/server.py
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/requires.txt
RENAMED
|
File without changes
|
{core_universal4-4.50.4.dev2 → core_universal4-4.50.4.dev3}/core_universal4.egg-info/top_level.txt
RENAMED
|
File without changes
|