File: buildapi.py

package info (click to toggle)
opendrop 3.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,940 kB
  • sloc: python: 18,944; cpp: 1,031; makefile: 25; sh: 7
file content (23 lines) | stat: -rw-r--r-- 615 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
from pathlib import Path
import subprocess
import sys


def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
    env = os.environ.copy()
    if sys.executable is not None:
        env['PYTHON'] = sys.executable

    subprocess.run(['scons', '-Q', 'bdist_wheel', '--build-dir=' + wheel_directory], check=True, env=env)

    try:
        fp, = Path(wheel_directory).glob('*.whl')
    except ValueError:
        raise RuntimeError('No .whl file found in build directory')

    return str(fp)


def build_sdist(sdist_directory, config_settings=None):
    raise NotImplementedError