Skip to content

Commit

Permalink
Merge pull request #613 from EnMAP-Box/ci_updates2
Browse files Browse the repository at this point in the history
conda environment Python pinned to 3.9
relates to #614 and #616
  • Loading branch information
jakimowb authored Sep 11, 2023
2 parents 220cda1 + 2d80755 commit 9a3ebd6
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 62 deletions.
6 changes: 4 additions & 2 deletions .conda/enmapbox_full_3.28.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ name: enmapbox_full_3.28
channels:
- conda-forge
dependencies:
- python>=3.11
- python=3.9
- qgis=3.28
- pip # avoids that conda uses the wrong pip
- pip # avoids conda from using the wrong pip
- scikit-learn>=1 # if necessary, this will install scipy and numpy too
- matplotlib # avoids that conda uses the wrong pip
- enpt
- xgboost
- lightgbm
Expand Down
6 changes: 4 additions & 2 deletions .conda/enmapbox_full_3.30.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ name: enmapbox_full_3.30
channels:
- conda-forge
dependencies:
- python>=3.11
- python=3.9
- qgis=3.30
- ipython
- pip # avoids that conda uses the wrong pip
- pip
- scikit-learn>=1 # if necessary, this will install scipy and numpy too
- matplotlib # avoids that conda uses the wrong pip
- enpt
- xgboost
- lightgbm
Expand Down
6 changes: 4 additions & 2 deletions .conda/enmapbox_full_3.32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ name: enmapbox_full_3.32
channels:
- conda-forge
dependencies:
- python>=3.11
- python=3.9
- ipython
- qgis=3.32
- pip # avoids that conda uses the wrong pip
- pip
- scikit-learn>=1 # if necessary, this will install scipy and numpy too
- matplotlib # avoids that conda uses the wrong pip
- enpt
- xgboost
- lightgbm
Expand Down
6 changes: 4 additions & 2 deletions .conda/enmapbox_full_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ name: enmapbox_full_latest
channels:
- conda-forge
dependencies:
- python>=3.11
- python=3.9
- qgis>=3.32
- pip # avoids that conda uses the wrong pip
- pip
- scikit-learn>=1 # if necessary, this will install scipy and numpy too
- matplotlib # avoids that conda uses the wrong pip
- enpt
- xgboost
- lightgbm
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# run: conda env create --file conda_environment.yml
# see also https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file
name: enmapbox_full_long_term
name: enmapbox_full_longterm
channels:
- conda-forge
dependencies:
- python>=3.11
- python=3.9
- qgis=3.28
- pip # avoids that conda uses the wrong pip
- pip
- scikit-learn>=1 # if necessary, this will install scipy and numpy too
- matplotlib # avoids that conda uses the wrong pip
- enpt
- xgboost
- lightgbm
Expand Down
4 changes: 3 additions & 1 deletion .conda/enmapbox_light_3.28.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ name: enmapbox_light_3.28
channels:
- conda-forge
dependencies:
- python>=3.11
- python=3.9
- qgis=3.28
- pip
- scikit-learn>=1 # if necessary, this will install scipy and numpy too
- matplotlib

# Development
- gitpython
Expand Down
4 changes: 3 additions & 1 deletion .conda/enmapbox_light_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ name: enmapbox_light_latest
channels:
- conda-forge
dependencies:
- python>=3.11
- python=3.9
- qgis>=3.32
- pip
- scikit-learn>=1 # if necessary, this will install scipy and numpy too
- matplotlib

# Development
- gitpython
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# run: conda env create --file conda_environment.yml
# see also https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file
name: enmapbox_light_3.28
name: enmapbox_light_longterm
channels:
- conda-forge
dependencies:
- qgis=3.28
- python>=3.11
- python=3.9
- pip
-
- matplotlib
# Development
- gitpython
- git-lfs
Expand Down
8 changes: 7 additions & 1 deletion .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ ARG QGIS_TEST_VERSION=latest
FROM qgis/qgis:${QGIS_TEST_VERSION}
MAINTAINER Benjamin Jakimow <[email protected]>

LABEL Description="Docker container with QGIS + EnMAP-Box" Vendor="QGIS.org"
LABEL Description="Docker container with QGIS + EnMAP-Box" Vendor="enmap.org"

RUN apt-get update && \
apt-get -y install python3-pip wget unzip \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get update


RUN echo "Basic python environment:"
RUN python3 --version
RUN pip3 list

RUN echo "Install missing EnMAP-Box requirements:"
COPY ./requirements.txt /tmp/
COPY ./requirements_developer.txt /tmp/
RUN pip3 install -r /tmp/requirements.txt
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,26 @@ name: ❄ Flake8

on:
push:
paths:
- '**.py'
branches:
- '**'
pull_request:
branches:
- main
- release-**
paths:
- '**.py'

jobs:
flake8_py3:
name: Python Lint
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.8
architecture: x64
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Run flake8
uses: julianwachholz/flake8-action@v2.0.2
uses: julianwachholz/flake8-action@v2
with:
checkName: 'Python Lint'
plugins: flake8-qgis
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
branches:
- main
- release-**

release:
types: [published]

Expand All @@ -20,7 +21,8 @@ jobs:
strategy:
matrix:
qgis_version: [release-3_28, release-3_32]
python: [3.10]
fail-fast: false

env:
QGIS_TEST_VERSION: ${{ matrix.qgis_version}}
steps:
Expand All @@ -37,7 +39,9 @@ jobs:
# ls -la /usr/bin
docker --version
- name: Python Packages Info
run: pip list
run: |
python3 --version
pip list
- name: Test EnMAP-Box on QGIS
run: |
chmod +x .docker/run_docker_tests.sh
Expand Down
70 changes: 37 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Documentation: http://enmap-box.readthedocs.io

Git Repository: https://github.com/EnMAP-Box/enmap-box

About EnMAP: https://www.enmap.org/

# Run the EnMAP-Box

The EnMAP-Box is a QGIS Plugin that can be installed from the QGIS Plugin Manager.
Expand All @@ -34,56 +36,58 @@ However, the following steps show you how to run the EnMAP-Box from python witho

## 1. Install QGIS

### conda / mamba environment (all OS)

Call one of the following commands to install a QGIS environment for the EnMAP-Box.

`latest` = most-recent QGIS version available in the [conda-forge](https://conda-forge.org/) channel.

`light` = basic QGIS installation only. No additional packages. In this environment the EnMAP-Box provides basic
visualization features only.

`full` = QGIS + all other python requirements that allow to run all EnMAP-Box features

````bash
mamba env create -n enmapbox_full_latest -f https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/.conda/enmapbox_full_latest.yml
mamba env create -n enmapbox_full_3.28 -f https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/.conda/enmapbox_full_3.28.yml
mamba env create -n enmapbox_light_latest -f https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/.conda/enmapbox_light_latest.yml
mamba env create -n enmapbox_light_3.28 -f https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/.conda/enmapbox_light_3.28.yml
````

You can update an existing environment with `mamba update`, e.g:

````bash
mamba env update -n enmapbox_full_3.28 --prune -f https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/.conda/enmapbox_full_3.28.yml
````
### conda / mamba (all OS)

`--prune` causes conda to remove any dependencies that are no longer required from the environment.
1. Install conda / mamba

### Windows OSGeo4W installer
2. Install one of the QGIS + EnMAP-Box environments listed in https://github.com/EnMAP-Box/enmap-box/tree/main/.conda

`latest` = the most-recent QGIS version available in the [conda-forge](https://conda-forge.org/) channel.

`light` = basic QGIS installation only. No additional packages. In this environment the EnMAP-Box provides basic
visualization features only.

`full` = QGIS + all other python requirements that allow to run all EnMAP-Box features

Examples:
````bash
mamba env create -f https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/.conda/enmapbox_full_latest.yml
mamba env create -f https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/.conda/enmapbox_full_3.28.yml
mamba env create -f https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/.conda/enmapbox_light_latest.yml
mamba env create -f https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/.conda/enmapbox_light_3.28.yml
````

The environment name corresponds to the `*.yml` basename. You can change it with `-n`, e.g. `-n myenvironmennane`.

tbd.

### Linux
* You can update an existing environment with `mamba update`, e.g:

````bash
mamba env update --prune -f https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/.conda/enmapbox_full_3.28.yml
````
* `-n myenvironmentname` allows to overwrite environments with names different to that specified in the `*.yml` file.
* `--prune` causes conda to remove any dependencies that are no longer required from the environment.

tbd.
### Windows / Linux / MacOS

### MacOS
Either use mamba (see above), or follow the OS-specific instructions here: https://qgis.org/en/site/forusers/download.html

tbd.

## 2. Clone this repository

Use the following commands to clone the EnMAP-Box and update its submodules:

### TLDR:

Open a shell that allows to run git and python with PyQGIS, then run:
Open a shell (e.g. OSGeo4W or mamba) that allows to run git and python with PyQGIS, then run:

````bash

````bash
# Clone the repository using ssh
# See https://docs.github.com/en/authentication/connecting-to-github-with-ssh for details on SSH
git clone --recurse-submodules [email protected]:EnMAP-Box/enmap-box.git
# alternatively, but not recommended, you can use https as well:

# alternatively (but not recommended) you can use https as well:
# git clone --recurse-submodules https://github.com/EnMAP-Box/enmap-box.git

cd enmap-box
Expand Down

0 comments on commit 9a3ebd6

Please sign in to comment.