Skip to content

Commit 0930f6a

Browse files
committed
Removed CHM from distributed wheel package, added zipped CHM to source package (link in documentation)
1 parent b34d7c6 commit 0930f6a

File tree

5 files changed

+26
-58
lines changed

5 files changed

+26
-58
lines changed

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ recursive-include doc *.py *.rst *.png
22
include MANIFEST.in
33
include LICENSE
44
include README.md
5-
include CHANGELOG.md
5+
include CHANGELOG.md
6+
include doc/PythonQwt.chm.zip

build_doc.bat

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
@echo off
2+
if defined WINPYDIRBASE (
3+
call %WINPYDIRBASE%\scripts\env.bat
4+
@echo ==============================================================================
5+
@echo:
6+
@echo Using WinPython from %WINPYDIRBASE%
7+
@echo:
8+
@echo ==============================================================================
9+
@echo:
10+
)
211
set PATH=C:\Program Files\7-Zip;C:\Program Files (x86)\7-Zip;C:\Program Files\HTML Help Workshop;C:\Program Files (x86)\HTML Help Workshop;%PATH%
312
set PYTHONPATH=%cd%
4-
sphinx-build -b htmlhelp doc doctmp
5-
hhc doctmp\PythonQwt.hhp
6-
copy doctmp\PythonQwt.chm .
7-
7z a PythonQwt.chm.zip PythonQwt.chm
8-
del doctmp\PythonQwt.chm
9-
del doc.zip
10-
sphinx-build -b html doc doctmp
11-
cd doctmp
12-
7z a -r ..\doc.zip *.*
13-
cd ..
14-
rmdir /S /Q doctmp
15-
del PythonQwt.chm.zip
13+
sphinx-build -b htmlhelp doc build\doc
14+
hhc build\doc\PythonQwt.hhp
15+
copy build\doc\PythonQwt.chm doc
16+
7z a doc\PythonQwt.chm.zip doc\PythonQwt.chm
17+
move doc\PythonQwt.chm .
18+
sphinx-build -b html doc build\doc
19+
@echo:
20+
@echo ==============================================================================
21+
@echo:
22+
if not defined UNATTENDED (
23+
@echo End of script
24+
pause
25+
)

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103

104104
# The theme to use for HTML and HTML Help pages. Major themes that come with
105105
# Sphinx are currently 'default' and 'sphinxdoc'.
106-
html_theme = "classic"
106+
html_theme = "default"
107107

108108
# Theme options are theme-specific and customize the look and feel of a theme
109109
# further. For a list of options available for each theme, see the

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
.. note::
66

7-
Windows users may download the :download:`CHM Manual <../PythonQwt.chm.zip>`.
7+
Windows users may download the :download:`CHM Manual <PythonQwt.chm.zip>`.
88

99
After downloading this file, you may see blank pages in the documentation.
1010
That's because Windows is blocking CHM files for security reasons.

setup.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
import os
1717
import sys
1818
import os.path as osp
19-
import subprocess
20-
import shutil
21-
import atexit
2219

2320
import setuptools # analysis:ignore
2421
from 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-
13189
setup(
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

Comments
 (0)