Advertisement
Vladivostok

f2

Jul 15th, 2018
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.48 KB | None | 0 0
  1. # This file is part of SNPknock.
  2.  
  3. #     SNPknock is free software: you can redistribute it and/or modify
  4. #     it under the terms of the GNU General Public License as published by
  5. #     the Free Software Foundation, either version 3 of the License, or
  6. #     (at your option) any later version.
  7.  
  8. #     SNPknock is distributed in the hope that it will be useful,
  9. #     but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. #     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. #     GNU General Public License for more details.
  12.  
  13. #     You should have received a copy of the GNU General Public License
  14. #     along with SNPknock.  If not, see <http://www.gnu.org/licenses/>.
  15.  
  16. #!/usr/bin/env python3
  17. # distutils: language = c++
  18.  
  19. CLASSIFIERS = ["Development Status :: 4 - Beta",
  20.                "Environment :: Console",
  21.                "Intended Audience :: Science/Research",
  22.                "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
  23.                "Operating System :: OS Independent",
  24.                "Programming Language :: Python",
  25.                "Topic :: Scientific/Engineering"]
  26.  
  27. DESCRIPTION = 'Generates knockoff copies of HMMs and genomic data.'
  28.  
  29. NUMPY_MIN_VERSION = '1.13.1'
  30. CYTHON_MIN_VERSION = '0.26'
  31.  
  32. REQUIRES            = ["numpy (>=%s)" % NUMPY_MIN_VERSION,
  33.                        "Cython (>=%s)" % CYTHON_MIN_VERSION]
  34.  
  35. from setuptools import Extension
  36. from setuptools import setup
  37. import sys
  38.  
  39. # we'd better have Cython installed, or it's a no-go
  40. try:
  41.     from Cython.Distutils import build_ext
  42.     from Cython.Build import cythonize
  43. except:
  44.     print("You don't seem to have Cython installed. Please get a")
  45.     print("copy from www.cython.org and install it")
  46.     sys.exit(1)
  47.  
  48. # Compiler flags
  49. EXTRA_COMPILE_ARGS = ["-O3", "-std=c++11"]
  50. EXTRA_LINK_ARGS = ["-static-libstdc++"]
  51. UNDEF_MACROS = [ "NDEBUG" ]
  52.  
  53. # Define extensions
  54. ext_modules=[
  55.     Extension("SNPknock.knockoffs", ["SNPknock/knockoffs.pyx"], \
  56.               undef_macros=UNDEF_MACROS,extra_compile_args=EXTRA_COMPILE_ARGS,extra_link_args=EXTRA_LINK_ARGS)
  57. ]
  58.  
  59. # By setting this compiler directive, cython will embed signature information
  60. # in docstrings. Sphinx then knows how to extract and use those signatures.
  61. for e in ext_modules:
  62.     e.cython_directives = {"embedsignature": True}
  63.  
  64. # Speficy dependencies
  65. DEPENDENCIES = ['Cython>='+CYTHON_MIN_VERSION,
  66.                 'numpy>='+NUMPY_MIN_VERSION]
  67.  
  68. ################ COMPILE
  69.  
  70. def main(**extra_args):
  71.     setup(name='SNPknock',
  72.           maintainer="Matteo Sesia",
  73.           maintainer_email="[email protected]",
  74.           description=DESCRIPTION,
  75.           url="http://web.stanford.edu/~msesia/snpknock/",
  76.           download_url="http://web.stanford.edu/~msesia/snpknock/install.html",
  77.           license="GPL-v3 license",
  78.           classifiers=CLASSIFIERS,
  79.           author="Matteo Sesia",
  80.           author_email="[email protected]",
  81.           platforms="OS Independent",
  82.           version='0.5.2',
  83.           requires=REQUIRES,
  84.           provides=["SNPknock"],
  85.           packages     = ['SNPknock',
  86.                          ],
  87.           ext_modules = cythonize(ext_modules),
  88.           package_data = {},
  89.           data_files=[],
  90.           scripts= [],
  91.           long_description = open('README.rst', 'rt').read(),
  92.           install_requires = DEPENDENCIES
  93.     )
  94.  
  95. #simple way to test what setup will do
  96. #python setup.py install --prefix=/tmp
  97. if __name__ == "__main__":
  98.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement