forked from open2c/polychrom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·69 lines (57 loc) · 1.7 KB
/
setup.py
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
65
66
67
68
69
import os, re, io
from setuptools import find_packages
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
import numpy
cmdclass = {}
def _read(*parts, **kwargs):
filepath = os.path.join(os.path.dirname(__file__), *parts)
encoding = kwargs.pop('encoding', 'utf-8')
with io.open(filepath, encoding=encoding) as fh:
text = fh.read()
return text
def get_version():
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
_read('polychrom', '__init__.py'),
re.MULTILINE).group(1)
return version
def get_long_description():
return _read('README.md')
def get_requirements(path):
content = _read(path)
return [
req
for req in content.split("\n")
if req != '' and not req.startswith('#')
]
cmdclass.update({"build_ext": build_ext})
ext_modules = cythonize(
[
Extension(
"polychrom._polymer_math",
["polychrom/_polymer_math.pyx", "polychrom/__polymer_math.cpp"],
)
]
)
setup(
name="polychrom",
author='Mirny Lab',
author_email='[email protected]',
version=get_version(),
url="http://github.com/mirnylab/polychrom",
description=("A library for polymer simulations and their analyses."),
long_description=get_long_description(),
long_description_content_type='text/markdown',
keywords=['genomics', 'polymer', 'Hi-C', 'molecular dynamics', "chromosomes"],
ext_modules=ext_modules,
cmdclass=cmdclass,
packages=find_packages(),
entry_points={
'console_scripts': [
'polychrom = polychrom.cli:cli',
]
}
)