Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix for new odd `micromamba` behaviors
- Set `MAMBA_ROOT_PREFIX`
- Set `use_lockfiles: False` in `.mambarc`
- Fix some issues using `mamba list` to list packages

### Changed

- Update example Miniforge version to 24.9.2-0
- Update example Miniforge version to 24.11.2-1
- Pin `hvplot` version to ">=0.11.0" (see [movingpandas#326](https://github.com/movingpandas/movingpandas/issues/326#issuecomment-2457862112))


### Added

- Added new `--basemap` option to install the basemap package
- NOTE: Doing this will downgrade numpy to v1. Thus, you cannot install packages that depend on numpy v2 (e.g., skimpy).
For now we do *NOT* default to having basemap installed. Hopefully this is temporary until such support is added
(see https://github.com/matplotlib/basemap/pull/611)
- Explicit Mamba Packages
- h5netcdf
- skimpy (only if not installing basemap)
- Explicit Pip Packages
- goes2go

### Removed

### Deprecated
Expand Down
43 changes: 33 additions & 10 deletions install_miniforge.bash
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ fi
# -----

EXAMPLE_PY_VERSION="3.12"
EXAMPLE_MINI_VERSION="24.9.2-0"
EXAMPLE_MINI_VERSION="24.11.2-1"
EXAMPLE_INSTALLDIR="/opt/GEOSpyD"
EXAMPLE_DATE=$(date +%F)
usage() {
echo "Usage: $0 --python_version <python version> --miniforge_version <miniforge> --prefix <prefix> [--micromamba | --mamba] [--blas <blas>] [--ffnet-hack]"
echo "Usage: $0 --python_version <python version> --miniforge_version <miniforge> --prefix <prefix>"
echo " [--micromamba | --mamba] [--blas <blas>] [--ffnet-hack] [--basemap]"
echo ""
echo " Required arguments:"
echo " --python_version <python version> (e.g., ${EXAMPLE_PY_VERSION})"
Expand All @@ -89,6 +90,7 @@ usage() {
echo " --micromamba: Use micromamba installer (default)"
echo " --mamba: Use mamba installer"
echo " --ffnet-hack: Install ffnet from fork (used on Bucy due to odd issue not finding gfortran)"
echo " --basemap: Install basemap (which downgrades numpy to v1 which prevents some packages from installing)"
echo " --help: Print this message"
echo ""
echo " By default we use the micromamba installer on both Linux and macOS"
Expand Down Expand Up @@ -158,6 +160,7 @@ fi
USE_MAMBA=FALSE
USE_MICROMAMBA=TRUE
FFNET_HACK=FALSE
INSTALL_BASEMAP=FALSE

while [[ $# -gt 0 ]]
do
Expand All @@ -181,6 +184,9 @@ do
--ffnet-hack)
FFNET_HACK=TRUE
;;
--basemap)
INSTALL_BASEMAP=TRUE
;;
--prefix)
MINIFORGE_DIR=$2
shift
Expand Down Expand Up @@ -369,7 +375,8 @@ fi

DATE=$(date +%F)
MINIFORGE_INSTALLDIR=$MINIFORGE_DIR/${MINIFORGE_VER}/$DATE
MINIFORGE_ENVDIR=$MINIFORGE_INSTALLDIR/envs/py${PYTHON_VER}
MINIFORGE_ENVNAME=py${PYTHON_VER}
MINIFORGE_ENVDIR=$MINIFORGE_INSTALLDIR/envs/${MINIFORGE_ENVNAME}

CANONICAL_INSTALLER=${MINIFORGE_DISTVER}-${MINIFORGE_VER}-${MINIFORGE_ARCH}-${MACH}.sh
if [[ "$MINIFORGE_VER" == "latest" ]]
Expand Down Expand Up @@ -540,14 +547,23 @@ $PACKAGE_INSTALL xesmf
$PACKAGE_INSTALL pytest
$PACKAGE_INSTALL xgcm
$PACKAGE_INSTALL s3fs boto3
$PACKAGE_INSTALL pip pipenv

$PACKAGE_INSTALL numpy scipy numba
$PACKAGE_INSTALL netcdf4 cartopy proj matplotlib
$PACKAGE_INSTALL virtualenv pipenv configargparse
$PACKAGE_INSTALL numpy scipy
$PACKAGE_INSTALL numba
$PACKAGE_INSTALL netcdf4 cartopy proj matplotlib h5netcdf
$PACKAGE_INSTALL virtualenv configargparse
$PACKAGE_INSTALL psycopg2 gdal xarray geotiff plotly
$PACKAGE_INSTALL iris pyhdf pip biggus hpccm cdsapi
$PACKAGE_INSTALL iris pyhdf biggus hpccm cdsapi
$PACKAGE_INSTALL babel beautifulsoup4 colorama gmp jupyter jupyterlab
$PACKAGE_INSTALL movingpandas geoviews hvplot">=0.11.0" geopandas bokeh
# We only install skimpy if the user does not ask for basemap, as it downgrades numpy
# to v1. So if asked we install it, if not, we can install other
# packages that need numpy v2 (e.g., skimpy)
if [[ $INSTALL_BASEMAP == FALSE ]]
then
$PACKAGE_INSTALL skimpy
fi
$PACKAGE_INSTALL intake intake-parquet intake-xarray

# Looks like mo_pack, libmo_pack, pyspharm, windspharm are not available on arm64
Expand Down Expand Up @@ -650,9 +666,16 @@ $PIP_INSTALL lxml
$PIP_INSTALL juliandate
$PIP_INSTALL pybufrkit
$PIP_INSTALL pyephem
$PIP_INSTALL basemap
# We only install Basemap if the user asks as it downgrades numpy
# to v1. So if asked we install it, if not, we can install other
# packages that need numpy v2 (e.g., skimpy)
if [[ $INSTALL_BASEMAP == TRUE ]]
then
$PIP_INSTALL basemap
fi
$PIP_INSTALL redis
$PIP_INSTALL Flask
$PIP_INSTALL goes2go

# some packages require a Fortran compiler. This sometimes isn't available
# on macs (though usually is)
Expand Down Expand Up @@ -732,8 +755,8 @@ $PIP_INSTALL prompt_toolkit
# Use mamba to output list of packages installed
# ----------------------------------------------
cd $MINIFORGE_ENVDIR
./bin/mamba list --show-channel-urls --explicit > distribution_spec_file.txt
./bin/mamba list --show-channel-urls > mamba_list_packages.txt
$MINIFORGE_BINDIR/mamba list -n $MINIFORGE_ENVNAME --show-channel-urls --explicit > distribution_spec_file.txt
$MINIFORGE_BINDIR/mamba list -n $MINIFORGE_ENVNAME --show-channel-urls > mamba_list_packages.txt
./bin/pip freeze > pip_freeze_packages.txt

# Restore User's .mambarc and .condarc using cleanup function
Expand Down