-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
46 lines (40 loc) · 1.29 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
import re
from pathlib import Path
from setuptools import setup, find_packages
tests_require = [
"pytest",
"requests_mock",
]
def get_version(path: str = "src/openeo_classification/_version.py"):
# Single-sourcing package version (https://packaging.python.org/en/latest/guides/single-sourcing-package-version/#single-sourcing-the-package-version)
try:
regex = re.compile(r"^__version__\s*=\s*(?P<q>['\"])(?P<v>.+?)(?P=q)\s$", flags=re.MULTILINE)
with (Path(__file__).absolute().parent / path).open("r") as f:
return regex.search(f.read()).group("v")
except Exception:
raise RuntimeError("Failed to find version string.")
setup(
name="openeo_classification",
version=get_version(),
description='openEO based classification workflows & utilities, for landcover and crop mapping usecases.',
packages=find_packages(
where="src"
),
package_dir={"": "src"},
package_data={
"openeo_classification.resources": [
"grids/*.geojson",
]
},
install_requires=[
"setuptools",
"openeo>=0.9.0a1",
"geopandas",
"ipywidgets",
"rasterio",
"utm",
"scikit-learn",
],
tests_require=tests_require,
extras_require={"dev": tests_require},
)