[Git][debian-gis-team/fiona][upstream] New upstream version 1.8.19

Bas Couwenberg gitlab at salsa.debian.org
Thu Apr 8 05:08:33 BST 2021



Bas Couwenberg pushed to branch upstream at Debian GIS Project / fiona


Commits:
4b66595a by Bas Couwenberg at 2021-04-08T05:52:56+02:00
New upstream version 1.8.19
- - - - -


9 changed files:

- + .github/workflows/ci_linux.yml
- − .travis.yml
- CHANGES.txt
- README.rst
- fiona/__init__.py
- fiona/_env.pyx
- fiona/env.py
- fiona/ogrext.pyx
- pyproject.toml


Changes:

=====================================
.github/workflows/ci_linux.yml
=====================================
@@ -0,0 +1,216 @@
+name: Linux CI
+
+on: [push, pull_request]
+
+jobs:
+  build:
+    name: Python ${{ matrix.python }} / GDAL ${{ matrix.GDALVERSION }} / PROJ ${{ matrix.PROJVERSION }}
+    runs-on: [ubuntu-18.04]
+    if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          # Test all supported gdal minor versions (except latest stable) with one python version
+          - {
+              python: 3.6,
+              GDALVERSION: "2.0.3",
+              PROJVERSION: "4.9.3",
+              allow_failure: "false",
+            }
+          - {
+              python: 3.6,
+              GDALVERSION: "2.1.4",
+              PROJVERSION: "4.9.3",
+              allow_failure: "false",
+            }
+          - {
+              python: 3.6,
+              GDALVERSION: "2.2.4",
+              PROJVERSION: "4.9.3",
+              allow_failure: "false",
+            }
+          - {
+              python: 3.6,
+              GDALVERSION: "2.3.3",
+              PROJVERSION: "4.9.3",
+              allow_failure: "false",
+            }
+          - {
+              python: 3.6,
+              GDALVERSION: "2.4.4",
+              PROJVERSION: "4.9.3",
+              allow_failure: "false",
+            }
+          - {
+              python: 3.6,
+              GDALVERSION: "3.0.4",
+              PROJVERSION: "6.2.1",
+              allow_failure: "false",
+            }
+          - {
+              python: 3.6,
+              GDALVERSION: "3.1.0",
+              PROJVERSION: "6.3.2",
+              allow_failure: "false",
+            }
+
+          # Test all supported python versions with latest stable gdal release
+          - {
+              python: 3.6,
+              GDALVERSION: "3.2.1",
+              PROJVERSION: "7.2.1",
+              allow_failure: "false",
+            }
+          - {
+              python: 3.7,
+              GDALVERSION: "3.2.1",
+              PROJVERSION: "7.2.1",
+              allow_failure: "false",
+            }
+          - {
+              python: 3.8,
+              GDALVERSION: "3.2.1",
+              PROJVERSION: "7.2.1",
+              allow_failure: "false",
+            }
+          - {
+              python: 3.9,
+              GDALVERSION: "3.2.1",
+              PROJVERSION: "7.2.1",
+              allow_failure: "false",
+            }
+
+          # Test GDAL master
+          - {
+              python: 3.6,
+              GDALVERSION: "master",
+              PROJVERSION: "7.2.1",
+              allow_failure: "true",
+            }
+
+    env:
+      CYTHON_COVERAGE: "true"
+      MAKEFLAGS: "-j 4 -s"
+      CXXFLAGS: "-O0"
+      CFLAGS: "-O0"
+      PROJVERSION: ${{ matrix.PROJVERSION }}
+      GDALVERSION: ${{ matrix.GDALVERSION }}
+      GDALINST: ${{ github.workspace }}/gdalinstall
+      GDALBUILD: ${{ github.workspace }}/gdalbuild
+      PROJINST: ${{ github.workspace }}/gdalinstall
+      PROJBUILD: ${{ github.workspace }}/projbuild
+      FILEGDB: ${{ github.workspace }}/gdalinstall/filegdb
+
+      # Emulate travis
+      TRAVIS_BUILD_DIR: ${{ github.workspace }}
+      TRAVIS_OS_NAME: "linux"
+
+    steps:
+      - uses: actions/checkout at v2
+
+      - name: Set up Python ${{ matrix.python }}
+        uses: actions/setup-python at v2
+        with:
+          python-version: ${{ matrix.python }}
+
+      - name: Set env variables
+        run: |
+
+          # Additional env variables
+          echo "GDAL_DATA=$GDALINST/gdal-$GDALVERSION/share/gdal" >> $GITHUB_ENV
+          echo "PROJ_LIB=$GDALINST/gdal-$GDALVERSION/share/proj" >> $GITHUB_ENV
+          echo "LD_LIBRARY_PATH=$GDALINST/gdal-$GDALVERSION/lib:$GDALINST/proj-$PROJVERSION/lib:$FILEGDB/lib:\$LD_LIBRARY_PATH" >> $GITHUB_ENV
+
+          # Add PATH
+          echo "$GDALINST/gdal-$GDALVERSION/bin" >> $GITHUB_PATH
+          echo "$GDALINST/proj-$PROJVERSION/bin" >> $GITHUB_PATH
+
+          echo "cat \$GITHUB_ENV"
+          cat $GITHUB_ENV
+          echo ""
+          echo "cat \$GITHUB_PATH"
+          cat $GITHUB_PATH
+
+      - name: Install apt packages
+        run: |
+          sudo apt-get install libatlas-base-dev libcurl4-openssl-dev libgeos-dev libfreexl-dev libzstd-dev libspatialite-dev
+
+          # Unlike travis, packages from non default repositories are installed.
+          # While default repositories e.g. bionic/universe or bionic/main) tend to keep packages at the same API / ABI level,
+          # this is not guaranteed with other repositories.  
+          # The following command creates a list of these packages, which is used as key for the GDAL cache
+          # The repositories of packages can be identified in the the output of `sudo apt-get install`
+          apt list --installed | grep 'libgeos-dev\|libxml2-dev' > $GITHUB_WORKSPACE/apt_list
+          cat $GITHUB_WORKSPACE/apt_list
+
+      - name: Cache GDAL binaries
+        uses: actions/cache at v2
+        with:
+          path: gdalinstall
+          key: ${{ runner.os }}-gdal-${{ matrix.GDALVERSION }}-proj-${{ matrix.PROJVERSION }}-${{ hashFiles('**/apt_list') }}
+
+      - name: Cache pip
+        uses: actions/cache at v2
+        with:
+          path: ~/.cache/pip
+          key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
+          restore-keys: |
+            ${{ runner.os }}-pip-
+
+      - name: Install Python dependencies
+        run: |
+          python -m pip install -U pip
+          python -m pip install -U wheel
+          python -m pip install -r requirements-ci.txt
+          python -m pip wheel -r requirements-dev.txt
+          python -m pip install -r requirements-dev.txt
+
+      - name: Build PROJ
+        run: |
+          chmod +x scripts/travis_proj_install.sh && ./scripts/travis_proj_install.sh
+
+      - name: Install FileGDB
+        run: |
+          chmod +x scripts/travis_filegdb_install.sh && ./scripts/travis_filegdb_install.sh
+
+      - name: Build GDAL
+        continue-on-error: ${{ matrix.allow_failure == 'true' }}
+        run: |
+          chmod +x scripts/travis_gdal_install.sh && ./scripts/travis_gdal_install.sh
+          gdal-config --version
+
+      - name: Build Fiona
+        continue-on-error: ${{ matrix.allow_failure == 'true' }}
+        run: |
+          if [ "$GDALVERSION" = "master" ]; then echo "Using gdal master"; elif [ $($GDALINST/gdal-$GDALVERSION/bin/gdal-config --version) == $(sed 's/[a-zA-Z].*//g' <<< $GDALVERSION) ]; then echo "Using gdal $GDALVERSION"; else echo "NOT using gdal $GDALVERSION as expected; aborting"; exit 1; fi
+          GDAL_CONFIG=$GDALINST/gdal-$GDALVERSION/bin/gdal-config python -m pip install --no-deps --force-reinstall --no-use-pep517 -e .
+
+      - name: Print Environment
+        continue-on-error: ${{ matrix.allow_failure == 'true' }}
+        run: |
+          echo "python -m pip freeze"
+          python -m pip freeze
+
+          echo ""
+          echo "fio --version"
+          fio --version
+
+          echo ""
+          echo "fio --gdal-version"
+          fio --gdal-version
+
+          echo ""
+          echo "python -c \"import fiona; fiona.show_versions()\""
+          python -c "import fiona; fiona.show_versions()"
+
+      - name: pytest
+        continue-on-error: ${{ matrix.allow_failure == 'true' }}
+        run: |
+          python -m pytest -m "not wheel" --cov fiona --cov-report term-missing
+
+      - name: Coveralls
+        continue-on-error: ${{ matrix.allow_failure == 'true' }}
+        run: coveralls || echo "!! intermittent coveralls failure"
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


=====================================
.travis.yml deleted
=====================================
@@ -1,124 +0,0 @@
-language: python
-dist: xenial
-# default gcc of bionic does not compile gdal 1.x
-
-cache:
-  directories:
-    - $GDALINST
-    - ~/.cache/pip
-
-env:
-  global:
-    - PIP_WHEEL_DIR=$HOME/.cache/pip/wheels
-    - PIP_FIND_LINKS=file://$HOME/.cache/pip/wheels
-    - GDALINST=$HOME/gdalinstall
-    - GDALBUILD=$HOME/gdalbuild
-    - PROJINST=$HOME/gdalinstall
-    - PROJBUILD=$HOME/projbuild
-    - FILEGDB=$HOME/gdalinstall/filegdb
-    - CYTHON_COVERAGE="true"
-    - MAKEFLAGS="-j 2"
-    - CXXFLAGS="-O0"
-    - CFLAGS="-O0"
-
-matrix:
-  include:
-    # Test all supported gdal minor versions (except latest stable) with one python version
-    - python: "3.6"
-      env:
-        GDALVERSION="1.11.5"
-        PROJVERSION="4.8.0"
-    - python: "3.6"
-      env:
-        GDALVERSION="2.0.3"
-        PROJVERSION="4.9.3"
-    - python: "3.6"
-      env:
-        GDALVERSION="2.1.4"
-        PROJVERSION="4.9.3"
-    - python: "3.6"
-      env:
-        GDALVERSION="2.2.4"
-        PROJVERSION="4.9.3"
-    - python: "3.6"
-      env:
-        GDALVERSION="2.3.3"
-        PROJVERSION="4.9.3"
-    - python: "3.6"
-      env:
-        GDALVERSION="2.4.4"
-        PROJVERSION="4.9.3"
-    - python: "3.6"
-      env:
-        GDALVERSION="3.0.4"
-        PROJVERSION="6.2.1"
-
-    # Test all supported python versions with latest stable gdal release
-    - python: "2.7"
-      env:
-        GDALVERSION="3.1.3"
-        PROJVERSION="6.3.2"
-    - python: "3.6"
-      env:
-        GDALVERSION="3.1.3"
-        PROJVERSION="6.3.2"
-    - python: "3.7"
-      env:
-        GDALVERSION="3.1.3"
-        PROJVERSION="6.3.2"
-    - python: "3.8"
-      env:
-        GDALVERSION="3.1.3"
-        PROJVERSION="6.3.2"
-
-    # Test master
-    - python: "3.8"
-      env:
-        GDALVERSION="master"
-        PROJVERSION="7.0.1"
-
-  allow_failures:
-    - env:
-        GDALVERSION="master"
-        PROJVERSION="7.0.1"
-
-addons:
-  apt:
-    packages:
-    - libatlas-dev
-    - libatlas-base-dev
-    - gfortran
-    - libsqlite3-dev
-    - sqlite3
-
-before_install:
-  - python -m pip install -U pip
-  - python -m pip install -r requirements-ci.txt
-  - python -m pip wheel -r requirements-dev.txt
-  - python -m pip install -r requirements-dev.txt
-  - export PATH=$GDALINST/gdal-$GDALVERSION/bin:$GDALINST/proj-$PROJVERSION/bin:$PATH
-  - export LD_LIBRARY_PATH=$GDALINST/gdal-$GDALVERSION/lib:$GDALINST/proj-$PROJVERSION/lib:$LD_LIBRARY_PATH
-  - . ./scripts/travis_proj_install.sh
-  - . ./scripts/travis_filegdb_install.sh
-  - . ./scripts/travis_gdal_install.sh
-  - export GDAL_DATA=$GDALINST/gdal-$GDALVERSION/share/gdal
-  - export PROJ_LIB=$GDALINST/gdal-$GDALVERSION/share/proj
-  - gdal-config --version
-
-install:
-  - if [ "$GDALVERSION" = "master" ]; then echo "Using gdal master"; elif [ $(gdal-config --version) == $(sed 's/[a-zA-Z].*//g' <<< $GDALVERSION) ]; then echo "Using gdal $GDALVERSION"; else echo "NOT using gdal $GDALVERSION as expected; aborting"; exit 1; fi
-  - "GDAL_CONFIG=$GDALINST/gdal-$GDALVERSION/bin/gdal-config python -m pip install --no-deps --force-reinstall --no-use-pep517 -e ."
-  - python -m pip freeze
-  - fio --version
-  - fio --gdal-version
-  - python -c "import fiona; fiona.show_versions()"
-  - python scripts/check_deprecated.py
-
-script:
-  - python -m pytest -m "not wheel" --cov fiona --cov-report term-missing
-
-after_script:
-  - python setup.py clean
-
-after_success:
-  - coveralls || echo "!! intermittent coveralls failure"


=====================================
CHANGES.txt
=====================================
@@ -3,6 +3,13 @@ Changes
 
 All issue numbers are relative to https://github.com/Toblerity/Fiona/issues.
 
+1.8.19 (2021-04-07)
+-------------------
+
+- In fiona/env.py the GDAL data path is now configured using set_gdal_config
+  instead by setting the GDAL_DATA environment variable (#1007).
+- Spurious iterator reset warnings have been eliminatged (#987).
+
 1.8.18 (2020-11-17)
 -------------------
 


=====================================
README.rst
=====================================
@@ -4,8 +4,8 @@ Fiona
 
 Fiona is GDAL_'s neat and nimble vector API for Python programmers.
 
-.. image:: https://travis-ci.org/Toblerity/Fiona.png?branch=master
-   :target: https://travis-ci.org/Toblerity/Fiona
+.. image:: https://github.com/Toblerity/Fiona/workflows/Linux%20CI/badge.svg?branch=maint-1.8
+   :target: https://github.com/Toblerity/Fiona/actions?query=branch%3Amaint-1.8
 
 .. image:: https://ci.appveyor.com/api/projects/status/github/Toblerity/Fiona?svg=true
    :target: https://ci.appveyor.com/project/sgillies/fiona/branch/master


=====================================
fiona/__init__.py
=====================================
@@ -105,7 +105,7 @@ with fiona._loading.add_gdal_dll_directories():
 
 
 __all__ = ['bounds', 'listlayers', 'open', 'prop_type', 'prop_width']
-__version__ = "1.8.18"
+__version__ = "1.8.19"
 __gdal_version__ = get_gdal_release_name()
 
 gdal_version = get_gdal_version_tuple()


=====================================
fiona/_env.pyx
=====================================
@@ -393,7 +393,6 @@ cdef class GDALEnv(ConfigEnv):
 
     def start(self):
         CPLPushErrorHandler(<CPLErrorHandler>logging_error_handler)
-        log.debug("Logging error handler pushed.")
 
         # The outer if statement prevents each thread from acquiring a
         # lock when the environment starts, and the inner avoids a
@@ -404,41 +403,53 @@ cdef class GDALEnv(ConfigEnv):
 
                     GDALAllRegister()
                     OGRRegisterAll()
-                    log.debug("All drivers registered.")
 
                     if 'GDAL_DATA' in os.environ:
+                        log.debug("GDAL_DATA found in environment.")
                         self.update_config_options(GDAL_DATA=os.environ['GDAL_DATA'])
-                        log.debug("GDAL_DATA found in environment: %r.", os.environ['GDAL_DATA'])
-
-                    # See https://github.com/mapbox/rasterio/issues/1631..
-                    elif GDALDataFinder().find_file("header.dxf"):
-                        log.debug("GDAL data files are available at built-in paths")
 
                     else:
-                        path = GDALDataFinder().search()
+                        path = GDALDataFinder().search_wheel()
 
                         if path:
+                            log.debug("GDAL data found in package: path=%r.", path)
                             self.update_config_options(GDAL_DATA=path)
-                            log.debug("GDAL_DATA not found in environment, set to %r.", path)
+
+                        # See https://github.com/mapbox/rasterio/issues/1631.
+                        elif GDALDataFinder().find_file("header.dxf"):
+                            log.debug("GDAL data files are available at built-in paths.")
+
+                        else:
+                            path = GDALDataFinder().search()
+
+                            if path:
+                                log.debug("GDAL data found in other locations: path=%r.", path)
+                                self.update_config_options(GDAL_DATA=path)
 
                     if 'PROJ_LIB' in os.environ:
-                        log.debug("PROJ_LIB found in environment: %r.", os.environ['PROJ_LIB'])
+                        log.debug("PROJ_LIB found in environment.")
                         path = os.environ["PROJ_LIB"]
                         set_proj_data_search_path(path)
 
-                    elif PROJDataFinder().has_data():
-                        log.debug("PROJ data files are available at built-in paths")
-
                     else:
-                        path = PROJDataFinder().search()
+                        path = PROJDataFinder().search_wheel()
 
                         if path:
-                            log.debug("PROJ data not found in environment, setting to %r.", path)
+                            log.debug("PROJ data found in package: path=%r.", path)
                             set_proj_data_search_path(path)
 
+                        elif PROJDataFinder().has_data():
+                            log.debug("PROJ data files are available at built-in paths.")
+
+                        else:
+                            path = PROJDataFinder().search()
+
+                            if path:
+                                log.debug("PROJ data found in other locations: path=%r.", path)
+                                set_proj_data_search_path(path)
+
                     if driver_count() == 0:
                         CPLPopErrorHandler()
-                        log.debug("Error handler popped")
                         raise ValueError("Drivers not registered.")
 
                     # Flag the drivers as registered, otherwise every thread
@@ -447,7 +458,7 @@ cdef class GDALEnv(ConfigEnv):
                     # actually makes it this far.
                     self._have_registered_drivers = True
 
-        log.debug("Started GDALEnv %r.", self)
+        log.debug("Started GDALEnv: self=%r.", self)
 
     def stop(self):
         # NB: do not restore the CPL error handler to its default


=====================================
fiona/env.py
=====================================
@@ -1,6 +1,5 @@
 """Fiona's GDAL/AWS environment"""
 
-from contextlib import contextmanager
 from functools import wraps, total_ordering
 import logging
 import os
@@ -13,9 +12,16 @@ from six import string_types
 import fiona._loading
 with fiona._loading.add_gdal_dll_directories():
     from fiona._env import (
-        GDALEnv, calc_gdal_version_num, get_gdal_version_num, get_gdal_config,
-        set_gdal_config, get_gdal_release_name, GDALDataFinder, PROJDataFinder,
-        set_proj_data_search_path)
+        GDALDataFinder,
+        GDALEnv,
+        PROJDataFinder,
+        calc_gdal_version_num,
+        get_gdal_config,
+        get_gdal_release_name,
+        get_gdal_version_num,
+        set_gdal_config,
+        set_proj_data_search_path,
+    )
     from fiona.compat import getargspec
     from fiona.errors import EnvError, GDALVersionError
     from fiona.session import Session, DummySession
@@ -323,8 +329,10 @@ def delenv():
 class NullContextManager(object):
     def __init__(self):
         pass
+
     def __enter__(self):
         return self
+
     def __exit__(self, *args):
         pass
 
@@ -589,36 +597,41 @@ def require_gdal_version(version, param=None, values=None, is_max_version=False,
 
 # Patch the environment if needed, such as in the installed wheel case.
 
-if "GDAL_DATA" not in os.environ:
+if 'GDAL_DATA' not in os.environ:
 
     path = GDALDataFinder().search_wheel()
 
     if path:
-        os.environ['GDAL_DATA'] = path
-        log.debug("GDAL data found in package, GDAL_DATA set to %r.", path)
+        log.debug("GDAL data found in package: path=%r.", path)
+        set_gdal_config("GDAL_DATA", path)
 
     # See https://github.com/mapbox/rasterio/issues/1631.
     elif GDALDataFinder().find_file("header.dxf"):
-        log.debug("GDAL data files are available at built-in paths")
+        log.debug("GDAL data files are available at built-in paths.")
 
     else:
         path = GDALDataFinder().search()
 
         if path:
-            os.environ['GDAL_DATA'] = path
-            log.debug("GDAL_DATA not found in environment, set to %r.", path)
+            set_gdal_config("GDAL_DATA", path)
+            log.debug("GDAL data found in other locations: path=%r.", path)
 
 if "PROJ_LIB" in os.environ:
     path = os.environ["PROJ_LIB"]
     set_proj_data_search_path(path)
 
+elif PROJDataFinder().search_wheel():
+    path = PROJDataFinder().search_wheel()
+    log.debug("PROJ data found in package: path=%r.", path)
+    set_proj_data_search_path(path)
+
 # See https://github.com/mapbox/rasterio/issues/1631.
 elif PROJDataFinder().has_data():
-    log.debug("PROJ data files are available at built-in paths")
+    log.debug("PROJ data files are available at built-in paths.")
 
 else:
     path = PROJDataFinder().search()
 
     if path:
-        log.debug("PROJ data not found in environment, setting to %r.", path)
+        log.debug("PROJ data found in other locations: path=%r.", path)
         set_proj_data_search_path(path)


=====================================
fiona/ogrext.pyx
=====================================
@@ -1438,6 +1438,7 @@ cdef class Iterator:
         # Set OGR_L_SetNextByIndex only if within range
         if start >= 0 and (self.ftcount == -1 or self.start < self.ftcount):
             exc_wrap_int(OGR_L_SetNextByIndex(session.cogr_layer, self.next_index))
+        session.cursor_interrupted = False
 
     def __iter__(self):
         return self
@@ -1467,7 +1468,7 @@ cdef class Iterator:
 
         # Set read cursor to next_item position
         if session.cursor_interrupted:
-            if not self.fastindex:
+            if not self.fastindex and not self.next_index == 0:
                 warnings.warn("Sequential read of iterator was interrupted. Resetting iterator. "
                               "This can negatively impact the performance.", RuntimeWarning)
             exc_wrap_int(OGR_L_SetNextByIndex(session.cogr_layer, self.next_index))


=====================================
pyproject.toml
=====================================
@@ -1,3 +1,2 @@
 [build-system]
-# Minimum requirements for the build system to execute.
-requires = ["setuptools", "wheel", "cython"]
+requires = ["setuptools", "wheel", "cython==0.29.21", "oldest-supported-numpy"]



View it on GitLab: https://salsa.debian.org/debian-gis-team/fiona/-/commit/4b66595a676a719ad2d71ed91740968a282277eb

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/fiona/-/commit/4b66595a676a719ad2d71ed91740968a282277eb
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20210408/154692fe/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list