[fiona] 06/12: Replace initial GDAL 2.0 patches with upstream changes.

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Sun Feb 7 22:37:34 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository fiona.

commit 6f498bd592b5fff5e885d7d974adfaa84bc58d73
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Fri Dec 4 00:35:40 2015 +0100

    Replace initial GDAL 2.0 patches with upstream changes.
---
 debian/changelog                                   |   5 +-
 debian/control                                     |   1 -
 ...-fio-command-to-fiona-to-avoid-name-clash.patch |   2 +-
 ...outside-reference-possible-privacy-breach.patch |   2 -
 debian/patches/0003-GDAL-2.0.patch                 | 190 +++++++++++++---
 .../0004-Just-use-int-as-a-plain-old-builtin.patch |  36 +++
 debian/patches/0004-clean-setup.patch              |  15 --
 ...at-fiona.remove-for-deleting-data-sources.patch | 246 +++++++++++++++++++++
 debian/patches/0005-builtins.patch                 |  40 ----
 .../0006-Remove-unknown-distribution-options.patch |  20 ++
 debian/patches/series                              |   5 +-
 11 files changed, 470 insertions(+), 92 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 6fa82c9..73b63af 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,7 @@
 fiona (1.6.2-2) UNRELEASED; urgency=medium
 
   * Team upload.
-  * Add patch for GDAL 2.0 support.
-  * Add patch to not cythonize in the clean target.
-  * Add patch to fix builtins ImportError with Python 2.
-  * Add build dependency on python-future for builtins module.
+  * Add patches for GDAL 2.0 support.
 
  -- Bas Couwenberg <sebastic at debian.org>  Fri, 23 Oct 2015 21:50:46 +0200
 
diff --git a/debian/control b/debian/control
index fa7e394..c19d2d2 100644
--- a/debian/control
+++ b/debian/control
@@ -25,7 +25,6 @@ Build-Depends: debhelper (>= 9),
                python-pytest,
                python3-pytest,
                python-sphinx,
-               python-future,
                gdal-bin
 Standards-Version: 3.9.6
 Vcs-Browser: http://anonscm.debian.org/cgit/pkg-grass/fiona.git
diff --git a/debian/patches/0001-Rename-fio-command-to-fiona-to-avoid-name-clash.patch b/debian/patches/0001-Rename-fio-command-to-fiona-to-avoid-name-clash.patch
index e2ca246..fdd825b 100644
--- a/debian/patches/0001-Rename-fio-command-to-fiona-to-avoid-name-clash.patch
+++ b/debian/patches/0001-Rename-fio-command-to-fiona-to-avoid-name-clash.patch
@@ -9,7 +9,7 @@ There is already another package providing a binary "fio" (fio).
 
 --- a/setup.py
 +++ b/setup.py
-@@ -177,7 +177,7 @@ setup_args = dict(
+@@ -181,7 +181,7 @@ setup_args = dict(
      packages=['fiona', 'fiona.fio'],
      entry_points='''
          [console_scripts]
diff --git a/debian/patches/0002-Remove-outside-reference-possible-privacy-breach.patch b/debian/patches/0002-Remove-outside-reference-possible-privacy-breach.patch
index 679b4e9..a7c9961 100644
--- a/debian/patches/0002-Remove-outside-reference-possible-privacy-breach.patch
+++ b/debian/patches/0002-Remove-outside-reference-possible-privacy-breach.patch
@@ -6,8 +6,6 @@ Subject: Remove outside reference possible-privacy-breach
  README.rst | 6 ------
  1 file changed, 6 deletions(-)
 
-diff --git a/README.rst b/README.rst
-index bfebc1b..a02c62a 100644
 --- a/README.rst
 +++ b/README.rst
 @@ -4,12 +4,6 @@ Fiona
diff --git a/debian/patches/0003-GDAL-2.0.patch b/debian/patches/0003-GDAL-2.0.patch
index 5563b0c..2a25c78 100644
--- a/debian/patches/0003-GDAL-2.0.patch
+++ b/debian/patches/0003-GDAL-2.0.patch
@@ -1,11 +1,10 @@
-Origin: https://github.com/Toblerity/Fiona/pull/275
+Origin: https://github.com/Toblerity/Fiona/commit/3ebef78f2d1af1e306ad2a1df043511bfc55c13b
 Bug: https://github.com/Toblerity/Fiona/issues/239
 Bug-Debian: https://bugs.debian.org/802808
-
 From 84e7ce2786e3d881d0a88156bb1e26167bb2ce0d Mon Sep 17 00:00:00 2001
 From: Rene Buffat <buffat at gmail.com>
 Date: Wed, 23 Sep 2015 22:40:37 +0200
-Subject: [PATCH 01/10] sperate implementation for gdal2
+Subject: [PATCH 01/16] sperate implementation for gdal2
 
 ---
  .travis.yml       |    2 +-
@@ -2988,7 +2987,7 @@ Subject: [PATCH 01/10] sperate implementation for gdal2
 +
 --- /dev/null
 +++ b/fiona/ogrext2.pyx
-@@ -0,0 +1,1307 @@
+@@ -0,0 +1,1312 @@
 +# These are extension functions and classes using the OGR C API.
 +
 +import datetime
@@ -3001,6 +3000,11 @@ Subject: [PATCH 01/10] sperate implementation for gdal2
 +import math
 +import uuid
 +
++if sys.version_info > (3,):
++    from builtins import int
++else:
++    from __builtin__ import int
++
 +from six import integer_types, string_types, text_type
 +
 +from fiona cimport ograpi
@@ -3014,7 +3018,7 @@ Subject: [PATCH 01/10] sperate implementation for gdal2
 +
 +from libc.stdlib cimport malloc, free
 +from libc.string cimport strcmp
-+from builtins import int
++
 +
 +log = logging.getLogger("Fiona")
 +class NullHandler(logging.Handler):
@@ -4298,12 +4302,35 @@ Subject: [PATCH 01/10] sperate implementation for gdal2
 +
 --- a/setup.py
 +++ b/setup.py
-@@ -72,11 +72,11 @@ include_dirs = []
+@@ -66,17 +66,34 @@ with open('CREDITS.txt', **open_kwds) as
+ with open('CHANGES.txt', **open_kwds) as f:
+     changes = f.read()
+ 
++
++def copy_gdalapi(gdalversion):
++    if gdalversion[0] == u'1':
++        log.info("Building Fiona for gdal 1.x: {}".format(gdal_output[3]))
++        shutil.copy('fiona/ogrext1.pyx', 'fiona/ogrext.pyx')
++        shutil.copy('fiona/ograpi1.pxd', 'fiona/ograpi.pxd')
++    else:
++        log.info("Building Fiona for gdal 2.x: {}".format(gdal_output[3]))
++        shutil.copy('fiona/ogrext2.pyx', 'fiona/ogrext.pyx')
++        shutil.copy('fiona/ograpi2.pxd', 'fiona/ograpi.pxd')
++ 
++if '--gdalversion' in sys.argv:
++    index = sys.argv.index('--gdalversion')
++    sys.argv.pop(index)
++    gdalversion = sys.argv.pop(index)
++    copy_gdalapi(gdalversion)
++
+ # By default we'll try to get options via gdal-config. On systems without,
+ # options will need to be set in setup.cfg or on the setup command line.
+ include_dirs = []
  library_dirs = []
  libraries = []
  extra_link_args = []
 -gdal_output = [None]*3
-+gdal_output = [None]*4
++gdal_output = [None] * 4
  
  try:
      gdal_config = os.environ.get('GDAL_CONFIG', 'gdal-config')
@@ -4312,30 +4339,49 @@ Subject: [PATCH 01/10] sperate implementation for gdal2
          gdal_output[i] = check_output([gdal_config, flag]).strip()
  
      for item in gdal_output[0].split():
-@@ -138,6 +138,16 @@ if os.path.exists("MANIFEST.in"):
+@@ -91,6 +108,8 @@ try:
+             # e.g. -framework GDAL
+             extra_link_args.append(item)
+ 
++    copy_gdalapi(gdal_output[3])
++
+ except Exception as e:
+     if os.name == "nt":
+         log.info(("Building on Windows requires extra options to setup.py to locate needed GDAL files.\n"
+@@ -131,13 +150,14 @@ ext_options = dict(
+     extra_link_args=extra_link_args)
+ 
+ # When building from a repo, Cython is required.
+-if os.path.exists("MANIFEST.in"):
++if os.path.exists("MANIFEST.in") and "clean" not in sys.argv:
+     log.info("MANIFEST.in found, presume a repo, cythonizing...")
+     if not cythonize:
+         log.critical(
              "Cython.Build.cythonize not found. "
              "Cython is required to build from a repo.")
          sys.exit(1)
 +
-+    if gdal_output[3][0] == u'1':
-+        log.info("Building Fiona for gdal 1.x: {}".format(gdal_output[3]))
-+        shutil.copy('fiona/ogrext1.pyx', 'fiona/ogrext.pyx')
-+        shutil.copy('fiona/ograpi1.pxd', 'fiona/ograpi.pxd')
-+    else:
-+        log.info("Building Fiona for gdal 2.x: {}".format(gdal_output[3]))
-+        shutil.copy('fiona/ogrext2.pyx', 'fiona/ogrext.pyx')
-+        shutil.copy('fiona/ograpi2.pxd', 'fiona/ograpi.pxd')
-+
      ext_modules = cythonize([
          Extension('fiona._geometry', ['fiona/_geometry.pyx'], **ext_options),
          Extension('fiona._transform', ['fiona/_transform.pyx'], **ext_options),
+@@ -166,8 +186,8 @@ setup_args = dict(
+     metadata_version='1.2',
+     name='Fiona',
+     version=version,
+-    requires_python = '>=2.6',
+-    requires_external = 'GDAL (>=1.8)',
++    requires_python='>=2.6',
++    requires_external='GDAL (>=1.8)',
+     description="Fiona reads and writes spatial data files",
+     license='BSD',
+     keywords='gis vector feature data',
 --- a/requirements.txt
 +++ b/requirements.txt
 @@ -2,3 +2,4 @@ argparse
  cligj
  six
  ordereddict
-+future
++munch
 --- /dev/null
 +++ b/tests/test_bigint.py
 @@ -0,0 +1,69 @@
@@ -4410,15 +4456,6 @@ Subject: [PATCH 01/10] sperate implementation for gdal2
 +    unittest.main()
 --- a/tests/test_props.py
 +++ b/tests/test_props.py
-@@ -6,7 +6,7 @@ import tempfile
- import fiona
- from fiona import prop_type, prop_width
- from fiona.rfc3339 import FionaDateType
--
-+from builtins import int
- 
- def test_width_str():
-     assert prop_width('str:254') == 254
 @@ -22,8 +22,8 @@ def test_width_other():
  def test_types():
      assert prop_type('str:254') == text_type
@@ -4430,3 +4467,102 @@ Subject: [PATCH 01/10] sperate implementation for gdal2
      assert prop_type('date') == FionaDateType
  
  
+--- /dev/null
++++ b/.gitignore
+@@ -0,0 +1,69 @@
++# Byte-compiled / optimized / DLL files
++__pycache__/
++*.py[cod]
++
++# C extensions
++*.so
++
++# Distribution / packaging
++.Python
++env/
++build/
++develop-eggs/
++dist/
++downloads/
++eggs/
++.eggs/
++lib/
++lib64/
++parts/
++sdist/
++var/
++*.egg-info/
++.installed.cfg
++*.egg
++
++# PyInstaller
++#  Usually these files are written by a python script from a template
++#  before PyInstaller builds the exe, so as to inject date/other infos into it.
++*.manifest
++*.spec
++
++# Installer logs
++pip-log.txt
++pip-delete-this-directory.txt
++
++# Unit test / coverage reports
++htmlcov/
++.tox/
++.coverage
++.coverage.*
++.cache
++nosetests.xml
++coverage.xml
++*,cover
++
++# Translations
++*.mo
++*.pot
++
++# Django stuff:
++*.log
++
++# Sphinx documentation
++docs/_build/
++
++# PyBuilder
++target/
++
++# IDE's etc.
++.idea/
++venv/
++venv2/
++
++#fiona
++fiona/ogrext.c
++fiona/_drivers.c
++fiona/_err.c
++fiona/_geometry.c
++fiona/_transform.cpp
+--- a/README.rst
++++ b/README.rst
+@@ -236,7 +236,7 @@ gdal``).
+ Python Requirements
+ -------------------
+ 
+-Fiona depends on the modules ``six``, ``cligj``, ``argparse``, and
++Fiona depends on the modules ``six``, ``cligj``,  ``future``,  ``munch``, ``argparse``, and
+ ``ordereddict`` (the two latter modules are standard in Python 2.7+). Pip will
+ fetch these requirements for you, but users installing Fiona from a Windows
+ installer must get them separately.
+@@ -314,7 +314,7 @@ locations on your system (via your syste
+ If you have a non-standard environment, you'll need to specify the include and
+ lib dirs and GDAL library on the command line::
+ 
+-  (fiona_env)$ python setup.py build_ext -I/path/to/gdal/include -L/path/to/gdal/lib -lgdal develop
++  (fiona_env)$ python setup.py build_ext -I/path/to/gdal/include -L/path/to/gdal/lib -lgdal --gdalversion 2.0.1 develop
+   (fiona_env)$ nosetests
+ 
+ .. _OGR: http://www.gdal.org/ogr
+--- a/requirements-dev.txt
++++ b/requirements-dev.txt
+@@ -1,3 +1,4 @@
++-r requirements.txt
+ cython>=0.21.2
+ nose
+ pytest
diff --git a/debian/patches/0004-Just-use-int-as-a-plain-old-builtin.patch b/debian/patches/0004-Just-use-int-as-a-plain-old-builtin.patch
new file mode 100644
index 0000000..2b74377
--- /dev/null
+++ b/debian/patches/0004-Just-use-int-as-a-plain-old-builtin.patch
@@ -0,0 +1,36 @@
+Origin: https://github.com/Toblerity/Fiona/commit/805bb6224df389d493cee5b933a65f5b9e4026c9
+From c1b7189bfd5f1613eea017e474034a6a5f56827a Mon Sep 17 00:00:00 2001
+From: Sean Gillies <sean at mapbox.com>
+Date: Tue, 27 Oct 2015 13:04:39 -0600
+Subject: [PATCH] Just use int as a plain old builtin
+
+---
+ README.rst        | 2 +-
+ fiona/ogrext2.pyx | 5 -----
+ 2 files changed, 1 insertion(+), 6 deletions(-)
+
+--- a/README.rst
++++ b/README.rst
+@@ -236,7 +236,7 @@ gdal``).
+ Python Requirements
+ -------------------
+ 
+-Fiona depends on the modules ``six``, ``cligj``,  ``future``,  ``munch``, ``argparse``, and
++Fiona depends on the modules ``six``, ``cligj``,  ``munch``, ``argparse``, and
+ ``ordereddict`` (the two latter modules are standard in Python 2.7+). Pip will
+ fetch these requirements for you, but users installing Fiona from a Windows
+ installer must get them separately.
+--- a/fiona/ogrext2.pyx
++++ b/fiona/ogrext2.pyx
+@@ -10,11 +10,6 @@ import warnings
+ import math
+ import uuid
+ 
+-if sys.version_info > (3,):
+-    from builtins import int
+-else:
+-    from __builtin__ import int
+-
+ from six import integer_types, string_types, text_type
+ 
+ from fiona cimport ograpi
diff --git a/debian/patches/0004-clean-setup.patch b/debian/patches/0004-clean-setup.patch
deleted file mode 100644
index 7811862..0000000
--- a/debian/patches/0004-clean-setup.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Description: Don't cythonize in clean target.
- Just like [rasterio](https://github.com/mapbox/rasterio/blob/master/setup.py#L141)
-Author: Bas Couwenberg <sebastic at debian.org>
-
---- a/setup.py
-+++ b/setup.py
-@@ -131,7 +131,7 @@ ext_options = dict(
-     extra_link_args=extra_link_args)
- 
- # When building from a repo, Cython is required.
--if os.path.exists("MANIFEST.in"):
-+if os.path.exists("MANIFEST.in") and "clean" not in sys.argv:
-     log.info("MANIFEST.in found, presume a repo, cythonizing...")
-     if not cythonize:
-         log.critical(
diff --git a/debian/patches/0005-Initial-attempt-at-fiona.remove-for-deleting-data-sources.patch b/debian/patches/0005-Initial-attempt-at-fiona.remove-for-deleting-data-sources.patch
new file mode 100644
index 0000000..69d9013
--- /dev/null
+++ b/debian/patches/0005-Initial-attempt-at-fiona.remove-for-deleting-data-sources.patch
@@ -0,0 +1,246 @@
+From d8fcdeb95e10de9a1c8a6d2fbdcd5b8e861ae725 Mon Sep 17 00:00:00 2001
+From: Joshua Arnott <josh at snorfalorpagus.net>
+Date: Tue, 27 Oct 2015 23:40:38 +0000
+Subject: [PATCH 1/6] Initial attempt at fiona.remove from deleting data
+ sources
+
+---
+ fiona/__init__.py | 12 +++++++++++-
+ fiona/ogrext1.pyx | 18 ++++++++++++++++++
+ 2 files changed, 29 insertions(+), 1 deletion(-)
+
+--- a/fiona/__init__.py
++++ b/fiona/__init__.py
+@@ -72,7 +72,7 @@ from six import string_types
+ from fiona.collection import Collection, BytesCollection, vsi_path
+ from fiona._drivers import driver_count, GDALEnv, supported_drivers
+ from fiona.odict import OrderedDict
+-from fiona.ogrext import _bounds, _listlayers, FIELD_TYPES_MAP
++from fiona.ogrext import _bounds, _listlayers, FIELD_TYPES_MAP, _remove
+ 
+ # These modules are imported by fiona.ogrext, but are also import here to
+ # help tools like cx_Freeze find them automatically
+@@ -182,6 +182,33 @@ def open(
+ collection = open
+ 
+ 
++def remove(path_or_collection, driver=None):
++    """Deletes an OGR data source
++
++    The required ``path`` argument may be an absolute or relative file path.
++    Alternatively, a Collection can be passed instead in which case the path
++    and driver are automatically determined. Otherwise the ``driver`` argument
++    must be specified.
++
++    Raises a ``RuntimeError`` if the data source cannot be deleted.
++
++    Example usage:
++
++      fiona.remove('test.shp', 'ESRI Shapefile')
++
++    """
++    if isinstance(path_or_collection, Collection):
++        collection = path_or_collection
++        path = collection.path
++        driver = collection.driver
++        collection.close()
++    else:
++        path = path_or_collection
++        if driver is None:
++            raise ValueError("The driver argument is required when removing a path")
++    _remove(path, driver)
++
++
+ def listlayers(path, vfs=None):
+     """Returns a list of layer names in their index order.
+     
+--- a/fiona/ogrext1.pyx
++++ b/fiona/ogrext1.pyx
+@@ -59,6 +59,10 @@ FIELD_TYPES_MAP = {
+     'datetime': FionaDateTimeType
+    }
+ 
++# OGR Driver capability
++ODrCCreateDataSource = b"CreateDataSource"
++ODrCDeleteDataSource = b"DeleteDataSource"
++
+ # OGR Layer capability
+ OLC_RANDOMREAD = b"RandomRead"
+ OLC_SEQUENTIALWRITE = b"SequentialWrite"
+@@ -1171,6 +1175,27 @@ cdef class KeysIterator(Iterator):
+         return fid
+ 
+ 
++def _remove(path, driver=None):
++    """Deletes an OGR data source
++    """
++    cdef void *cogr_driver
++    cdef int result
++
++    if driver is None:
++        driver = 'ESRI Shapefile'
++
++    cogr_driver = ograpi.OGRGetDriverByName(driver.encode('utf-8'))
++    if cogr_driver == NULL:
++        raise ValueError("Null driver")
++
++    if not ograpi.OGR_Dr_TestCapability(cogr_driver, ODrCDeleteDataSource):
++        raise RuntimeError("Driver does not support dataset removal operation")
++
++    result = ograpi.OGR_Dr_DeleteDataSource(cogr_driver, path.encode('utf-8'))
++    if result != OGRERR_NONE:
++        raise RuntimeError("Failed to remove data source {}".format(path))
++
++
+ def _listlayers(path):
+ 
+     """Provides a list of the layers in an OGR data source.
+--- /dev/null
++++ b/tests/test_remove.py
+@@ -0,0 +1,77 @@
++import logging
++import sys
++import os
++
++import tempfile
++import pytest
++
++import fiona
++
++
++logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
++
++
++def create_sample_data(filename, driver):
++    meta = {
++        'driver': driver,
++        'schema': {
++            'geometry': 'Point',
++            'properties': {}
++        }
++    }
++    with fiona.open(filename, 'w', **meta) as dst:
++        dst.write({
++            'geometry': {
++                'type': 'Point',
++                'coordinates': (0, 0),
++            },
++            'properties': {},
++        })
++    assert(os.path.exists(filename))
++
++
++def test_remove(tmpdir=None):
++    if tmpdir is None:
++        tmpdir = tempfile.mkdtemp()
++    filename_shp = os.path.join(tmpdir, 'test.shp')
++    
++    create_sample_data(filename_shp, driver='ESRI Shapefile')
++    fiona.remove(filename_shp, driver='ESRI Shapefile')
++    assert(not os.path.exists(filename_shp))
++    
++    with pytest.raises(RuntimeError):
++        fiona.remove(filename_shp, driver='ESRI Shapefile')
++
++def test_remove_driver(tmpdir=None):
++    if tmpdir is None:
++        tmpdir = tempfile.mkdtemp()
++    filename_shp = os.path.join(tmpdir, 'test.shp')
++    filename_json = os.path.join(tmpdir, 'test.json')
++        
++    create_sample_data(filename_shp, driver='ESRI Shapefile')
++    create_sample_data(filename_json, driver='GeoJSON')
++    fiona.remove(filename_json, driver='GeoJSON')
++    assert(not os.path.exists(filename_json))
++    assert(os.path.exists(filename_shp))
++
++def test_remove_collection(tmpdir=None):
++    if tmpdir is None:
++        tmpdir = tempfile.mkdtemp()
++    filename_shp = os.path.join(tmpdir, 'test.shp')
++    
++    create_sample_data(filename_shp, driver='ESRI Shapefile')
++    collection = fiona.open(filename_shp, 'r')
++    fiona.remove(collection)
++    assert(not os.path.exists(filename_shp))
++
++def test_remove_path_without_driver(tmpdir=None):
++    if tmpdir is None:
++        tmpdir = tempfile.mkdtemp()
++    filename_shp = os.path.join(tmpdir, 'test.shp')
++
++    create_sample_data(filename_shp, driver='ESRI Shapefile')
++
++    with pytest.raises(Exception):
++        fiona.remove(filename_shp)
++
++    assert(os.path.exists(filename_shp))
+--- a/fiona/ogrext2.pyx
++++ b/fiona/ogrext2.pyx
+@@ -64,6 +64,10 @@ FIELD_TYPES_MAP = {
+     'datetime': FionaDateTimeType
+    }
+ 
++# OGR Driver capability
++ODrCCreateDataSource = b"CreateDataSource"
++ODrCDeleteDataSource = b"DeleteDataSource"
++
+ # OGR Layer capability
+ OLC_RANDOMREAD = b"RandomRead"
+ OLC_SEQUENTIALWRITE = b"SequentialWrite"
+@@ -1244,6 +1248,27 @@ cdef class KeysIterator(Iterator):
+         return fid
+ 
+ 
++def _remove(path, driver=None):
++    """Deletes an OGR data source
++    """
++    cdef void *cogr_driver
++    cdef int result
++
++    if driver is None:
++        driver = 'ESRI Shapefile'
++
++    cogr_driver = ograpi.OGRGetDriverByName(driver.encode('utf-8'))
++    if cogr_driver == NULL:
++        raise ValueError("Null driver")
++
++    if not ograpi.OGR_Dr_TestCapability(cogr_driver, ODrCDeleteDataSource):
++        raise RuntimeError("Driver does not support dataset removal operation")
++
++    result = ograpi.GDALDeleteDataset(cogr_driver, path.encode('utf-8'))
++    if result != OGRERR_NONE:
++        raise RuntimeError("Failed to remove data source {}".format(path))
++
++
+ def _listlayers(path):
+ 
+     """Provides a list of the layers in an OGR data source.
+--- a/fiona/ograpi2.pxd
++++ b/fiona/ograpi2.pxd
+@@ -36,6 +36,7 @@ cdef extern from "gdal.h":
+     void GDALFlushCache(void * hDS)
+     char * GDALGetDriverShortName(void * hDriver)
+     char * GDALGetDatasetDriver (void * hDataset)
++    int GDALDeleteDataset(void * hDriver, const char * pszFilename)
+ 
+ 
+     ctypedef enum GDALDataType:
+@@ -110,6 +111,7 @@ cdef extern from "ogr_api.h":
+     void *  OGR_Dr_CreateDataSource (void *driver, const char *path, char **options)
+     int     OGR_Dr_DeleteDataSource (void *driver, char *)
+     void *  OGR_Dr_Open (void *driver, const char *path, int bupdate)
++    int     OGR_Dr_TestCapability (void *driver, const char *)
+     void *  OGR_F_Create (void *featuredefn)
+     void    OGR_F_Destroy (void *feature)
+     long    OGR_F_GetFID (void *feature)
+--- a/fiona/ograpi1.pxd
++++ b/fiona/ograpi1.pxd
+@@ -62,6 +62,7 @@ cdef extern from "ogr_api.h":
+     void *  OGR_Dr_CreateDataSource (void *driver, const char *path, char **options)
+     int     OGR_Dr_DeleteDataSource (void *driver, char *)
+     void *  OGR_Dr_Open (void *driver, const char *path, int bupdate)
++    int     OGR_Dr_TestCapability (void *driver, const char *)
+     int     OGR_DS_DeleteLayer (void *datasource, int n)
+     void *  OGR_DS_CreateLayer (void *datasource, char *name, void *crs, int geomType, char **options)
+     void *  OGR_DS_ExecuteSQL (void *datasource, char *name, void *filter, char *dialext)
diff --git a/debian/patches/0005-builtins.patch b/debian/patches/0005-builtins.patch
deleted file mode 100644
index 3c0cb07..0000000
--- a/debian/patches/0005-builtins.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-Description: Use __builtin__ module for Python 2.
- Fixes exception:
-  ImportError: No module named builtins
-Author: Bas Couwenberg <sebastic at debian.org>
-
---- a/fiona/ogrext2.pyx
-+++ b/fiona/ogrext2.pyx
-@@ -23,7 +23,11 @@ from fiona.rfc3339 import FionaDateType,
- 
- from libc.stdlib cimport malloc, free
- from libc.string cimport strcmp
--from builtins import int
-+
-+if sys.version_info > (3,):
-+    from builtins import int
-+else:
-+    from __builtin__ import int
- 
- log = logging.getLogger("Fiona")
- class NullHandler(logging.Handler):
---- a/tests/test_props.py
-+++ b/tests/test_props.py
-@@ -2,11 +2,16 @@ import json
- import os.path
- from six import text_type
- import tempfile
-+import sys
- 
- import fiona
- from fiona import prop_type, prop_width
- from fiona.rfc3339 import FionaDateType
--from builtins import int
-+
-+if sys.version_info > (3,):
-+    from builtins import int
-+else:
-+    from __builtin__ import int
- 
- def test_width_str():
-     assert prop_width('str:254') == 254
diff --git a/debian/patches/0006-Remove-unknown-distribution-options.patch b/debian/patches/0006-Remove-unknown-distribution-options.patch
new file mode 100644
index 0000000..75848fd
--- /dev/null
+++ b/debian/patches/0006-Remove-unknown-distribution-options.patch
@@ -0,0 +1,20 @@
+Description: Remove unknown distribution options.
+ UserWarning: Unknown distribution option: 'metadata_version'
+ UserWarning: Unknown distribution option: 'requires_python'
+ UserWarning: Unknown distribution option: 'requires_external'
+Author: Bas Couwenberg <sebastic at debian.org>
+
+--- a/setup.py
++++ b/setup.py
+@@ -183,11 +183,8 @@ if sys.version_info < (2, 7):
+     requirements.append('ordereddict')
+ 
+ setup_args = dict(
+-    metadata_version='1.2',
+     name='Fiona',
+     version=version,
+-    requires_python='>=2.6',
+-    requires_external='GDAL (>=1.8)',
+     description="Fiona reads and writes spatial data files",
+     license='BSD',
+     keywords='gis vector feature data',
diff --git a/debian/patches/series b/debian/patches/series
index 5b4878e..8b5b0ac 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1,6 @@
 0001-Rename-fio-command-to-fiona-to-avoid-name-clash.patch
 0002-Remove-outside-reference-possible-privacy-breach.patch
 0003-GDAL-2.0.patch
-0004-clean-setup.patch
-#0005-builtins.patch
+0004-Just-use-int-as-a-plain-old-builtin.patch
+0005-Initial-attempt-at-fiona.remove-for-deleting-data-sources.patch
+0006-Remove-unknown-distribution-options.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/fiona.git



More information about the Pkg-grass-devel mailing list