Skip to content

Commit 51bd154

Browse files
committed
Including the xml files in the distribution
1 parent 9809b4b commit 51bd154

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

setup.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,26 @@ def get_release_version():
5757
else:
5858
raise ValueError("Unsupported platform.")
5959

60+
#Copy the doc files to the package folder into the doc subfolder
61+
if os.path.exists(os.path.join("docs", "xml", "docs.xml")):
62+
pkg_doc_dir = os.path.join(pkg_dir, "doc")
63+
if not os.path.exists(pkg_doc_dir):
64+
os.mkdir(pkg_doc_dir)
65+
distutils.file_util.copy_file(os.path.join("docs", "xml", "docs.xml"), os.path.join(pkg_doc_dir, "docs.xml"))
66+
6067
#Create the package data.
6168
pkgdata = []
6269
for dir_, _, files in os.walk(pkg_dir):
6370
for file_name in files:
6471
rel_dir = os.path.relpath(dir_, pkg_dir)
6572
rel_file = os.path.join(rel_dir, file_name)
73+
#Add the shared library.
6674
if ''.join(Path(rel_file).suffixes) in ['.pyd', '.tds', '.so', '.dylib', '.dylib.dSYM']:
6775
pkgdata.append(rel_file)
68-
print(pkgdata)
76+
#Add the doc xml file
77+
elif (rel_file.endswith('.xml')):
78+
pkgdata.append(rel_file)
79+
6980
#Read the current version from __version.py__
7081
versnewstr = get_release_version()
7182

0 commit comments

Comments
 (0)