Commit 3bb6fb36 authored by Niklas Bohn's avatar Niklas Bohn
Browse files

Updated setup.py by removing check for packages that do not install well with pip.

parent f6cbaea7
......@@ -32,7 +32,6 @@ test_sicor_enmap:
- conda activate sicor_env
- export GDAL_DATA=/root/miniconda3/envs/sicor_env/share/gdal
- export PYTHONPATH=$PYTHONPATH:/root # /root <- directory needed later
- pip install pycodestyle --upgrade
- mamba install -c conda-forge gdown
# copy testdata
- cd /root/EnPT/enpt
......
......@@ -24,25 +24,9 @@
from setuptools import setup, find_packages
from importlib import util
requirements_save_to_install_with_setuptools = [
"scikit-image", "glymur", "pyprind", "gdown",
"dicttoxml", "tables", "pandas", "psutil", "sympy", "pyproj",
"cerberus", "scipy", "tqdm", "dill", "geoarray", "mpld3",
"jsmin", "iso8601", "pint", "matplotlib", "numpy",
"pillow", "arosics>=1.2.4", "numba", "netCDF4", "pyrsr", "py_tools_ds",
"cachetools", "requests", "ecmwf-api-client", "openpyxl"] # openpyxl is implicitly required by pandas.read_excel()
other_requirements = { # dict of "[needed import]: [proposed command for install]
"gdal": "conda install -c conda-forge gdal<=3.1.2",
"tables": "conda install -c conda-forge pytables",
"h5py": "conda install -c conda-forge h5py",
"numba": "conda install -c conda-forge numba",
"pyfftw": "conda install -c conda-forge pyfftw",
"pygrib": "conda install -c conda-forge pygrib",
"sklearn": "conda install -c conda-forge scikit-learn"
}
__author__ = "Niklas Bohn"
with open("README.rst") as readme_file:
readme = readme_file.read()
......@@ -51,28 +35,52 @@ version = {}
with open("sicor/version.py", encoding="utf-8") as version_file:
exec(version_file.read(), version)
requirements = requirements_save_to_install_with_setuptools
setup_requirements = ["setuptools-git"]
test_requirements = requirements + [
"coverage", "mock", "pylint", "mypy", "pycodestyle", "pydocstyle", "flake8", "sphinx", "sphinx-argparse", "nose",
'nose2', "nose-htmloutput", "rednose", "enpt>=0.17.1", "ipython_memory_usage", "urlchecker"
req = [
"gdal",
"h5py",
"pyfftw",
"pygrib",
"scikit-learn",
"scikit-image",
"glymur",
"pyprind",
"gdown",
"dicttoxml",
"tables",
"pandas",
"psutil",
"sympy",
"pyproj",
"cerberus",
"scipy",
"tqdm",
"dill",
"geoarray",
"mpld3",
"jsmin",
"iso8601",
"pint",
"matplotlib",
"numpy",
"pillow",
"arosics>=1.2.4",
"numba",
"netCDF4",
"pyrsr",
"py_tools_ds",
"cachetools",
"requests",
"ecmwf-api-client",
"openpyxl"] # openpyxl is implicitly required by pandas.read_excel()
req_setup = ["setuptools-git"] # needed for package_data version controlled by GIT
req_test = req + [
"coverage", "mock", "pylint", "mypy", "pycodestyle", "pydocstyle", "flake8", "sphinx", "sphinx-argparse",
"sphinx_rtd_theme", "nose", "nose2", "nose-htmloutput", "rednose", "enpt>=0.17.1", "ipython_memory_usage",
"urlchecker"
]
# test for packages that do not install well with pip
not_installed = {}
for needed_import, propossed_install_command in other_requirements.items():
is_installed = util.find_spec(needed_import)
if is_installed is None:
not_installed[needed_import] = propossed_install_command
if len(not_installed) > 0:
raise ImportError((
"Could not find the following packages (please use different installer, e.g. conda).\n" +
"\n".join(["missing: '{missing_import}', install, e.g. by: '{command}'".format(
missing_import=missing_import, command=command) for missing_import, command in not_installed.items()])
))
setup(
authors="Niklas Bohn, Daniel Scheffler, Maximilian Brell, André Hollstein, René Preusker",
author_email="nbohn@gfz-potsdam.de",
......@@ -95,7 +103,7 @@ setup(
])],
keywords=["SICOR", "EnMAP", "EnMAP-Box", "hyperspectral", "remote sensing", "satellite", "atmospheric correction"],
include_package_data=True,
install_requires=requirements,
install_requires=req,
license="GNU General Public License v3 (GPLv3)",
long_description=readme,
long_description_content_type="text/x-rst",
......@@ -108,9 +116,9 @@ setup(
"bin/sicor_ecmwf.py",
"bin/sicor_ac_EnMAP.py"
],
setup_requires=setup_requirements,
test_suite='tests',
tests_require=test_requirements,
setup_requires=req_setup,
test_suite="tests",
tests_require=req_test,
url="https://git.gfz-potsdam.de/EnMAP/sicor",
version=version["__version__"],
zip_safe=False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment