Skip to content
Commits on Source (4)
......@@ -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 .
......
......@@ -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
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
......
# -*- 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'
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
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
......@@ -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."
......
......@@ -2,7 +2,7 @@
jobs:
- job:
displayName: vs2017-win2016
displayName: Conda Win64
pool:
vmImage: 'vs2017-win2016'
strategy:
......
python-rtree (0.9.3-1) unstable; urgency=medium
* New upstream release.
-- Bas Couwenberg <sebastic@debian.org> Wed, 11 Dec 2019 08:40:36 +0100
python-rtree (0.9.2-1) unstable; urgency=medium
* New upstream release.
......
......@@ -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
===============
......
......@@ -2,4 +2,4 @@ from .index import Rtree
from .core import rt
__version__ = '0.9.2'
__version__ = '0.9.3'
......@@ -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)
......