Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathsetup.py
More file actions
Latest commit
90 lines (72 loc) · 2.32 KB
/
Copy pathsetup.py
File metadata and controls
90 lines (72 loc) · 2.32 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
importos
importplatform
importsetuptools
# Include only the platform specific pre-compiled binary.
# For sources see https://github.com/audeering/opensmile
defplatform_name():
r"""Platform name used in pip tag.
Expected outcomes are:
==================== ======================
Linux, 64-bit manylinux_2_17_x86_64
Raspberry Pi, 32-bit manylinux_2_17_armv7l
Raspberry Pi, 64-bit manylinux_2_17_aarch64
Windows win_amd64
MacOS Intel macosx_10_4_x86_64
MacOS M1 macosx_11_0_arm64
==================== ======================
Under Linux the manylinux version
can be extracted
by inspecting the wheel
with ``auditwheel``.
Too see all supported tags on your system run:
.. code-block:: bash
$ pip debug --verbose
"""
system=platform.system()
machine=platform.machine().lower()
ifsystem=="Linux": # pragma: no cover
system="manylinux_2_17"
elifsystem=="Windows": # pragma: no cover
system="win"
elifsystem=="Darwin": # pragma: no cover
ifmachine=="x86_64":
system="macosx_10_4"
else:
system="macosx_11_0"
else: # pragma: no cover
raiseRuntimeError(f"Unsupported platform {system}")
returnf"{system}_{machine}"
# Look for enrionment variable PLAT_NAME
# to be able to enforce
# different platform names
# in CI on the same runner
plat_name=os.environ.get("PLAT_NAME", platform_name())
if"linux"inplat_name:
library="*.so"
elif"macos"inplat_name:
library="*.dylib"
elif"win"inplat_name:
library="*.dll"
setuptools.setup(
package_data={
"opensmile.core": [
f"bin/{plat_name}/{library}",
"config/compare/*",
"config/egemaps/v01a/*",
"config/egemaps/v01b/*",
"config/egemaps/v02/*",
"config/emobase/*",
"config/gemaps/v01a/*",
"config/gemaps/v01b/*",
"config/is09-13/*",
"config/shared/*",
],
},
# python -m build --wheel
# does no longer accept the --plat-name option,
# but we can set the desired platform as an option
# (https://stackoverflow.com/a/75010995)
options={
"bdist_wheel": {"plat_name": plat_name},
},
)