-
Notifications
You must be signed in to change notification settings - Fork 8
/
setup.py
60 lines (52 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
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © GWHAT Project Contributors
# https://github.com/jnsebgosselin/gwhat
#
# This file is part of GWHAT (Ground-Water Hydrograph Analysis Toolbox).
# Licensed under the terms of the GNU General Public License.
# -----------------------------------------------------------------------------
import csv
import setuptools
import re
import numpy
from numpy.distutils.core import setup, Extension
from Cython.Build import cythonize
from gwhat import __version__, __project_url__
with open('requirements.txt', 'r') as csvfile:
INSTALL_REQUIRES = list(csv.reader(csvfile))
INSTALL_REQUIRES = [item for sublist in INSTALL_REQUIRES for item in sublist]
for i, line in enumerate(INSTALL_REQUIRES):
if line.startswith('git+https'):
name = re.findall(r'#egg=(.*)', line)[0]
INSTALL_REQUIRES[i] = f'{name} @ {line}'
with open('requirements-dev.txt', 'r') as csvfile:
DEV_INSTALL_REQUIRES = list(csv.reader(csvfile))
DEV_INSTALL_REQUIRES = [
item for sublist in DEV_INSTALL_REQUIRES for item in sublist]
EXTRAS_REQUIRE = {'dev': DEV_INSTALL_REQUIRES}
PACKAGE_DATA = {
'gwhat': ['ressources/icons_png/*.png',
'ressources/icons_scalable/*.svg',
'ressources/WHAT_banner_750px.png',
'ressources/splash.png',
'gwrecharge/*.pyd']
}
RECHGEXT = Extension(
name='gwhat.gwrecharge.gwrecharge_calculs',
sources=['gwhat/gwrecharge/gwrecharge_calculs.pyx'],
include_dirs=[numpy.get_include()]
)
setup(name='gwhat',
version=__version__,
license='GPLv3',
author='GWHAT Project Contributors',
author_email='jean-sebastien.gosselin@outlook.com',
url=__project_url__,
ext_modules=cythonize(RECHGEXT),
packages=setuptools.find_packages(),
package_data=PACKAGE_DATA,
include_package_data=True,
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
)