From 22b0153e499d22477097ba714cc8f4fd2978d7ae Mon Sep 17 00:00:00 2001 From: Marshall Ward Date: Tue, 30 Jan 2018 22:22:26 +1100 Subject: [PATCH] RIP manpage build Since we no longer install manpages, there's no need to build then during installation. This sort of work should be moved to the distribution scripts, since it's touching system man pages. (Though apparently setuptools has no problem dumping things into /usr/lib but hey who am I to complain?) --- setup.py | 66 +------------------------------------------------------- 1 file changed, 1 insertion(+), 65 deletions(-) diff --git a/setup.py b/setup.py index ad750a2..07fee9e 100644 --- a/setup.py +++ b/setup.py @@ -14,16 +14,6 @@ from distutils.core import setup from distutils.core import Command -try: - from sphinx.setup_command import BuildDoc - has_sphinx = True - - from distutils.command.build import build - from distutils.command.build_py import build_py - from distutils.command.install_data import install_data -except ImportError: - has_sphinx = False - import tests.test_f90nml # Project details @@ -33,57 +23,6 @@ project_scripts = [os.path.join('bin', f) for f in os.listdir('bin')] -# The method below is largely based on Kentaro Wada's implementation in the -# wstools package. -# Reference: https://github.com/vcstools/wstool/blob/master/setup.py -# commit: 8523f7fbe5e0690f0deb785ce54186b41358e31f - -# NOTE: setuptools will not explicitly install data and instead packs it inside -# the egg. While this is generally a good practice for modules which rely on -# user data, it makes it impossible to install things like documentation -# outside of the python space. -# -# We get around this by issuing a direct `install_data` command to distutils -# rather than relying on setuptools to install the data into its egg. - -# TODO: Should probably also disable the install_data copy to the egg... - - -# Generate the man page if present -data_files = [] -cmd_class = {} -if has_sphinx: - # Create manpage build rule - class ProjectBuildMan(BuildDoc): - def initialize_options(self): - BuildDoc.initialize_options(self) - self.builder = 'man' - - # Include build_man into the main builds - class ProjectBuild(build): - def run(self): - self.run_command('build_man') - self.run_command('install_data') - build.run(self) - - class ProjectBuildPy(build_py): - def run(self): - self.run_command('build_man') - self.run_command('install_data') - build_py.run(self) - - # Tabulate the builds - cmd_class['build'] = ProjectBuild - cmd_class['build_py'] = ProjectBuildPy - cmd_class['build_man'] = ProjectBuildMan - - # Try to determine an appropriate man path - if os.path.isdir(os.path.join(sys.prefix, 'share')): - man_root = 'share' - else: - man_root = '' - - # Test suite class ProjectTest(Command): user_options = [] @@ -101,8 +40,6 @@ def run(self): result = unittest.TextTestRunner(verbosity=2).run(suite) sys.exit(not result.wasSuccessful()) -cmd_class['test'] = ProjectTest - # README with open(project_readme_fname) as f: @@ -122,8 +59,7 @@ def run(self): packages = ['f90nml'], scripts=project_scripts, - data_files=data_files, - cmdclass=cmd_class, + cmdclass = {'test': ProjectTest}, classifiers = [ 'Development Status :: 4 - Beta',