-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add python opener from rasterio 1.4 (#1331)
* Add rasterio's python opener from 1.4a1 and supporting things * Modern _path module and updated usage * A setup.cfg for editable installs * A Dockerfile and Makefile for testing Resolves #1328 * Add two more virtual filesystem tests
- Loading branch information
Showing
19 changed files
with
1,113 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
ARG GDAL=ubuntu-small-3.6.4 | ||
FROM ghcr.io/osgeo/gdal:${GDAL} AS gdal | ||
ARG PYTHON_VERSION=3.9 | ||
ENV LANG="C.UTF-8" LC_ALL="C.UTF-8" | ||
RUN apt-get update && apt-get install -y software-properties-common | ||
RUN add-apt-repository -y ppa:deadsnakes/ppa | ||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
g++ \ | ||
gdb \ | ||
make \ | ||
python3-pip \ | ||
python${PYTHON_VERSION} \ | ||
python${PYTHON_VERSION}-dev \ | ||
python${PYTHON_VERSION}-venv \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /app | ||
COPY requirements*.txt ./ | ||
RUN python${PYTHON_VERSION} -m venv /venv && \ | ||
/venv/bin/python -m pip install -U build pip && \ | ||
/venv/bin/python -m pip install -r requirements-dev.txt && \ | ||
/venv/bin/python -m pip list | ||
|
||
FROM gdal | ||
COPY . . | ||
RUN /venv/bin/python -m build -o wheels | ||
RUN /venv/bin/python -m pip install --no-index -f wheels fiona[test] | ||
ENTRYPOINT ["/venv/bin/fio"] | ||
CMD ["--help"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
PYTHON_VERSION ?= 3.9 | ||
GDAL ?= ubuntu-small-3.6.4 | ||
all: deps clean install test | ||
|
||
.PHONY: docs | ||
|
||
install: | ||
python setup.py build_ext | ||
pip install -e .[all] | ||
|
||
deps: | ||
pip install -r requirements-dev.txt | ||
|
||
clean: | ||
pip uninstall -y fiona || echo "no need to uninstall" | ||
python setup.py clean --all | ||
find . -name '__pycache__' -delete -print -o -name '*.pyc' -delete -print | ||
touch fiona/*.pyx | ||
|
||
sdist: | ||
python setup.py sdist | ||
|
||
test: | ||
python -m pytest --maxfail 1 -v --cov fiona --cov-report html --pdb tests | ||
|
||
docs: | ||
cd docs && make apidocs && make html | ||
|
||
doctest: | ||
py.test --doctest-modules fiona --doctest-glob='*.rst' docs/*.rst | ||
|
||
dockertestimage: | ||
docker build --target gdal --build-arg GDAL=$(GDAL) --build-arg PYTHON_VERSION=$(PYTHON_VERSION) -t fiona:$(GDAL)-py$(PYTHON_VERSION) . | ||
|
||
dockertest: dockertestimage | ||
docker run -it -v $(shell pwd):/app -v /tmp:/tmp --env AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY --entrypoint=/bin/bash fiona:$(GDAL)-py$(PYTHON_VERSION) -c '/venv/bin/python -m pip install --editable . --no-build-isolation && /venv/bin/python -B -m pytest -m "not wheel" --cov fiona --cov-report term-missing $(OPTS)' | ||
|
||
dockershell: dockertestimage | ||
docker run -it -v $(shell pwd):/app --env AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY --entrypoint=/bin/bash fiona:$(GDAL)-py$(PYTHON_VERSION) -c '/venv/bin/python -m pip install --editable . --no-build-isolation && /bin/bash' | ||
|
||
dockersdist: dockertestimage | ||
docker run -it -v $(shell pwd):/app --env AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY --entrypoint=/bin/bash fiona:$(GDAL)-py$(PYTHON_VERSION) -c '/venv/bin/python -m build --sdist' | ||
|
||
dockergdb: dockertestimage | ||
docker run -it -v $(shell pwd):/app --env AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY --entrypoint=/bin/bash fiona:$(GDAL)-py$(PYTHON_VERSION) -c '/venv/bin/python -m pip install --editable . --no-build-isolation && gdb -ex=r --args /venv/bin/python -B -m pytest -m "not wheel" --cov fiona --cov-report term-missing $(OPTS)' | ||
|
||
dockerdocs: dockertestimage | ||
docker run -it -v $(shell pwd):/app --entrypoint=/bin/bash fiona:$(GDAL)-py$(PYTHON_VERSION) -c 'source /venv/bin/activate && cd docs && make clean && make html' | ||
|
||
dockertestimage-amd64: | ||
docker build --platform linux/amd64 --target gdal --build-arg GDAL=$(GDAL) --build-arg PYTHON_VERSION=$(PYTHON_VERSION) -t fiona-amd64:$(GDAL)-py$(PYTHON_VERSION) . | ||
|
||
dockertest-amd64: dockertestimage-amd64 | ||
docker run -it -v $(shell pwd):/app -v /tmp:/tmp --env AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY --entrypoint=/bin/bash fiona-amd64:$(GDAL)-py$(PYTHON_VERSION) -c '/venv/bin/python -m pip install --editable . --no-build-isolation && /venv/bin/python -B -m pytest -m "not wheel" --cov fiona --cov-report term-missing $(OPTS)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.