-
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathpython.yaml
More file actions
56 lines (50 loc) · 1.95 KB
/
python.yaml
File metadata and controls
56 lines (50 loc) · 1.95 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
# SPDX-FileCopyrightText: 2023 AerynOS Developers
# SPDX-License-Identifier: MPL-2.0
actions:
- python_setup:
description: Perform python setup and build with the default options
command: |
test -e ./setup.py || ( echo "%%python: The ./setup.py script could not be found" ; exit 1 )
python3 setup.py build
dependencies:
- binary(python3)
- python(setuptools)
- python_install:
description: Install python package to the destination directory
command: |
python3 setup.py install --root="%(installroot)"
dependencies:
- binary(python3)
- python(setuptools)
- python-packaging # auto deps handler
- pyproject_build:
description: Build a wheel for python PEP517 projects
command: |
python3 -m build --wheel --no-isolation
dependencies:
- binary(python3)
- python-build
- python-wheel
- pyproject_install:
description: Install wheel to destination directory
command: |
python3 -m installer --destdir="%(installroot)" dist/*.whl
dependencies:
- binary(python3)
- python-installer
# TODO: Investigate whether providing additional -opt1.pyc and -opt2.pyc from increasing
# the optimization level is worth it. Python itself has to be invoked with -O/-OO
# in order to use opt1/opt2 .pyc files.
- python_compile:
description: Compile .pyc bytecode files from any miscellaneous .py files in the install directory.
command: |
function python_compile() {
if [ -z "$1" ]; then
python3 -m compileall -q %(installroot) || exit 1
else
python3 -m compileall -q $* || exit 1
fi
}
python_compile
dependencies:
- binary(python3)