Commit 06484062 authored by Christoph Groth's avatar Christoph Groth
Browse files get rid of kwant_ prefixes for custom build commands

These prefixes were visible, for example when invoking
"./ --help build".
parent 151ff59f
......@@ -30,9 +30,9 @@ from setuptools import setup, find_packages, Extension, Command
from sysconfig import get_platform
from distutils.errors import DistutilsError, DistutilsModuleError, \
from import build
from setuptools.command.sdist import sdist
from setuptools.command.build_ext import build_ext
from import build as build_orig
from setuptools.command.sdist import sdist as sdist_orig
from setuptools.command.build_ext import build_ext as build_ext_orig
import numpy
......@@ -120,7 +120,7 @@ Build configuration was:
error_msg = error_msg.format(header=banner(' Error '), sep=banner())
class kwant_build_ext(build_ext):
class build_ext(build_ext_orig):
def run(self):
if not config_file_present:
# Create an empty config file if none is present so that the
......@@ -131,7 +131,7 @@ class kwant_build_ext(build_ext):
f.write('# Created by - feel free to modify.\n')
except (DistutilsError, CCompilerError):
print(error_msg.format(file=CONFIG_FILE, summary=build_summary),
......@@ -141,7 +141,7 @@ class kwant_build_ext(build_ext):
class kwant_build_tut(Command):
class build_tut(Command):
description = "build the tutorial scripts"
user_options = []
......@@ -167,11 +167,11 @@ class kwant_build_tut(Command):
# Even though the tutorial is not necessary for installation, and "build" is
# supposed to make everything needed to install, this is a robust way to ensure
# that the tutorial is present.
class kwant_build(build):
sub_commands = [('build_tut', None)] + build.sub_commands
class build(build_orig):
sub_commands = [('build_tut', None)] + build_orig.sub_commands
def run(self):
write_version(os.path.join(self.build_lib, *STATIC_VERSION_PATH))
......@@ -194,8 +194,8 @@ def git_lsfiles():
# distribution in the current state actually builds. It also makes sure that
# the Cython-made C files and the tutorial will be included in the source
# distribution and that they will be up-to-date.
class kwant_sdist(sdist):
sub_commands = [('build', None)] + sdist.sub_commands
class sdist(sdist_orig):
sub_commands = [('build', None)] + sdist_orig.sub_commands
def run(self):
......@@ -227,7 +227,7 @@ class kwant_sdist(sdist):
f.write(''.join([' ', a, sep, stem, dot, 'c']))
if names is None:
print(banner(' Caution '),
......@@ -481,10 +481,10 @@ def main():
test_suite = 'nose.collector',
cmdclass={'build': kwant_build,
'sdist': kwant_sdist,
'build_ext': kwant_build_ext,
'build_tut': kwant_build_tut},
cmdclass={'build': build,
'sdist': sdist,
'build_ext': build_ext,
'build_tut': build_tut},
setup_requires=['numpy > 1.6.1', 'nose >= 1.0'],
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment