Commit 6c683464 authored by Christoph Groth's avatar Christoph Groth
Browse files

make the command sdist more robust

parent c66173c3
......@@ -18,6 +18,7 @@ from distutils.core import setup, Command
from distutils.extension import Extension
from distutils.errors import DistutilsError, CCompilerError
from import build as distutils_build
from distutils.command.sdist import sdist as distutils_sdist
import numpy
......@@ -89,6 +90,15 @@ class kwant_build(distutils_build):
# Make the command "sdist" depend on "build". This verifies that the
# 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(distutils_sdist):
sub_commands = [('build', None)] + distutils_sdist.sub_commands
# This is an exact copy of the function from kwant/ We can't import
# it here (because kwant is not yet built when this scipt is run), so we just
# include a copy.
......@@ -315,6 +325,7 @@ def main():
packages=["kwant", "kwant.graph", "kwant.linalg", "kwant.physics",
cmdclass={'build': kwant_build,
'sdist': kwant_sdist,
'build_ext': kwant_build_ext,
'build_tut': build_tut},
Markdown is supported
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