1616import os
1717import sys
1818import os .path as osp
19- import subprocess
20- import shutil
21- import atexit
2219
2320import setuptools # analysis:ignore
2421from distutils .core import setup
@@ -89,45 +86,6 @@ def get_subpackages(name):
8986 return splist
9087
9188
92- def build_chm_doc (libname ):
93- """Return CHM documentation file (on Windows only), which is copied under
94- {PythonInstallDir}\Doc, hence allowing Spyder to add an entry for opening
95- package documentation in "Help" menu. This has no effect on a source
96- distribution."""
97- args = "" .join (sys .argv )
98- if os .name == "nt" and ("bdist" in args or "build" in args ):
99- try :
100- import sphinx # analysis:ignore
101- except ImportError :
102- print (
103- "Warning: `sphinx` is required to build documentation" , file = sys .stderr
104- )
105- return
106- hhc_base = r"C:\Program Files%s\HTML Help Workshop\hhc.exe"
107- for hhc_exe in (hhc_base % "" , hhc_base % " (x86)" ):
108- if osp .isfile (hhc_exe ):
109- break
110- else :
111- print (
112- "Warning: `HTML Help Workshop` is required to build CHM "
113- "documentation file" ,
114- file = sys .stderr ,
115- )
116- return
117- doctmp_dir = "doctmp"
118- subprocess .call ("sphinx-build -b htmlhelp doc %s" % doctmp_dir , shell = True )
119- atexit .register (shutil .rmtree , osp .abspath (doctmp_dir ))
120- fname = osp .abspath (osp .join (doctmp_dir , "%s.chm" % libname ))
121- subprocess .call ('"%s" %s' % (hhc_exe , fname ), shell = True )
122- if osp .isfile (fname ):
123- return fname
124- else :
125- print ("Warning: CHM building process failed" , file = sys .stderr )
126-
127-
128- CHM_DOC = build_chm_doc (LIBNAME )
129-
130-
13189setup (
13290 name = LIBNAME ,
13391 version = version ,
@@ -137,7 +95,6 @@ def build_chm_doc(libname):
13795 package_data = {
13896 PACKAGE_NAME : get_package_data (PACKAGE_NAME , (".png" , ".svg" , ".mo" ))
13997 },
140- data_files = [(r"Doc" , [CHM_DOC ])] if CHM_DOC else [],
14198 install_requires = ["NumPy>=1.5" ],
14299 extras_require = {"Doc" : ["Sphinx>=1.1" ],},
143100 entry_points = {
0 commit comments