mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
* pre-commit: update black to 21.5b1 also updated others, but black is more noticeable * remove magic trailing comma
45 lines
934 B
Python
45 lines
934 B
Python
import argparse
|
|
import configparser
|
|
import os
|
|
import pathlib
|
|
import shutil
|
|
from subprocess import STDOUT, check_call, check_output
|
|
|
|
path = pathlib.Path(__file__).parent.absolute()
|
|
config = path / "config.ini"
|
|
|
|
dvc = path.parent.parent / "dvc"
|
|
pyinstaller = path.parent / "pyinstaller"
|
|
|
|
build = path / "build"
|
|
install = build / "usr"
|
|
|
|
parser = argparse.ArgumentParser()
|
|
args = parser.parse_args()
|
|
|
|
try:
|
|
shutil.rmtree(build)
|
|
except FileNotFoundError:
|
|
pass
|
|
|
|
build.mkdir()
|
|
shutil.copytree(pyinstaller / "dist" / "dvc", build / "dvc")
|
|
shutil.copy(path / "addSymLinkPermissions.ps1", build)
|
|
|
|
version = check_output(
|
|
[os.fspath(build / "dvc" / "dvc"), "--version"], text=True
|
|
).strip()
|
|
|
|
cfg = configparser.ConfigParser()
|
|
cfg.add_section("Version")
|
|
cfg.set("Version", "version", version)
|
|
|
|
with (path / "config.ini").open("w") as fobj:
|
|
cfg.write(fobj)
|
|
|
|
check_call(
|
|
["iscc", "setup.iss"],
|
|
cwd=path,
|
|
stderr=STDOUT,
|
|
)
|