Skip to content

Commit bc8052a

Browse files
committed
setup.py and build scripts: code cleaning/removed sphinx build from setup.py
(use `python setup.py build_sphinx` to build doc instead)
1 parent 8546b37 commit bc8052a

File tree

4 files changed

+5
-45
lines changed

4 files changed

+5
-45
lines changed

build.bat

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
del MANIFEST
12
rmdir /S /Q build
23
rmdir /S /Q dist
3-
python setup.py build sdist
4+
python setup.py build bdist_wininst --plat-name=win32
5+
python setup.py build bdist_wininst --plat-name=win-amd64
46
python setup.py sdist bdist_wheel --universal
7+
python setup.py build sdist
58
pause
File renamed without changes.

build_doc_zip.bat

Lines changed: 0 additions & 6 deletions
This file was deleted.

setup.py

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
from __future__ import print_function
1515

1616
import os
17-
import sys
1817
import os.path as osp
1918

2019
import setuptools # analysis:ignore
2120
from distutils.core import setup
22-
from distutils.command.build import build
2321

2422
LIBNAME = 'PythonQwt'
2523
PACKAGE_NAME = 'qwt'
@@ -79,41 +77,6 @@ def get_subpackages(name):
7977
return splist
8078

8179

82-
try:
83-
import sphinx
84-
except ImportError:
85-
sphinx = None
86-
87-
from distutils.command.build import build as dftbuild
88-
89-
class build(dftbuild):
90-
def has_doc(self):
91-
if sphinx is None:
92-
return False
93-
setup_dir = os.path.dirname(os.path.abspath(__file__))
94-
return os.path.isdir(os.path.join(setup_dir, 'doc'))
95-
sub_commands = dftbuild.sub_commands + [('build_doc', has_doc)]
96-
97-
cmdclass = {'build' : build}
98-
99-
if sphinx:
100-
from sphinx.setup_command import BuildDoc
101-
class build_doc(BuildDoc):
102-
def run(self):
103-
# make sure the python path is pointing to the newly built
104-
# code so that the documentation is built on this and not a
105-
# previously installed version
106-
build = self.get_finalized_command('build')
107-
sys.path.insert(0, os.path.abspath(build.build_lib))
108-
try:
109-
sphinx.setup_command.BuildDoc.run(self)
110-
except UnicodeDecodeError:
111-
print("ERROR: unable to build documentation because Sphinx do not handle source path with non-ASCII characters. Please try to move the source package to another location (path with *only* ASCII characters).", file=sys.stderr)
112-
sys.path.pop(0)
113-
114-
cmdclass['build_doc'] = build_doc
115-
116-
11780
setup(name=LIBNAME, version=version,
11881
description=DESCRIPTION, long_description=LONG_DESCRIPTION,
11982
packages=get_subpackages(PACKAGE_NAME),
@@ -143,4 +106,4 @@ def run(self):
143106
'Programming Language :: Python :: 2.7',
144107
'Programming Language :: Python :: 3',
145108
],
146-
cmdclass=cmdclass)
109+
)

0 commit comments

Comments
 (0)