forked from martibosch/pylandstats
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
82 lines (66 loc) · 2.46 KB
/
setup.py
File metadata and controls
82 lines (66 loc) · 2.46 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
"""pylandstats setup script."""
# coding=utf-8
import platform
import sys
from io import open # compatible encoding parameter
from pathlib import Path
from setuptools import find_packages, setup
# pythran imports must go AFTER setuptools imports
# See: https://github.com/pypa/setuptools/issues/309 and https://bit.ly/300HKtK
from transonic.dist import init_transonic_extensions, make_backend_files
if sys.version_info[:2] < (3, 6):
raise RuntimeError("Python version >= 3.6 required.")
__version__ = "2.4.2"
classifiers = [
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
]
here = Path(__file__).parent.absolute()
# Get the long description from the README file
with open(here / "README.md", encoding="utf-8") as f:
long_description = f.read()
# get the dependencies and installs
with open(here / "requirements.txt", encoding="utf-8") as f:
all_reqs = f.read().split("\n")
# Extra dependencies for geometric operations
# we deliberately do not set any lower nor upper bounds on `geopandas`
# dependency so that people might install its cythonized version
geo = ["geopandas", "shapely >= 1.0.0"]
install_requires = [x.strip() for x in all_reqs if "git+" not in x]
dependency_links = [
x.strip().replace("git+", "") for x in all_reqs if x.startswith("git+")
]
if platform.system() == "Windows":
backend = "numba"
install_requires.append("numba")
else:
backend = "pythran"
paths = ["pylandstats/landscape.py"]
make_backend_files([here / path for path in paths], backend=backend)
if platform.system() == "Linux":
compile_args = ("-O3", "-DUSE_XSIMD")
else:
compile_args = ("-O3",)
extensions = init_transonic_extensions(
"pylandstats", compile_args=compile_args, backend=backend
)
setup(
name="pylandstats",
version=__version__,
description="Open-source Python library to compute landscape metrics",
long_description=long_description,
long_description_content_type="text/markdown",
classifiers=classifiers,
url="https://github.com/martibosch/pylandstats",
author="Martí Bosch",
license="GPL-3.0",
packages=find_packages(exclude=["docs", "tests*"]),
include_package_data=True,
install_requires=install_requires,
extras_require={"geo": geo},
dependency_links=dependency_links,
ext_modules=extensions,
)