-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
62 lines (55 loc) · 2.08 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
# -*- coding: utf-8 -*-
import setuptools
import os
# Usefull to build f90 files
from numpy.distutils.core import Extension, setup
with open("README.md", "r") as fh:
long_description = fh.read()
# Use env var to activate fpoly, defaut is false
USE_FPOLY = os.getenv('EASTEREIG_USE_FPOLY', 'False').lower() in ('true', '1', 't')
if USE_FPOLY:
# Define f90 module to include
ext_fpoly = Extension(name='eastereig.fpoly._fpolyval',
sources=['eastereig/fpoly/fpolyval.f90'])
ext_modules = [ext_fpoly]
print('Use fortran fpoly submodule.', 'Set environnement variable:',
'`EASTEREIG_USE_FPOLY=False` to activate full python version.')
else:
ext_modules = []
print('Use full python version. Set environnement variable:',
'`EASTEREIG_USE_FPOLY=True` to activate fortran version.')
def _getversion():
""" Get version from VERSION."""
v = None
with open(os.path.join('./eastereig', 'VERSION')) as f:
for line in f:
if line.startswith('version'):
v = line.replace("'", '').split()[-1].strip()
break
return v
this_version = _getversion()
print('version:', this_version)
setup(
name="eastereig",
version=this_version,
author="B. Nennig, M. Ghienne",
author_email="benoit.nennig@supmeca.fr, martin.ghienne@supmeca.fr",
description="A library to locate exceptional points and to reconstruct eigenvalues loci",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/nennigb/EasterEig",
include_package_data=True,
# we can use find_packages() to automatically discover all subpackages
packages=setuptools.find_packages(),
# build f90 module
ext_modules=ext_modules,
install_requires=['numpy',
'scipy',
'matplotlib'],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
],
python_requires='>=3.5',
)