[Git][debian-gis-team/python-rtree][upstream] New upstream version 0.9.3

Bas Couwenberg gitlab at salsa.debian.org
Wed Dec 11 07:54:27 GMT 2019



Bas Couwenberg pushed to branch upstream at Debian GIS Project / python-rtree


Commits:
edd4ba70 by Bas Couwenberg at 2019-12-11T07:39:01Z
New upstream version 0.9.3
- - - - -


11 changed files:

- .travis.yml
- azure-pipelines.yml
- ci/azp/linux.yml → ci/azp/conda.yml
- + ci/azp/docker.yml
- + ci/azp/linux-1604-pip.yml
- + ci/azp/linux-1804-pip.yml
- ci/azp/osx.yml
- ci/azp/win.yml
- docs/source/changes.txt
- rtree/__init__.py
- rtree/core.py


Changes:

=====================================
.travis.yml
=====================================
@@ -8,19 +8,15 @@ language: python
 
 matrix:
   include:
-    - python: "2.7"
-    - python: "3.3"
-    - python: "3.4"
     - python: "3.5"
     - python: "3.6"
-    - python: "3.7"
       sudo: required
-      dist: xenial
+      dist: trusty
 
 addons:
   apt:
     packages:
-      - libspatialindex-dev
+      - libspatialindex-c3
 
 install:
   - pip install -e .


=====================================
azure-pipelines.yml
=====================================
@@ -4,7 +4,10 @@ pr:
     - master
 
 jobs:
-  - template: ./ci/azp/linux.yml
+  - template: ./ci/azp/docker.yml
+  - template: ./ci/azp/conda.yml
   - template: ./ci/azp/win.yml
   - template: ./ci/azp/osx.yml
+  - template: ./ci/azp/linux-1604-pip.yml
+  - template: ./ci/azp/linux-1804-pip.yml
 


=====================================
ci/azp/linux.yml → ci/azp/conda.yml
=====================================
@@ -1,6 +1,6 @@
 jobs:
 - job:
-  displayName: ubuntu-16.04
+  displayName: Conda Linux
   pool:
     vmImage: 'ubuntu-16.04'
   strategy:
@@ -17,7 +17,7 @@ jobs:
       Python38:
         python.version: '3.8'
         sidx.version: '1.9.3'
-        
+
   steps:
   - bash: echo "##vso[task.prependpath]$CONDA/bin"
     displayName: Add conda to PATH


=====================================
ci/azp/docker.yml
=====================================
@@ -0,0 +1,41 @@
+# -*- mode: yaml -*-
+
+jobs:
+- job:
+  displayName: Conda - Docker
+  pool:
+    vmImage: ubuntu-16.04
+  container:
+      image: ubuntu:trusty
+      options: --privileged
+
+  steps:
+  - bash: |
+      DEBIAN_FRONTEND=noninteractive sudo apt-get update -y -qq
+      DEBIAN_FRONTEND=noninteractive sudo apt-get install wget libspatialindex-c3 -y
+      wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
+      bash miniconda.sh -b -p $HOME/miniconda
+      export PATH="$HOME/miniconda/bin:$PATH"
+      conda config --set always_yes yes
+      conda config --add channels conda-forge
+      conda update -q conda
+      conda create -q -n test-environment python=3.6
+      source activate test-environment
+    displayName: 'Install prerequisites'
+
+  - bash: |
+      export PATH="$HOME/miniconda/bin:$PATH"
+      source activate test-environment
+      pip install .
+    displayName: 'Install Rtree'
+
+  - bash: |
+      export PATH="$HOME/miniconda/bin:$PATH"
+      source activate test-environment
+      sudo locale-gen en_US.UTF-8
+      sudo update-locale LANG=en_US.UTF-8
+      export LANG="en_US.UTF-8"
+      export LC_ALL="en_US.UTF-8"
+      pip install pytest numpy
+      python -m pytest --doctest-modules rtree tests/test_*
+    displayName: 'Run pytest'


=====================================
ci/azp/linux-1604-pip.yml
=====================================
@@ -0,0 +1,19 @@
+jobs:
+- job:
+  displayName: ubuntu-16.04–pip
+  pool:
+    vmImage: 'ubuntu-16.04'
+
+  steps:
+  - bash: sudo apt install libspatialindex-c4v5 python3-pip
+    displayName: Install libspatialindex and pip
+
+  - bash: |
+      pip3 install setuptools
+      pip3 install .
+    displayName: pip install
+
+  - bash: |
+      pip3 install pytest numpy
+      python3 -m pytest --doctest-modules rtree tests/test_*
+    displayName: pytest


=====================================
ci/azp/linux-1804-pip.yml
=====================================
@@ -0,0 +1,19 @@
+jobs:
+- job:
+  displayName: ubuntu-18.04–pip
+  pool:
+    vmImage: 'ubuntu-18.04'
+
+  steps:
+  - bash: sudo apt install libspatialindex-c4v5 python3-pip
+    displayName: Install libspatialindex and pip
+
+  - bash: |
+      pip3 install setuptools
+      pip3 install .
+    displayName: pip install
+
+  - bash: |
+      pip3 install pytest numpy
+      python3 -m pytest --doctest-modules rtree tests/test_*
+    displayName: pytest


=====================================
ci/azp/osx.yml
=====================================
@@ -3,7 +3,7 @@
 
 jobs:
 - job:
-  displayName: macOS-10.13
+  displayName: Conda OSX 10.13
   pool:
     vmImage: 'macOS-10.13'
   strategy:
@@ -20,7 +20,7 @@ jobs:
       Python38:
         python.version: '3.8'
         sidx.version: '1.9.3'
-        
+
   steps:
   - script: |
       echo "Removing homebrew from Azure to avoid conflicts."


=====================================
ci/azp/win.yml
=====================================
@@ -2,7 +2,7 @@
 
 jobs:
 - job:
-  displayName: vs2017-win2016
+  displayName: Conda Win64
   pool:
     vmImage: 'vs2017-win2016'
   strategy:


=====================================
docs/source/changes.txt
=====================================
@@ -3,6 +3,11 @@
 Changes
 ..............................................................................
 
+0.9.3: 2019-12-10
+===============
+
+- find_library and libspatialindex library loading https://github.com/Toblerity/rtree/pull/131
+
 0.9.2: 2019-12-09
 ===============
 


=====================================
rtree/__init__.py
=====================================
@@ -2,4 +2,4 @@ from .index import Rtree
 
 from .core import rt
 
-__version__ = '0.9.2'
+__version__ = '0.9.3'


=====================================
rtree/core.py
=====================================
@@ -76,36 +76,38 @@ def free_error_msg_ptr(result, func, cargs):
     rt.Index_Free(p)
     return retvalue
 
-def _load_library(dllname, loadfunction, dllpaths=('', )):
-    """Load a DLL via ctypes load function. Return None on failure.
-    Try loading the DLL from the current package directory first,
-    then from the Windows DLL search path.
-    """
-    try:
-        dllpaths = (os.path.abspath(os.path.dirname(__file__)),
-                    ) + dllpaths
-    except NameError:
-        pass  # no __file__ attribute on PyPy and some frozen distributions
-    for path in dllpaths:
-        if path:
-            # temporarily add the path to the PATH environment variable
-            # so Windows can find additional DLL dependencies.
-            try:
-                oldenv = os.environ['PATH']
-                os.environ['PATH'] = path + ';' + oldenv
-            except KeyError:
-                oldenv = None
+
+if os.name == 'nt':
+
+    def _load_library(dllname, loadfunction, dllpaths=('', )):
+        """Load a DLL via ctypes load function. Return None on failure.
+        Try loading the DLL from the current package directory first,
+        then from the Windows DLL search path.
+        """
         try:
-            return loadfunction(os.path.join(path, dllname))
-        except (WindowsError, OSError):
-            pass
-        finally:
-            if path and oldenv is not None:
-                os.environ['PATH'] = oldenv
-    return None
+            dllpaths = (os.path.abspath(os.path.dirname(__file__)),
+                        ) + dllpaths
+        except NameError:
+            pass  # no __file__ attribute on PyPy and some frozen distributions
+        for path in dllpaths:
+            if path:
+                # temporarily add the path to the PATH environment variable
+                # so Windows can find additional DLL dependencies.
+                try:
+                    oldenv = os.environ['PATH']
+                    os.environ['PATH'] = path + ';' + oldenv
+                except KeyError:
+                    oldenv = None
+            try:
+                return loadfunction(os.path.join(path, dllname))
+            except (WindowsError, OSError):
+                pass
+            finally:
+                if path and oldenv is not None:
+                    os.environ['PATH'] = oldenv
+        return None
 
 
-if os.name == 'nt':
 
     base_name = 'spatialindex_c'
     if '64' in platform.architecture()[0]:
@@ -130,10 +132,6 @@ elif os.name == 'posix':
     if 'SPATIALINDEX_C_LIBRARY' in os.environ:
         lib_name = os.environ['SPATIALINDEX_C_LIBRARY']
         rt = ctypes.CDLL(lib_name)
-    elif 'conda' in sys.version:
-        lib_path = os.path.join(sys.prefix, "lib")
-        lib_name = find_library('spatialindex_c')
-        rt = _load_library(lib_name, ctypes.cdll.LoadLibrary, (lib_path,))
     else:
         lib_name = find_library('spatialindex_c')
         rt = ctypes.CDLL(lib_name)



View it on GitLab: https://salsa.debian.org/debian-gis-team/python-rtree/commit/edd4ba70fae843dfe16cd04e5827923f3d195e4a

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-rtree/commit/edd4ba70fae843dfe16cd04e5827923f3d195e4a
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/20191211/e6c2e351/attachment-0001.html>


More information about the Pkg-grass-devel mailing list