Skip to content

Commit

Permalink
Merge pull request #100 from earthlab/upgrade-to-3.9
Browse files Browse the repository at this point in the history
Upgrade to 3.11
  • Loading branch information
eculler authored Sep 30, 2024
2 parents 2b98909 + f1b63a3 commit d414461
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-for-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: workflow_dispatch
jobs:
runtests:
name: "Set up environment"
runs-on: "ubuntu-latest"
runs-on: "ubuntu-20.04"
defaults:
run:
shell: bash -l {0}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: upgrade-to-3.9

- name: Login to DockerHub
uses: docker/login-action@v1
Expand All @@ -19,12 +21,12 @@ jobs:

- name: Build and push image
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5.1.0
with:
context: ./
file: ./Dockerfile
push: true
tags: earthlab/earth-analytics-python-env:${GITHUB_REF##*/}
tags: earthlab/earth-analytics-dev-env:latest

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
19 changes: 11 additions & 8 deletions .github/workflows/build-test-envt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
os:
- "ubuntu-latest"
- "macos-13"
- "macos-latest"
- "windows-latest"
defaults:
run:
shell: bash -l {0}
shell: bash -el {0}
steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
ref: ${{ github.head_ref || github.ref_name }}
- uses: conda-incubator/[email protected]
with:
miniconda-version: 'latest'
channels: conda-forge
channel-priority: true
auto-update-conda: false
auto-activate-base: false
environment-file: environment.yml
activate-environment: earth-analytics-python
- run: conda list
- run: python -c "import earthpy"
- run: python -c "import rasterio"
- run: python -c "import geopandas"
- run: python -c "import rioxarray"
38 changes: 27 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
FROM jupyter/minimal-notebook
FROM jupyter/minimal-notebook:python-3.11

MAINTAINER Leah Wasser <[email protected]>
# Installing package for libmamba
USER root
RUN apt-get update && \
apt-get install -y \
libfmt-dev \
libtiff5

COPY environment.yml environment.yml
USER jovyan

RUN conda env update --name base --file environment.yml \
&& conda info --envs \
&& conda list \
&& rm environment.yml
# Set up conda
RUN conda update conda
RUN conda config --remove channels conda-forge
RUN conda config --add channels conda-forge
#RUN conda config --set channel_priority strict
#RUN conda config --set solver classic

ENV PROJ_LIB $CONDA_DIR/share/proj
# Create environment
COPY environment.yml /home/jovyan/
RUN conda env update -n base -f /home/jovyan/environment.yml

# Test imports
RUN python -c "import rasterio"
RUN python -c "import earthpy"
# Activating environment
RUN echo ". /opt/conda/etc/profile.d/conda.sh" >> /home/jovyan/.bash_profile && \
echo "conda deactivate" >> /home/jovyan/.bash_profile && \
echo "conda activate base" >> /home/jovyan/.bash_profile
RUN . /opt/conda/etc/profile.d/conda.sh && conda activate base && python -m ipykernel install --user --name base
# using ~/.bash_profile instead of ~/.bashrc for non-interactive tty (-it) containers
RUN source /home/jovyan/.bash_profile

# Install dev version of Earthpy
RUN pip install git+https://github.com/earthlab/earthpy@apppears
88 changes: 51 additions & 37 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,69 @@ channels:
- defaults

dependencies:
- python=3.8
- python=3.11
- pip

# Core scientific python
- numpy
- pyqt
- tqdm
- kiwisolver

# Plotting
- matplotlib
- plotly
- seaborn
- pandas
- scipy

# Spatial packages
- pysal
# Geospatial libraries
# Coordinates and CRSs
- pyproj>=3.0
- rasterstats
- geopy
- cartopy
- descartes
- contextily
- earthpy
- folium
# Vector data
- geopandas
- geojson
- mapboxgl
- hydrofunctions
- geocoder
- tweepy
- pyogrio
# Raster data
- xarray
- rioxarray>=0.3.0
- scipy
- h5py
- netcdf4
- nc-time-axis
- rioxarray>=0.3.0
- xarray-spatial
- regionmask

# Natural language processing
- nltk
- textblob

# Jupyter Environment
- papermill
- autopep8

# Interactive computing
- ipython
- jupyterlab
- notebook
- ipython
- jupyter_contrib_nbextensions
- nbclean
- tqdm
- nbresuse
- papermill
- nbclean

# ML and modeling
- scikit-learn
- scikit-fuzzy

# Data access
- earthpy
- earthaccess
- pystac-client

# Autograding
- matplotcheck>=0.1.3
- nbgrader
# Plotting
# Matplotlib
- matplotlib
- nc-time-axis
- descartes
- contextily
- seaborn
# Holoviews
- hvplot
- geoviews>=1.10
- selenium
- phantomjs
- jupyter_bokeh
# Folium
- folium

# QA
- flake8
- flake8-import-order
- black
- autopep8
- pydocstyle
- nbqa

0 comments on commit d414461

Please sign in to comment.