-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup.py
More file actions
34 lines (29 loc) · 964 Bytes
/
setup.py
File metadata and controls
34 lines (29 loc) · 964 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
# setup.py
#
# DO NOT REMOVE setup.py. It is needed for
# including example files in the shipped package
import os
import shutil
from setuptools import setup
from setuptools.command.build_py import build_py as _build_py
class build_py(_build_py):
def run(self):
super().run()
extra_dirs = [
("docs/build", os.path.join("diffpy", "cmi", "docs", "build")),
(
"docs/examples",
os.path.join("diffpy", "cmi", "docs", "examples"),
),
("requirements", os.path.join("diffpy", "cmi", "requirements")),
]
for src, rel_dst in extra_dirs:
if not os.path.exists(src):
print(f"Skipping missing directory: {src}")
continue
dst = os.path.join(self.build_lib, rel_dst)
shutil.rmtree(dst, ignore_errors=True)
shutil.copytree(src, dst)
setup(
cmdclass={"build_py": build_py},
)