File: utils.py

package info (click to toggle)
python-hatch-mypyc 0.16.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 232 kB
  • sloc: python: 1,025; makefile: 5
file content (14 lines) | stat: -rw-r--r-- 423 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# SPDX-FileCopyrightText: 2021-present Ofek Lev <oss@ofek.dev>
#
# SPDX-License-Identifier: MIT
import subprocess
import sys


def build_project(*args):
    if not args:
        args = ['-w']

    process = subprocess.run([sys.executable, '-m', 'build', '--no-isolation', *args], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    if process.returncode:  # no cov
        raise Exception(process.stdout.decode('utf-8'))