[Git][debian-gis-team/fiona][master] 5 commits: New upstream version 1.9.6

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Fri Mar 8 04:47:44 GMT 2024



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


Commits:
0fd1181d by Bas Couwenberg at 2024-03-08T05:36:04+01:00
New upstream version 1.9.6
- - - - -
56e0d9e8 by Bas Couwenberg at 2024-03-08T05:36:06+01:00
Update upstream source from tag 'upstream/1.9.6'

Update to upstream version '1.9.6'
with Debian dir 27b014b612f25fcd5c96409942da110998bd09c8
- - - - -
1b8c2262 by Bas Couwenberg at 2024-03-08T05:36:56+01:00
New upstream release.

- - - - -
9205fd95 by Bas Couwenberg at 2024-03-08T05:38:33+01:00
Refresh patches.

- - - - -
c3a49b78 by Bas Couwenberg at 2024-03-08T05:38:48+01:00
Set distribution to unstable.

- - - - -


17 changed files:

- .readthedocs.yaml
- CHANGES.txt
- + Dockerfile
- MANIFEST.in
- + Makefile
- debian/changelog
- debian/patches/0001-Rename-fio-command-to-fiona-to-avoid-name-clash.patch
- environment.yml
- fiona/__init__.py
- fiona/_geometry.pyx
- fiona/gdal.pxi
- pyproject.toml
- tests/conftest.py
- + tests/data/multicurve.gml
- + tests/data/multicurve.xsd
- tests/test_curve_geometries.py
- tests/test_fio_info.py


Changes:

=====================================
.readthedocs.yaml
=====================================
@@ -7,3 +7,8 @@ build:
 
 conda:
   environment: environment.yml
+
+python:
+  install:
+    - method: setuptools
+      path: .


=====================================
CHANGES.txt
=====================================
@@ -3,6 +3,14 @@ Changes
 
 All issue numbers are relative to https://github.com/Toblerity/Fiona/issues.
 
+1.9.6 (2024-03-07)
+------------------
+
+- Ensure that geometry types in a schema are translated to a linear type, as
+  geometry instances are (#1313).
+- Fix broken stable API documentation on Read The Docs (#).
+- Remove install requirement of setuptools, a regression introduced in 1.9.5.
+
 1.9.5 (2023-10-11)
 ------------------
 
@@ -14,6 +22,8 @@ Bug fixes:
 
 Packaging:
 
+* The distribution name is now officially "fiona", not "Fiona". The import
+  name remains "fiona".
 * Builds now require Cython >= 3.0.2 (#1276).
 * PyPI wheels include GDAL 3.6.4, PROJ 9.0.1, and GEOS 3.11.2.
 * PyPI wheels include curl 8.4.0, addressing CVE-2023-38545 and CVE-38546.


=====================================
Dockerfile
=====================================
@@ -0,0 +1,30 @@
+ARG GDAL=ubuntu-small-3.6.4
+FROM ghcr.io/osgeo/gdal:${GDAL} AS gdal
+ARG PYTHON_VERSION=3.10
+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 pip && \
+    /venv/bin/python -m pip install build && \
+    /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
+ENTRYPOINT ["/venv/bin/fio"]
+CMD ["--help"]


=====================================
MANIFEST.in
=====================================
@@ -8,6 +8,9 @@ exclude *.txt *.py
 recursive-include docs *.rst *.txt
 recursive-include tests *.py
 recursive-include tests/data *
+exclude tests/data/coutwildrnp.gpkg
+exclude tests/data/coutwildrnp.json
+exclude tests/data/coutwildrnp.tar
 recursive-include fiona *.pyx *.pxd *.pxi
 recursive-exclude fiona *.c *.cpp
 include CHANGES.txt CITATION.cff CREDITS.txt LICENSE.txt README.rst


=====================================
Makefile
=====================================
@@ -0,0 +1,48 @@
+PYTHON_VERSION ?= 3.10
+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:
+	py.test --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 --build-arg GDAL=$(GDAL) --build-arg PYTHON_VERSION=$(PYTHON_VERSION) --target gdal -t fiona:$(GDAL)-py$(PYTHON_VERSION) .
+
+dockertest: 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 -e . && /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 build && /venv/bin/python -m pip install --pre -f dist fiona && /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 setup.py develop && 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 && python -m pip install . && cd docs && make clean && make html'


=====================================
debian/changelog
=====================================
@@ -1,4 +1,4 @@
-fiona (1.9.5-2) UNRELEASED; urgency=medium
+fiona (1.9.6-1) unstable; urgency=medium
 
   * Team upload.
 
@@ -6,7 +6,11 @@ fiona (1.9.5-2) UNRELEASED; urgency=medium
   * Improve cross building: Annotate test dependencies <!nocheck>.
     (Closes: #1059722)
 
- -- Bas Couwenberg <sebastic at debian.org>  Sat, 30 Dec 2023 19:51:19 +0100
+  [ Bas Couwenberg ]
+  * New upstream release.
+  * Refresh patches.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 08 Mar 2024 05:38:34 +0100
 
 fiona (1.9.5-1) unstable; urgency=medium
 


=====================================
debian/patches/0001-Rename-fio-command-to-fiona-to-avoid-name-clash.patch
=====================================
@@ -5,7 +5,7 @@ Forwarded: not-needed
 
 --- a/pyproject.toml
 +++ b/pyproject.toml
-@@ -56,7 +56,7 @@ test = [
+@@ -57,7 +57,7 @@ test = [
  ]
  
  [project.scripts]


=====================================
environment.yml
=====================================
@@ -6,6 +6,7 @@ dependencies:
 - pip
 - python=3.9.*
 - libgdal=3.4.*
+- cython=3
 - sphinx-click
 - sphinx-rtd-theme
 - pip:


=====================================
fiona/__init__.py
=====================================
@@ -82,7 +82,7 @@ __all__ = [
     "remove",
 ]
 
-__version__ = "1.9.5"
+__version__ = "1.9.6"
 __gdal_version__ = get_gdal_release_name()
 
 gdal_version = get_gdal_version_tuple()


=====================================
fiona/_geometry.pyx
=====================================
@@ -56,6 +56,10 @@ cdef object normalize_geometry_type_code(unsigned int code):
     # Normalize 'ZM' types to 3D types.
     elif 3000 < code < 4000:
         code = (code % 1000) | 0x80000000
+
+    # Normalize to a linear type.
+    code = OGR_GT_GetLinear(<OGRwkbGeometryType>code)
+
     if code not in GEOMETRY_TYPES:
         raise UnsupportedGeometryTypeError(code)
 


=====================================
fiona/gdal.pxi
=====================================
@@ -602,6 +602,7 @@ cdef extern from "ogr_api.h" nogil:
     long long OGR_F_GetFieldAsInteger64 (void *feature, int n)
     void    OGR_F_SetFieldInteger64 (void *feature, int n, long long value)
     int OGR_F_IsFieldNull(void *feature, int n)
+    OGRwkbGeometryType OGR_GT_GetLinear(OGRwkbGeometryType eType)
 
 
 cdef extern from "gdalwarper.h" nogil:


=====================================
pyproject.toml
=====================================
@@ -30,6 +30,7 @@ classifiers = [
     "Programming Language :: Python :: 3.9",
     "Programming Language :: Python :: 3.10",
     "Programming Language :: Python :: 3.11",
+    "Programming Language :: Python :: 3.12",
     "Topic :: Scientific/Engineering :: GIS",
 ]
 
@@ -45,11 +46,11 @@ dependencies = [
 ]
 
 [project.optional-dependencies]
-all = ["Fiona[calc,s3,test]"]
+all = ["fiona[calc,s3,test]"]
 calc = ["shapely"]
 s3 = ["boto3>=1.3.1"]
 test = [
-    "Fiona[s3]",
+    "fiona[s3]",
     "pytest>=7",
     "pytest-cov",
     "pytz",


=====================================
tests/conftest.py
=====================================
@@ -113,6 +113,12 @@ def path_curves_line_csv(data_dir):
     return os.path.join(data_dir, "curves_line.csv")
 
 
+ at pytest.fixture(scope="session")
+def path_multicurve_gml(data_dir):
+    """Path to ```multicurve.gml``"""
+    return os.path.join(data_dir, "multicurve.gml")
+
+
 @pytest.fixture(scope="session")
 def path_test_tin_shp(data_dir):
     """Path to ```test_tin.shp``"""


=====================================
tests/data/multicurve.gml
=====================================
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<ogr:FeatureCollection
+     gml:id="aFeatureCollection"
+     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xsi:schemaLocation="http://ogr.maptools.org/ multicurve.xsd"
+     xmlns:ogr="http://ogr.maptools.org/"
+     xmlns:gml="http://www.opengis.net/gml/3.2">
+  <gml:boundedBy><gml:Envelope><gml:lowerCorner>-0.9243407 46.2718257505296</gml:lowerCorner><gml:upperCorner>2.70658958605966 47.6054714507864</gml:upperCorner></gml:Envelope></gml:boundedBy>
+                                                                                                                                                             
+  <ogr:featureMember>
+    <ogr:multicurve gml:id="multicurve.0">
+      <gml:boundedBy><gml:Envelope><gml:lowerCorner>-0.9243407 46.2718257505296</gml:lowerCorner><gml:upperCorner>2.70658958605966 47.6054714507864</gml:upperCorner></gml:Envelope></gml:boundedBy>
+      <ogr:geometryProperty><gml:MultiCurve gml:id="multicurve.geom.0"><gml:curveMember><gml:CompositeCurve gml:id="multicurve.geom.0.0"><gml:curveMember><gml:LineString gml:id="multicurve.geom.0.0.0"><gml:posList>-0.9105691 47.21951 1.414634 47.17073</gml:posList></gml:LineString></gml:curveMember><gml:curveMember><gml:Curve gml:id="multicurve.geom.0.0.1"><gml:segments><gml:ArcString><gml:posList>1.414634 47.17073 2.423818 47.48377 1.407531 46.72668</gml:posList></gml:ArcString></gml:segments></gml:Curve></gml:curveMember><gml:curveMember><gml:LineString gml:id="multicurve.geom.0.0.2"><gml:posList>1.407531 46.72668 -0.9243407 46.72668</gml:posList></gml:LineString></gml:curveMember></gml:CompositeCurve></gml:curveMember></gml:MultiCurve></ogr:geometryProperty>
+      <ogr:WKT>MULTICURVE (COMPOUNDCURVE ((-0.9105691 47.21951,1.414634 47.17073),CIRCULARSTRING (1.414634 47.17073,2.423818 47.48377,1.407531 46.72668),(1.407531 46.72668,-0.9243407 46.72668)))</ogr:WKT>
+      <ogr:SHAPE_Length>8.39459167219456</ogr:SHAPE_Length>
+    </ogr:multicurve>
+  </ogr:featureMember>
+</ogr:FeatureCollection>


=====================================
tests/data/multicurve.xsd
=====================================
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema 
+    targetNamespace="http://ogr.maptools.org/"
+    xmlns:ogr="http://ogr.maptools.org/"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:gml="http://www.opengis.net/gml/3.2"
+    xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0"
+    elementFormDefault="qualified"
+    version="1.0">
+<xs:annotation>
+  <xs:appinfo source="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd">
+    <gmlsf:ComplianceLevel>0</gmlsf:ComplianceLevel>
+  </xs:appinfo>
+</xs:annotation>
+<xs:import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
+<xs:import namespace="http://www.opengis.net/gmlsf/2.0" schemaLocation="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd"/>
+<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:AbstractFeature"/>
+<xs:complexType name="FeatureCollectionType">
+  <xs:complexContent>
+    <xs:extension base="gml:AbstractFeatureType">
+      <xs:sequence minOccurs="0" maxOccurs="unbounded">
+        <xs:element name="featureMember">
+          <xs:complexType>
+            <xs:complexContent>
+              <xs:extension base="gml:AbstractFeatureMemberType">
+                <xs:sequence>
+                  <xs:element ref="gml:AbstractFeature"/>
+                </xs:sequence>
+              </xs:extension>
+            </xs:complexContent>
+          </xs:complexType>
+        </xs:element>
+      </xs:sequence>
+    </xs:extension>
+  </xs:complexContent>
+</xs:complexType>
+<xs:element name="multicurve" type="ogr:multicurve_Type" substitutionGroup="gml:AbstractFeature"/>
+<xs:complexType name="multicurve_Type">
+  <xs:complexContent>
+    <xs:extension base="gml:AbstractFeatureType">
+      <xs:sequence>
+        <xs:element name="geometryProperty" type="gml:MultiCurvePropertyType" nillable="true" minOccurs="0" maxOccurs="1"/> <!-- contains non-linear MultiCurve -->
+        <xs:element name="WKT" nillable="true" minOccurs="0" maxOccurs="1">
+          <xs:simpleType>
+            <xs:restriction base="xs:string">
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+        <xs:element name="SHAPE_Length" nillable="true" minOccurs="0" maxOccurs="1">
+          <xs:simpleType>
+            <xs:restriction base="xs:string">
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:extension>
+  </xs:complexContent>
+</xs:complexType>
+</xs:schema>


=====================================
tests/test_curve_geometries.py
=====================================
@@ -5,13 +5,18 @@ See https://trac.osgeo.org/gdal/wiki/rfc49_curve_geometries.
 
 import fiona
 
-from .conftest import requires_gdal2
 
-
- at requires_gdal2
 def test_line_curve_conversion(path_curves_line_csv):
     """Convert curved geometries to linear approximations"""
     with fiona.open(path_curves_line_csv) as col:
-        assert col.schema['geometry'] == 'Unknown'
+        assert col.schema["geometry"] == "Unknown"
         features = list(col)
         assert len(features) == 9
+
+
+def test_multicurve_conversion(path_multicurve_gml):
+    """Convert curved geometries to linear approximations"""
+    with fiona.open(path_multicurve_gml) as col:
+        assert col.schema["geometry"] == "MultiLineString"
+        features = list(col)
+        assert len(features) == 1


=====================================
tests/test_fio_info.py
=====================================
@@ -2,10 +2,14 @@
 
 
 import json
-from pkg_resources import iter_entry_points
 import re
 import sys
 
+if sys.version_info < (3, 10):
+    from importlib_metadata import entry_points
+else:
+    from importlib.metadata import entry_points
+
 from click.testing import CliRunner
 import pytest
 
@@ -41,7 +45,7 @@ def test_info_bounds(path_coutwildrnp_shp):
 def test_all_registered():
     """Make sure all the subcommands are actually registered to the main CLI
     group."""
-    for ep in iter_entry_points('fiona.fio_commands'):
+    for ep in entry_points(group="fiona.fio_commands"):
         assert ep.name in main_group.commands
 
 



View it on GitLab: https://salsa.debian.org/debian-gis-team/fiona/-/compare/826a4aaf2059df8a1b7ae7c14e7872059d72971e...c3a49b785f9207bb44e949b94c62a53688e1ae2e

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/fiona/-/compare/826a4aaf2059df8a1b7ae7c14e7872059d72971e...c3a49b785f9207bb44e949b94c62a53688e1ae2e
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/20240308/f4e2fcb6/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list