From 0dc99b29c5178531de0016199a743a5b65bf8fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDiga=20Luk=C5=A1i=C4=8D?= <31988337+zigaLuksic@users.noreply.github.com> Date: Thu, 31 Aug 2023 14:58:35 +0200 Subject: [PATCH] Prepare final subpackage release (#735) * prepare core * adjust remaining READMEs * adjust installed subpackages * slight tweaks to setup.py files * correct setup.py and remove interpackage deps * detect deprecated packages --- core/README.md | 4 ++-- core/deprecated_eolearn_core/__init__.py | 1 + core/setup.py | 7 ++----- coregistration/README.md | 4 ++-- .../deprecated_eolearn_coregistration/__init__.py | 1 + coregistration/requirements.txt | 1 - coregistration/setup.py | 4 +--- eolearn/__init__.py | 14 ++++++++++++++ features/README.md | 4 ++-- features/deprecated_eolearn_features/__init__.py | 1 + features/requirements.txt | 1 - features/setup.py | 4 +--- geometry/README.md | 4 ++-- geometry/deprecated_eolearn_geometry/__init__.py | 1 + geometry/requirements.txt | 1 - geometry/setup.py | 4 +--- io/README.md | 4 ++-- io/deprecated_eolearn_io/__init__.py | 1 + io/requirements.txt | 1 - io/setup.py | 4 +--- mask/README.md | 4 ++-- mask/deprecated_eolearn_mask/__init__.py | 1 + mask/requirements.txt | 1 - mask/setup.py | 10 +--------- ml_tools/MANIFEST.in | 5 ----- ml_tools/README.md | 4 ++-- ml_tools/deprecated_eolearn_ml_tools/__init__.py | 1 + ml_tools/requirements.txt | 1 - ml_tools/setup.py | 4 +--- visualization/README.md | 4 ++-- .../deprecated_eolearn_visualization/__init__.py | 1 + visualization/requirements.txt | 1 - visualization/setup.py | 4 +--- 33 files changed, 47 insertions(+), 60 deletions(-) create mode 100644 core/deprecated_eolearn_core/__init__.py create mode 100644 coregistration/deprecated_eolearn_coregistration/__init__.py create mode 100644 features/deprecated_eolearn_features/__init__.py create mode 100644 geometry/deprecated_eolearn_geometry/__init__.py create mode 100644 io/deprecated_eolearn_io/__init__.py create mode 100644 mask/deprecated_eolearn_mask/__init__.py delete mode 100644 ml_tools/MANIFEST.in create mode 100644 ml_tools/deprecated_eolearn_ml_tools/__init__.py create mode 100644 visualization/deprecated_eolearn_visualization/__init__.py diff --git a/core/README.md b/core/README.md index 8eda8be0e..cc0380f6f 100644 --- a/core/README.md +++ b/core/README.md @@ -1,5 +1,5 @@ # eolearn.core subpackage -The main subpackage which implements basic building blocks (EOPatch, EOTask and EOWorkflow) and commonly used functionalities. +The deprecated way to install `eolearn.core`. See [migration guide](https://github.com/sentinel-hub/eo-learn/issues/733) on how to correctly install the `eo-learn` package. -For more information about the module visit [readthedocs](https://eo-learn.readthedocs.io/en/latest/reference/eolearn.core.html), or see the [module task index](https://eo-learn.readthedocs.io/en/latest/eotasks.html#core). +Installs requirements and a dummy package that is detected by `eo-learn` but otherwise does not change anything. diff --git a/core/deprecated_eolearn_core/__init__.py b/core/deprecated_eolearn_core/__init__.py new file mode 100644 index 000000000..5b6018861 --- /dev/null +++ b/core/deprecated_eolearn_core/__init__.py @@ -0,0 +1 @@ +__version__ = "1.5.0" diff --git a/core/setup.py b/core/setup.py index d431fc039..00a8026d1 100644 --- a/core/setup.py +++ b/core/setup.py @@ -18,7 +18,7 @@ def parse_requirements(file): def get_version(): - path = os.path.join(os.path.dirname(__file__), "eolearn", "core", "__init__.py") + path = os.path.join(os.path.dirname(__file__), "deprecated_eolearn_core", "__init__.py") with open(path) as version_file: for line in version_file: if line.find("__version__") >= 0: @@ -44,15 +44,12 @@ def get_version(): author="Sinergise EO research team", author_email="eoresearch@sinergise.com", license="MIT", - packages=find_packages(exclude=["eolearn.tests*"]), - package_data={"eolearn": ["core/py.typed"]}, - include_package_data=True, + packages=find_packages(), install_requires=parse_requirements("requirements.txt"), extras_require={ "RAY": parse_requirements("requirements-ray.txt"), "ZARR": parse_requirements("requirements-zarr.txt"), }, - zip_safe=False, classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", diff --git a/coregistration/README.md b/coregistration/README.md index 407a914b0..94fdede85 100644 --- a/coregistration/README.md +++ b/coregistration/README.md @@ -1,5 +1,5 @@ # eolearn.coregistration subpackage -A collection of tools and EOTasks for image co-registration +The deprecated way to install `eolearn.coregistration`. See [migration guide](https://github.com/sentinel-hub/eo-learn/issues/733) on how to correctly install the `eo-learn` package. -For more information about the module visit [readthedocs](https://eo-learn.readthedocs.io/en/latest/reference/eolearn.coregistration.html), or see the [module task index](https://eo-learn.readthedocs.io/en/latest/eotasks.html#coregistration). +Installs requirements and a dummy package that is detected by `eo-learn` but otherwise does not change anything. diff --git a/coregistration/deprecated_eolearn_coregistration/__init__.py b/coregistration/deprecated_eolearn_coregistration/__init__.py new file mode 100644 index 000000000..5b6018861 --- /dev/null +++ b/coregistration/deprecated_eolearn_coregistration/__init__.py @@ -0,0 +1 @@ +__version__ = "1.5.0" diff --git a/coregistration/requirements.txt b/coregistration/requirements.txt index 0b5b46e2d..150d5c82c 100644 --- a/coregistration/requirements.txt +++ b/coregistration/requirements.txt @@ -1,3 +1,2 @@ # using headless version of opencv, otherwise gitlab runners fail -eo-learn-core opencv-python-headless diff --git a/coregistration/setup.py b/coregistration/setup.py index fd76eb52b..e09b78e5f 100644 --- a/coregistration/setup.py +++ b/coregistration/setup.py @@ -18,7 +18,7 @@ def parse_requirements(file): def get_version(): - path = os.path.join(os.path.dirname(__file__), "eolearn", "coregistration", "__init__.py") + path = os.path.join(os.path.dirname(__file__), "deprecated_eolearn_coregistration", "__init__.py") with open(path) as version_file: for line in version_file: if line.find("__version__") >= 0: @@ -45,9 +45,7 @@ def get_version(): author_email="eoresearch@sinergise.com", license="MIT", packages=find_packages(), - include_package_data=True, install_requires=parse_requirements("requirements.txt"), - zip_safe=False, classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", diff --git a/eolearn/__init__.py b/eolearn/__init__.py index 0f4393e52..c3566b29e 100644 --- a/eolearn/__init__.py +++ b/eolearn/__init__.py @@ -1,2 +1,16 @@ """Main module of the `eolearn` package.""" __version__ = "1.4.2" + +import importlib.util +import warnings + +SUBPACKAGES = ["core", "coregistration", "features", "geometry", "io", "mask", "ml_tools", "visualization"] +deprecated_installs = [ + subpackage for subpackage in SUBPACKAGES if importlib.util.find_spec(f"deprecated_eolearn_{subpackage}") is not None +] +if deprecated_installs: + warnings.warn( + f"You are currently using an outdated installation of `eo-learn` for submodules {deprecated_installs}. You can" + " find instructions on how to install `eo-learn` correctly at" + " https://github.com/sentinel-hub/eo-learn/issues/733." + ) diff --git a/features/README.md b/features/README.md index e477f5a99..15664d2c6 100644 --- a/features/README.md +++ b/features/README.md @@ -1,5 +1,5 @@ # eolearn.features subpackage -A collection of utilities for extracting data properties and feature manipulation. +The deprecated way to install `eolearn.features`. See [migration guide](https://github.com/sentinel-hub/eo-learn/issues/733) on how to correctly install the `eo-learn` package. -For more information about the module visit [readthedocs](https://eo-learn.readthedocs.io/en/latest/reference/eolearn.features.html), or see the [module task index](https://eo-learn.readthedocs.io/en/latest/eotasks.html#features). +Installs requirements and a dummy package that is detected by `eo-learn` but otherwise does not change anything. diff --git a/features/deprecated_eolearn_features/__init__.py b/features/deprecated_eolearn_features/__init__.py new file mode 100644 index 000000000..5b6018861 --- /dev/null +++ b/features/deprecated_eolearn_features/__init__.py @@ -0,0 +1 @@ +__version__ = "1.5.0" diff --git a/features/requirements.txt b/features/requirements.txt index 1e4813f68..3ea2d5070 100644 --- a/features/requirements.txt +++ b/features/requirements.txt @@ -1,4 +1,3 @@ -eo-learn-core numba>=0.53.0 numpy pillow>=9.1.0 diff --git a/features/setup.py b/features/setup.py index d59029034..d1e869c84 100644 --- a/features/setup.py +++ b/features/setup.py @@ -18,7 +18,7 @@ def parse_requirements(file): def get_version(): - path = os.path.join(os.path.dirname(__file__), "eolearn", "features", "__init__.py") + path = os.path.join(os.path.dirname(__file__), "deprecated_eolearn_features", "__init__.py") with open(path) as version_file: for line in version_file: if line.find("__version__") >= 0: @@ -45,9 +45,7 @@ def get_version(): author_email="eoresearch@sinergise.com", license="MIT", packages=find_packages(), - include_package_data=True, install_requires=parse_requirements("requirements.txt"), - zip_safe=False, classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", diff --git a/geometry/README.md b/geometry/README.md index eed6ec3cc..7dbf06e43 100644 --- a/geometry/README.md +++ b/geometry/README.md @@ -1,5 +1,5 @@ # eolearn.geometry subpackage -Geometry subpackage used for geometric transformation and conversion between vector and raster data. +The deprecated way to install `eolearn.geometry`. See [migration guide](https://github.com/sentinel-hub/eo-learn/issues/733) on how to correctly install the `eo-learn` package. -For more information about the module visit [readthedocs](https://eo-learn.readthedocs.io/en/latest/reference/eolearn.geometry.html), or see the [module task index](https://eo-learn.readthedocs.io/en/latest/eotasks.html#geometry). +Installs requirements and a dummy package that is detected by `eo-learn` but otherwise does not change anything. diff --git a/geometry/deprecated_eolearn_geometry/__init__.py b/geometry/deprecated_eolearn_geometry/__init__.py new file mode 100644 index 000000000..5b6018861 --- /dev/null +++ b/geometry/deprecated_eolearn_geometry/__init__.py @@ -0,0 +1 @@ +__version__ = "1.5.0" diff --git a/geometry/requirements.txt b/geometry/requirements.txt index 9218ee7fe..44d262fae 100644 --- a/geometry/requirements.txt +++ b/geometry/requirements.txt @@ -1,4 +1,3 @@ -eo-learn-core geopandas>=0.8.1 rasterio>=1.2.7, <1.3.8 scikit-image>=0.15.0 diff --git a/geometry/setup.py b/geometry/setup.py index 476057df8..5a4ead372 100644 --- a/geometry/setup.py +++ b/geometry/setup.py @@ -18,7 +18,7 @@ def parse_requirements(file): def get_version(): - path = os.path.join(os.path.dirname(__file__), "eolearn", "geometry", "__init__.py") + path = os.path.join(os.path.dirname(__file__), "deprecated_eolearn_geometry", "__init__.py") with open(path) as version_file: for line in version_file: if line.find("__version__") >= 0: @@ -45,9 +45,7 @@ def get_version(): author_email="eoresearch@sinergise.com", license="MIT", packages=find_packages(), - include_package_data=True, install_requires=parse_requirements("requirements.txt"), - zip_safe=False, classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", diff --git a/io/README.md b/io/README.md index 247847414..c989e1bb7 100644 --- a/io/README.md +++ b/io/README.md @@ -1,5 +1,5 @@ # eolearn.io subpackage -Input/output subpackage that deals with obtaining data from Sentinel Hub services or saving and loading data locally. +The deprecated way to install `eolearn.io`. See [migration guide](https://github.com/sentinel-hub/eo-learn/issues/733) on how to correctly install the `eo-learn` package. -For more information about the module visit [readthedocs](https://eo-learn.readthedocs.io/en/latest/reference/eolearn.io.html), or see the [module task index](https://eo-learn.readthedocs.io/en/latest/eotasks.html#io). +Installs requirements and a dummy package that is detected by `eo-learn` but otherwise does not change anything. diff --git a/io/deprecated_eolearn_io/__init__.py b/io/deprecated_eolearn_io/__init__.py new file mode 100644 index 000000000..5b6018861 --- /dev/null +++ b/io/deprecated_eolearn_io/__init__.py @@ -0,0 +1 @@ +__version__ = "1.5.0" diff --git a/io/requirements.txt b/io/requirements.txt index 6bc455e58..0b16c413d 100644 --- a/io/requirements.txt +++ b/io/requirements.txt @@ -1,6 +1,5 @@ affine boto3 -eo-learn-core fiona>=1.8.18 geopandas>=0.8.1 rasterio>=1.2.7, <1.3.8 diff --git a/io/setup.py b/io/setup.py index aa4891ce8..6bdea282e 100644 --- a/io/setup.py +++ b/io/setup.py @@ -18,7 +18,7 @@ def parse_requirements(file): def get_version(): - path = os.path.join(os.path.dirname(__file__), "eolearn", "io", "__init__.py") + path = os.path.join(os.path.dirname(__file__), "deprecated_eolearn_io", "__init__.py") with open(path) as version_file: for line in version_file: if line.find("__version__") >= 0: @@ -45,10 +45,8 @@ def get_version(): author_email="eoresearch@sinergise.com", license="MIT", packages=find_packages(), - include_package_data=True, install_requires=parse_requirements("requirements.txt"), extras_require={"METEOBLUE": parse_requirements("requirements-meteoblue.txt")}, - zip_safe=False, classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", diff --git a/mask/README.md b/mask/README.md index 8229d08e5..bcb6f7ffe 100644 --- a/mask/README.md +++ b/mask/README.md @@ -1,5 +1,5 @@ # eolearn.mask subpackage -The subpackage is used for masking of data and calculation of cloud masks. +The deprecated way to install `eolearn.mask`. See [migration guide](https://github.com/sentinel-hub/eo-learn/issues/733) on how to correctly install the `eo-learn` package. -For more information about the module visit [readthedocs](https://eo-learn.readthedocs.io/en/latest/reference/eolearn.mask.html), or see the [module task index](https://eo-learn.readthedocs.io/en/latest/eotasks.html#mask). +Installs requirements and a dummy package that is detected by `eo-learn` but otherwise does not change anything. diff --git a/mask/deprecated_eolearn_mask/__init__.py b/mask/deprecated_eolearn_mask/__init__.py new file mode 100644 index 000000000..5b6018861 --- /dev/null +++ b/mask/deprecated_eolearn_mask/__init__.py @@ -0,0 +1 @@ +__version__ = "1.5.0" diff --git a/mask/requirements.txt b/mask/requirements.txt index 2f17dd187..1a3a5467d 100644 --- a/mask/requirements.txt +++ b/mask/requirements.txt @@ -1,5 +1,4 @@ # using headless version of opencv, otherwise gitlab runners fail -eo-learn-core lightgbm>=2.0.11, <4 numpy opencv-python-headless diff --git a/mask/setup.py b/mask/setup.py index 5d78748e6..8d7e1ce62 100644 --- a/mask/setup.py +++ b/mask/setup.py @@ -18,7 +18,7 @@ def parse_requirements(file): def get_version(): - path = os.path.join(os.path.dirname(__file__), "eolearn", "mask", "__init__.py") + path = os.path.join(os.path.dirname(__file__), "deprecated_eolearn_mask", "__init__.py") with open(path) as version_file: for line in version_file: if line.find("__version__") >= 0: @@ -45,15 +45,7 @@ def get_version(): author_email="eoresearch@sinergise.com", license="MIT", packages=find_packages(), - include_package_data=True, - package_data={ - "eolearn.mask": [ - "models/pixel_s2_cloud_detector_lightGBM_v0.2.txt", - "models/ssim_s2_cloud_detector_lightGBM_v0.2.txt", - ] - }, install_requires=parse_requirements("requirements.txt"), - zip_safe=False, classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", diff --git a/ml_tools/MANIFEST.in b/ml_tools/MANIFEST.in deleted file mode 100644 index 970f86032..000000000 --- a/ml_tools/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include requirements*.txt -include LICENSE -include README.md -include eolearn/ml_tools/py.typed -exclude eolearn/tests/* diff --git a/ml_tools/README.md b/ml_tools/README.md index e0b5d137f..148a28ee1 100644 --- a/ml_tools/README.md +++ b/ml_tools/README.md @@ -1,5 +1,5 @@ # eolearn.ml_tools subpackage -Various tools that can be used before or after the machine learning process. +The deprecated way to install `eolearn.ml_tools`. See [migration guide](https://github.com/sentinel-hub/eo-learn/issues/733) on how to correctly install the `eo-learn` package. -For more information about the module visit [readthedocs](https://eo-learn.readthedocs.io/en/latest/reference/eolearn.ml-tools.html), or see the [module task index](https://eo-learn.readthedocs.io/en/latest/eotasks.html#ml-tools). +Installs requirements and a dummy package that is detected by `eo-learn` but otherwise does not change anything. diff --git a/ml_tools/deprecated_eolearn_ml_tools/__init__.py b/ml_tools/deprecated_eolearn_ml_tools/__init__.py new file mode 100644 index 000000000..5b6018861 --- /dev/null +++ b/ml_tools/deprecated_eolearn_ml_tools/__init__.py @@ -0,0 +1 @@ +__version__ = "1.5.0" diff --git a/ml_tools/requirements.txt b/ml_tools/requirements.txt index c9775b16b..21a9abe76 100644 --- a/ml_tools/requirements.txt +++ b/ml_tools/requirements.txt @@ -1,3 +1,2 @@ -eo-learn-core numpy shapely diff --git a/ml_tools/setup.py b/ml_tools/setup.py index eb910d862..26a21315b 100644 --- a/ml_tools/setup.py +++ b/ml_tools/setup.py @@ -18,7 +18,7 @@ def parse_requirements(file): def get_version(): - path = os.path.join(os.path.dirname(__file__), "eolearn", "ml_tools", "__init__.py") + path = os.path.join(os.path.dirname(__file__), "deprecated_eolearn_ml_tools", "__init__.py") with open(path) as version_file: for line in version_file: if line.find("__version__") >= 0: @@ -45,13 +45,11 @@ def get_version(): author_email="eoresearch@sinergise.com", license="MIT", packages=find_packages(), - include_package_data=True, install_requires=parse_requirements("requirements.txt"), extras_require={ "PLOTTING": parse_requirements("requirements-plotting.txt"), "TDIGEST": parse_requirements("requirements-tdigest.txt"), }, - zip_safe=False, classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", diff --git a/visualization/README.md b/visualization/README.md index f8aa261f7..3f5629740 100644 --- a/visualization/README.md +++ b/visualization/README.md @@ -1,5 +1,5 @@ # eolearn.visualization subpackage -A collection of data visualization utilities. +The deprecated way to install `eolearn.visualization`. See [migration guide](https://github.com/sentinel-hub/eo-learn/issues/733) on how to correctly install the `eo-learn` package. -For more information about the module visit [readthedocs](https://eo-learn.readthedocs.io/en/latest/reference/eolearn.visualization.html). +Installs requirements and a dummy package that is detected by `eo-learn` but otherwise does not change anything. diff --git a/visualization/deprecated_eolearn_visualization/__init__.py b/visualization/deprecated_eolearn_visualization/__init__.py new file mode 100644 index 000000000..5b6018861 --- /dev/null +++ b/visualization/deprecated_eolearn_visualization/__init__.py @@ -0,0 +1 @@ +__version__ = "1.5.0" diff --git a/visualization/requirements.txt b/visualization/requirements.txt index 8cfba60ef..17cff14cb 100644 --- a/visualization/requirements.txt +++ b/visualization/requirements.txt @@ -1,4 +1,3 @@ -eo-learn-core graphviz>=0.10.1 jinja2 matplotlib diff --git a/visualization/setup.py b/visualization/setup.py index bec11d81d..8201d00aa 100644 --- a/visualization/setup.py +++ b/visualization/setup.py @@ -18,7 +18,7 @@ def parse_requirements(file): def get_version(): - path = os.path.join(os.path.dirname(__file__), "eolearn", "visualization", "__init__.py") + path = os.path.join(os.path.dirname(__file__), "deprecated_eolearn_visualization", "__init__.py") with open(path) as version_file: for line in version_file: if line.find("__version__") >= 0: @@ -46,9 +46,7 @@ def get_version(): license="MIT", packages=find_packages(), package_data={"eolearn": ["visualization/report_templates/report.html"]}, - include_package_data=True, install_requires=parse_requirements("requirements.txt"), - zip_safe=False, classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers",