Skip to content
Snippets Groups Projects
Commit 4ee86e4e authored by Christoph Groth's avatar Christoph Groth
Browse files

setup.py: get rid of most GLOBAL_CONSTANTS

parent bc43767f
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
# Copyright 2012-2015 Tinyarray authors.
# Copyright 2012-2016 Tinyarray authors.
#
# This file is part of Tinyarray. It is subject to the license terms in the
# file LICENSE.rst found in the top-level directory of this distribution and
......@@ -32,24 +32,8 @@ except ImportError:
return _getfinalpathname(f1) == _getfinalpathname(f2)
README_FILE = 'README.rst'
SAVED_VERSION_FILE = 'version'
VERSION_HEADER = ['src', 'version.hh']
CLASSIFIERS = """\
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Programming Language :: Python :: 2
Programming Language :: Python :: 3
Programming Language :: C++
Topic :: Software Development
Topic :: Scientific/Engineering
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
Operating System :: Microsoft :: Windows"""
distr_root = os.path.dirname(os.path.abspath(__file__))
......@@ -126,7 +110,7 @@ def long_description():
text = []
skip = True
try:
with open(README_FILE) as f:
with open('README.rst') as f:
for line in f:
if line == "\n":
if skip:
......@@ -145,7 +129,7 @@ def long_description():
class our_build_ext(build_ext):
def run(self):
with open(os.path.join(*VERSION_HEADER), 'w') as f:
with open(os.path.join('src', 'version.hh'), 'w') as f:
f.write("// This file has been generated by setup.py.\n")
f.write("// It is not included in source distributions.\n")
f.write('#define VERSION "{}"\n'.format(version))
......@@ -168,15 +152,29 @@ class our_sdist(sdist):
.format(version))
module = Extension('tinyarray',
language='c++',
sources=['src/arithmetic.cc', 'src/array.cc',
'src/functions.cc'],
depends=['src/arithmetic.hh', 'src/array.hh',
'src/conversion.hh', 'src/functions.hh'])
def main():
exts = [Extension('tinyarray',
language='c++',
sources=['src/arithmetic.cc', 'src/array.cc',
'src/functions.cc'],
depends=['src/arithmetic.hh', 'src/array.hh',
'src/conversion.hh', 'src/functions.hh'])]
classifiers = """\
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Programming Language :: Python :: 2
Programming Language :: Python :: 3
Programming Language :: C++
Topic :: Software Development
Topic :: Scientific/Engineering
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
Operating System :: Microsoft :: Windows"""
setup(name='tinyarray',
version=version,
author='Christoph Groth (CEA) and others',
......@@ -187,10 +185,10 @@ def main():
download_url="http://downloads.kwant-project.org/tinyarray/",
license="Simplified BSD license",
platforms=["Unix", "Linux", "Mac OS-X", "Windows"],
classifiers=CLASSIFIERS.split('\n'),
classifiers=classifiers.split('\n'),
cmdclass={'build_ext': our_build_ext,
'sdist': our_sdist},
ext_modules=[module],
ext_modules=exts,
test_suite = 'nose.collector',
tests_require=['nose >= 1.0'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment