-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.py
More file actions
41 lines (31 loc) · 1.01 KB
/
build.py
File metadata and controls
41 lines (31 loc) · 1.01 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
import distutils.dir_util
import logging
import os
import shutil
import sys
from pathlib import Path
LOGGER = logging.getLogger(__name__)
def build():
if not os.getenv("REZ_BUILD_INSTALL") == "1":
LOGGER.info(f"skipped")
return
# unfortunately the package can't use itself while being built,
# so we have to copy code.
source_dir = Path(os.environ["REZ_BUILD_SOURCE_PATH"])
target_dir = Path(os.environ["REZ_BUILD_INSTALL_PATH"])
frompath = source_dir / "python"
topath = target_dir / frompath.name
LOGGER.debug(f"copying {frompath} to {topath} ...")
distutils.dir_util.copy_tree(str(frompath), str(topath))
frompath = source_dir / "README.md"
topath = target_dir
LOGGER.debug(f"copying {frompath} to {topath} ...")
shutil.copy2(frompath, topath)
if __name__ == "__main__":
logging.basicConfig(
level=logging.INFO,
format="{levelname: <7} | {asctime} [{name}] {message}",
style="{",
stream=sys.stdout,
)
build()