minimap2/setup.py

66 lines
1.9 KiB
Python
Raw Normal View History

try:
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
from distutils.command.build_ext import build_ext
import sys, platform, subprocess
2018-07-25 11:53:02 +08:00
2017-09-17 10:43:52 +08:00
def readme():
2018-07-25 11:53:02 +08:00
with open('python/README.rst') as f:
return f.read()
2017-09-17 10:43:52 +08:00
class LibMM2Build(build_ext):
# Uses Makefile to build library, avoids duplicating logic
# determining which objects to compile but does require
# end users to have Make (since precompiled wheels are not
# distributed on PyPI).
def run(self):
def compile_libminimap2(*args, **kwargs):
cmd = ['make', 'libminimap2.a'] + list(args)
subprocess.check_call(cmd)
2022-02-14 19:00:01 +08:00
options = []
if platform.machine() in ["aarch64", "arm64"]:
options = ["arm_neon=1", "aarch64=1"]
self.execute(
compile_libminimap2, options,
'Compiling libminimap2 using Makefile')
build_ext.run(self)
2017-09-16 20:44:47 +08:00
setup(
name = 'mappy',
2021-12-27 04:14:54 +08:00
version = '2.24',
2017-09-16 20:44:47 +08:00
url = 'https://github.com/lh3/minimap2',
description = 'Minimap2 python binding',
2017-09-17 10:43:52 +08:00
long_description = readme(),
2017-09-16 20:44:47 +08:00
author = 'Heng Li',
author_email = 'lh3@me.com',
2017-09-17 10:29:52 +08:00
license = 'MIT',
keywords = 'sequence-alignment',
scripts = ['python/minimap2.py'],
cmdclass = {'build_ext': LibMM2Build},
ext_modules = [
Extension(
'mappy',
sources = ['python/mappy.pyx'],
depends = ['python/cmappy.h', 'python/cmappy.pxd'],
include_dirs = ['.'],
extra_objects = ['libminimap2.a'],
libraries = ['z', 'm', 'pthread'])],
classifiers = [
2018-02-24 22:31:09 +08:00
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Programming Language :: C',
'Programming Language :: Cython',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Bio-Informatics'],
2021-04-05 23:54:08 +08:00
setup_requires=["cython"])