Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single package restructure #698

Merged
merged 21 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 5 additions & 26 deletions .github/workflows/ci_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,14 @@ jobs:
# caching the entire environment is faster when cache exists but slower for cache creation

- name: Install packages
run: |
pip install -r requirements-dev.txt --upgrade --upgrade-strategy eager
python install_all.py
pip install -r ml_tools/requirements-tdigest.txt
run: pip install .[DEV] --upgrade --upgrade-strategy eager

- name: Run pylint
run: make pylint
run: pylint eolearn

- name: Run mypy
if: success() || failure()
run: |
mypy \
core/eolearn/core \
coregistration/eolearn/coregistration \
geometry/eolearn/geometry \
features/eolearn/features \
io/eolearn/io \
mask/eolearn/mask \
ml_tools/eolearn/ml_tools \
visualization/eolearn/visualization
run: mypy eolearn

test-on-github:
runs-on: ubuntu-latest
Expand All @@ -95,19 +83,10 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# cache: pip # uncomment when all requirements are in `pyproject.toml`
cache: pip

- name: Install packages
if: matrix.python-version != '3.9'
run: |
pip install -r requirements-dev.txt --upgrade --upgrade-strategy eager
python install_all.py -e

- name: Install zarr backend # this will run Zarr backend tests on 3.9
if: matrix.python-version == '3.9'
run: |
pip install -r requirements-dev.txt -r core/requirements-zarr.txt --upgrade --upgrade-strategy eager
python install_all.py -e
run: pip install -e .[DEV] --upgrade --upgrade-strategy eager

- name: Run full tests and code coverage
if: ${{ matrix.full_test_suite }}
Expand Down
3 changes: 1 addition & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ run_sh_integration_tests:
- apt-get update
- apt-get install -y build-essential libgdal-dev graphviz proj-bin gcc libproj-dev libspatialindex-dev
script:
- pip install -r requirements-dev.txt --upgrade
- python install_all.py
- pip install eolearn[DEV]
- sentinelhub.config --sh_client_id "$SH_CLIENT_ID" --sh_client_secret "$SH_CLIENT_SECRET" > /dev/null # Gitlab can't mask SH_CLIENT_SECRET in logs
- pytest -m sh_integration
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ For any question, feel free to contact us at [[email protected]](eoresear

We strive to provide high-quality working code, but bugs happen nevertheless.

When reporting a bug, please check [here][open-bug-list] whether the bug was already reported. If not, open an issue with the **bug** label and report the following information:
When reporting a bug, please check [the issue tracker][open-bug-list] whether the bug was already reported. If not, open an issue with the **bug** label and report the following information:

* Issue description
* How to reproduce the issue
Expand All @@ -36,7 +36,7 @@ This information helps us to reproduce, pinpoint, and fix the reported issue. If

## Feature Requests

Existing feature requests can be found [here][existing-feature-requests].
Existing feature requests can be found [in the issues][existing-feature-requests].

A new feature request can be created by opening a new issue with the **enhancement** label, and describing how the feature would benefit the **eo-learn** community. Providing an example use-case would help assessing the scope of the feature request.

Expand Down
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

186 changes: 10 additions & 176 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,187 +1,21 @@
# Makefile for creating a new release of the package and uploading it to PyPI

PYTHON = python3
PACKAGES = core coregistration features geometry io mask ml_tools visualization
PYLINT = pylint

.PHONY: $(PACKAGES:test)
.SILENT: pylint pylint-fast

help:
@echo "Use 'make upload-<package>' to upload the package to PyPi"
@echo "Use 'make pylint' to run pylint on the code of all subpackages"
@echo "Use 'make test-upload' to upload the package to testPyPi"
@echo "Use 'make upload' to upload the package to PyPi"

mypy:
mypy \
core/eolearn/core \
coregistration/eolearn/coregistration \
geometry/eolearn/geometry \
features/eolearn/features \
io/eolearn/io \
mask/eolearn/mask \
ml_tools/eolearn/ml_tools \
visualization/eolearn/visualization

pylint:
# Runs pylint on all subpackages consecutively and makes sure any error status code gets propagated.
export PYLINT_STATUS=0
for package in $(PACKAGES) ; do \
$(PYLINT) $$package/eolearn/$$package || export PYLINT_STATUS=$$?; \
done;
exit $$PYLINT_STATUS


pylint-fast:
# Runs pylint on all subpackages in parallel. Because of that output verdicts are not in the order of package
# names and this process cannot be interrupted.
for package in $(PACKAGES) ; do \
$(PYLINT) $$package/eolearn/$$package & \
done;
wait

.ONESHELL:
build-core:
cd core
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE

.ONESHELL:
build-coregistration:
cd coregistration
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE

.ONESHELL:
build-features:
cd features
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE

.ONESHELL:
build-geometry:
cd geometry
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE

.ONESHELL:
build-io:
cd io
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE

.ONESHELL:
build-mask:
cd mask
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE

.ONESHELL:
build-ml-tools:
cd ml_tools
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE

.ONESHELL:
build-visualization:
cd visualization
cp ../LICENSE LICENSE
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel
rm LICENSE

.ONESHELL:
build-abstract-package:
rm -r dist build | true
$(PYTHON) setup.py sdist bdist_wheel

upload-core: build-core
twine upload core/dist/*

upload-coregistration: build-coregistration
twine upload coregistration/dist/*

upload-features: build-features
twine upload features/dist/*

upload-geometry: build-geometry
twine upload geometry/dist/*

upload-io: build-io
twine upload io/dist/*

upload-mask: build-mask
twine upload mask/dist/*

upload-ml-tools: build-ml-tools
twine upload ml_tools/dist/*

upload-visualization: build-visualization
twine upload visualization/dist/*

upload-abstract-package: build-abstract-package
twine upload dist/*

upload-all: \
upload-core \
upload-coregistration \
upload-features \
upload-geometry \
upload-io \
upload-mask \
upload-ml-tools \
upload-visualization \
upload-abstract-package
upload:
rm -r dist | true
python -m build --sdist --wheel
twine upload --skip-existing dist/*

# For testing:

test-upload-core: build-core
twine upload --repository testpypi core/dist/*

test-upload-coregistration: build-coregistration
twine upload --repository testpypi coregistration/dist/*

test-upload-features: build-features
twine upload --repository testpypi features/dist/*

test-upload-geometry: build-geometry
twine upload --repository testpypi geometry/dist/*

test-upload-io: build-io
twine upload --repository testpypi io/dist/*

test-upload-mask: build-mask
twine upload --repository testpypi mask/dist/*

test-upload-ml-tools: build-ml-tools
twine upload --repository testpypi ml_tools/dist/*

test-upload-visualization: build-visualization
twine upload --repository testpypi visualization/dist/*

test-upload-abstract-package: build-abstract-package
twine upload --repository testpypi dist/*

test-upload-all: \
test-upload-core \
test-upload-coregistration \
test-upload-features \
test-upload-geometry \
test-upload-io \
test-upload-mask \
test-upload-ml-tools \
test-upload-visualization \
test-upload-abstract-package
test-upload:
rm -r dist | true
python -m build --sdist --wheel
twine upload --repository testpypi --skip-existing dist/*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Examples and introductions to the package can be found [here](https://github.com

## Contributions

The list of all `eo-learn` contributors can be found [here](./CONTRIBUTING.md). If you would like to contribute to `eo-learn`, please check our [contribution guidelines](./CONTRIBUTING.md).
The list of all `eo-learn` contributors are listed in the [credits file](./CREDITS.md). If you would like to contribute to `eo-learn`, please check our [contribution guidelines](./CONTRIBUTING.md).

## Blog posts and papers

Expand Down
8 changes: 0 additions & 8 deletions core/MANIFEST.in

This file was deleted.

1 change: 0 additions & 1 deletion core/eolearn/__init__.py

This file was deleted.

5 changes: 0 additions & 5 deletions coregistration/MANIFEST.in

This file was deleted.

1 change: 0 additions & 1 deletion coregistration/eolearn/__init__.py

This file was deleted.

Empty file.
35 changes: 10 additions & 25 deletions docker/eolearn.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ LABEL maintainer="Sinergise EO research team <[email protected]>"
LABEL description="An official eo-learn docker image with a full eo-learn installation and Jupyter notebook."

RUN apt-get update && apt-get install -y \
gcc \
libgdal-dev \
graphviz \
proj-bin \
libproj-dev \
libspatialindex-dev \
gcc \
libgdal-dev \
graphviz \
proj-bin \
libproj-dev \
libspatialindex-dev \
&& apt-get clean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*

ENV CPLUS_INCLUDE_PATH=/usr/include/gdal
Expand All @@ -20,25 +20,10 @@ RUN pip3 install --no-cache-dir shapely --no-binary :all:

WORKDIR /tmp

COPY core core
COPY coregistration coregistration
COPY features features
COPY geometry geometry
COPY io io
COPY mask mask
COPY ml_tools ml_tools
COPY visualization visualization
COPY setup.py README.md requirements-dev.txt ./
COPY eolearn eolearn
COPY pyproject.toml README.md LICENSE ./

RUN pip3 install --no-cache-dir \
./core[RAY] \
./coregistration \
./features \
./geometry \
./io[METEOBLUE] \
./mask \
./ml_tools \
./visualization
RUN pip3 install --no-cache-dir .[FULL]

RUN pip3 install --no-cache-dir \
. \
Expand All @@ -56,4 +41,4 @@ WORKDIR /home/eolearner

EXPOSE 8888
CMD ["/usr/local/bin/jupyter", "notebook", "--no-browser", "--port=8888", "--ip=0.0.0.0", \
"--NotebookApp.token=''", "--allow-root"]
"--NotebookApp.token=''", "--allow-root"]
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ help:
%: Makefile
rm -rf ./build/
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
rm -r source/examples source/markdowns source/reference source/eotasks.rst
# rm -r source/examples source/markdowns source/reference source/eotasks.rst
Loading