Consolidates all PCIC Pydap handlers and responses. Uses the mainline Pydap for Python 3.
It is best practice to install Python projects in a virtual environment. We use Poetry to manage Python package dependencies and virtual environments. All instructions in this section assume that Poetry is installed on the host system.
This package uses GDAL version 3.0.4. It is tricky to install correctly. The following rigmarole, specifically with pre-installations and a special version of setuptools
, appears to the only way to get a successful installation. A brief explanation follows:
GDAL 3.0.4 requires something called use_2to3
. Modern versions of setuptools
do not support it; only versions setuptools<58
do. See, for example,
We must therefore explicitly install setuptools<58
before we install gdal
.
GDAL 3.0.4 cannot be installed successfully by later versions of pip
. Version 22.3.1 does work. We must ensure it is installed before installing gdal
.
GDAL 3.0.4 depends on numpy
. This is apparently not declared as a dependency but is flagged by gdal
as a warning if it is not already installed, and causes the installation to fail. The version must be numpy<=1.21
. Pre-installing numpy
solves this problem.
Poetry somehow still stumbles over installing gdal==3.0.4
using its own tooling. However, gdal
can be installed via Poetry into the virtualenv by using the appropriate version of pip
(see previous item). This circumvents whatever Poetry does.
Once the above steps have been taken, the installation can be completed using the normal poetry install
.
Note that dependencies have been organized into groups to make this as simple as possible. If and when later versions of GDAL are specified, this organization and the installation steps are likely to need to be updated. (Possibly, it will become simpler.)
Hence:
# Pre-install initial packages (pip, setuptools, numpy)
poetry install --only initial
# Install gdal using pip3 into the Poetry virtualenv
poetry run pip3 install gdal==3.0.4
# Install rest of project
poetry install
poetry run pytest
The app will run on port 8001.
poetry run python pydap_extras/app.py [filepath]
tool.poetry.version
in pyproject.toml
.NEWS.md
git add pyproject.toml NEWS.md
git commit -m"Bump to version X.Y.Z"
git tag -a -m"X.Y.Z" X.Y.Z
git push --follow-tags
pypi-publish.yml
will build and release the package
on our PyPI server.