-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
64 lines (57 loc) · 1.49 KB
/
setup.py
File metadata and controls
64 lines (57 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import os
from setuptools import setup, find_namespace_packages, Extension
from Cython.Build import cythonize
# Package metadata
NAME = 'shortseq'
DESCRIPTION = 'Compact representation of short DNA sequences that uses up to 73% less memory'
URL = 'https://github.com/AlexTate/shortseq'
AUTHOR = 'Alex Tate'
PLATFORM = 'Unix'
REQUIRES_PYTHON = '>3.8, <3.12'
VERSION = '0.0.1'
define_macros = []
short_seq_common_compile_args = [
'-std=c++20',
"-O3",
"-mbmi2",
"-mpopcnt",
"-mtune=native",
'-march=native',
]
cython_implementations = [
"shortseq/short_seq.pyx",
"shortseq/short_seq_var.pyx",
"shortseq/short_seq_192.pyx",
"shortseq/short_seq_64.pyx",
"shortseq/fast_read.pyx",
"shortseq/counter.pyx",
"shortseq/util.pyx",
"shortseq/umi/umi.pyx",
]
if os.environ.get("CYTRACE") == '1':
define_macros.append(('CYTHON_TRACE_NOGIL', '1'))
extensions = [
Extension(
pyx.replace("/", ".").replace(".pyx", ""),
sources=[pyx],
extra_compile_args=short_seq_common_compile_args,
define_macros=define_macros,
language='c++',
)
for pyx in cython_implementations
]
setup(
name=NAME,
version=VERSION,
author=AUTHOR,
description=DESCRIPTION,
include_package_data=True,
packages=find_namespace_packages(),
python_requires=REQUIRES_PYTHON,
zip_safe=False,
ext_modules=cythonize(
extensions,
compiler_directives={'language_level': '3'},
build_dir="build"
),
)