-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.py
More file actions
43 lines (32 loc) · 988 Bytes
/
build.py
File metadata and controls
43 lines (32 loc) · 988 Bytes
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
import logging
import os
import shutil
import sys
from pathlib import Path
# XXX: we cannot use rezbuild_utils as it have a require on pythonning
LOGGER = logging.getLogger(__name__)
def build():
if not os.getenv("REZ_BUILD_INSTALL") == "1":
LOGGER.info(f"skipped")
return
source_dir = Path(os.environ["REZ_BUILD_SOURCE_PATH"])
target_dir = Path(os.environ["REZ_BUILD_INSTALL_PATH"])
file_to_copy = source_dir / "python"
copy_dst = target_dir / file_to_copy.name
if copy_dst.exists():
LOGGER.debug(f"removing existing {copy_dst}")
shutil.rmtree(copy_dst)
LOGGER.debug(f"copying {file_to_copy} to {copy_dst} ...")
shutil.copytree(
file_to_copy,
copy_dst,
)
LOGGER.info("finished")
if __name__ == "__main__":
logging.basicConfig(
level=logging.INFO,
format="{levelname: <7} | {asctime} [{name}] {message}",
style="{",
stream=sys.stdout,
)
build()