forked from nchopin/particles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
69 lines (62 loc) · 1.99 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import os
import setuptools
import sys
import warnings
NAME = 'particles'
DESCRIPTION = 'Sequential Monte Carlo in Python'
with open('README.md') as f:
long_description = f.read()
METADATA = dict(
name=NAME,
version='0.2',
url='http://github.com/nchopin/particles/',
license='MIT',
author='Nicolas Chopin',
install_requires=['numpy',
'scipy',
'numba'
],
author_email='nicolas.chopin@ensae.fr',
description=DESCRIPTION,
long_description = long_description,
long_description_content_type="text/markdown",
packages=[NAME],
include_package_data=True,
platforms='any',
classifiers=[
'Programming Language :: Python',
'Development Status :: 3 - Alpha',
'Natural Language :: English',
'Environment :: Console',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Topic :: Scientific/Engineering :: Mathematics',
]
)
fortran_warning = """
lowdiscrepancy fortran module could not be built (missing compiler? see INSTALL
notes). Package should work as expected, except for the parts related to QMC
(quasi-Monte Carlo).
"""
# detect that Read the docs is trying to build the package
on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd:
# RTD does not have a fortran compiler
from setuptools import setup
else:
# Try to install using Fortran, if the compiler
# cannot be found, switch to traditional installation.
try:
from numpy.distutils.core import setup
from numpy.distutils.extension import Extension
ext = Extension(name=NAME + ".lowdiscrepancy",
sources=["src/LowDiscrepancy.f"])
METADATA['ext_modules'] = [ext,]
except:
from setuptools import setup
warnings.warn(fortran_warning)
setup(**METADATA)