[Git][debian-gis-team/pyosmium][master] 5 commits: New upstream version 3.4.0

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Thu Jul 28 06:00:22 BST 2022



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


Commits:
58903b41 by Bas Couwenberg at 2022-07-28T05:32:16+02:00
New upstream version 3.4.0
- - - - -
3e41305a by Bas Couwenberg at 2022-07-28T05:32:20+02:00
Update upstream source from tag 'upstream/3.4.0'

Update to upstream version '3.4.0'
with Debian dir 4ea569e751f3640167bd121e5aa52b5072247129
- - - - -
19e88095 by Bas Couwenberg at 2022-07-28T05:32:36+02:00
New upstream release.

- - - - -
df20719f by Bas Couwenberg at 2022-07-28T06:21:45+02:00
Add patch to fix doc build.

- - - - -
dc8b6ecf by Bas Couwenberg at 2022-07-28T06:21:45+02:00
Set distribution to unstable.

- - - - -


13 changed files:

- .github/workflows/ci.yml
- CHANGELOG.md
- README.md
- debian/changelog
- + debian/patches/pybuild.patch
- + debian/patches/series
- debian/rules
- doc/conf.py
- lib/simple_writer.cc
- setup.py
- src/osmium/version.py
- test/conftest.py
- test/test_writer.py


Changes:

=====================================
.github/workflows/ci.yml
=====================================
@@ -12,17 +12,6 @@ jobs:
             - name: Install packages
               run: sudo apt-get install -y -qq libboost-dev libexpat1-dev zlib1g-dev libbz2-dev libproj-dev libgeos-dev liblz4-dev
 
-            - name: Set up Python 3.5
-              uses: actions/setup-python at v2
-              with:
-                  python-version: 3.5
-
-            - name: Build package 3.5
-              run: |
-                pip install build wheel
-                python -m build
-              shell: bash
-
             - name: Set up Python 3.6
               uses: actions/setup-python at v2
               with:
@@ -91,7 +80,7 @@ jobs:
         strategy:
             fail-fast: false
             matrix:
-                python-version: [3.5, 3.6, 3.7, 3.8, 3.9, "3.10"]
+                python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
 
         steps:
             - uses: actions/checkout at v2
@@ -126,13 +115,13 @@ jobs:
                       cc: gcc-7
                       cxx: g++-7
                       platform: ubuntu-18.04
-                      python: 3.5
+                      python: 3.6
                       deps: release
                     - compiler: clang-old
                       cc: clang-6.0
                       cxx: clang++-6.0
                       platform: ubuntu-18.04
-                      python: 3.5
+                      python: 3.6
                       deps: release
                     - compiler: gcc
                       cc: gcc-10
@@ -217,19 +206,6 @@ jobs:
               run: vcpkg install bzip2:x64-windows expat:x64-windows zlib:x64-windows boost-variant:x64-windows boost-iterator:x64-windows lz4:x86-windows
               shell: bash
 
-            - name: Set up Python 3.5
-              uses: actions/setup-python at v2
-              with:
-                  python-version: 3.5
-
-            - name: Build package 3.5
-              run: |
-                pip install build wheel
-                python -m build
-              shell: bash
-              env:
-                  CMAKE_TOOLCHAIN_FILE: C:/vcpkg/scripts/buildsystems/vcpkg.cmake
-
             - name: Set up Python 3.6
               uses: actions/setup-python at v2
               with:
@@ -308,10 +284,7 @@ jobs:
         strategy:
             fail-fast: false
             matrix:
-                python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
-                include:
-                    - python-version: "3.10"
-                      test-args: "-k 'not test_amenity_list'" #no binary wheel for shapely available
+                python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
 
         env:
             PYTEST_ADDOPTS: ${{ matrix.test-args }}


=====================================
CHANGELOG.md
=====================================
@@ -4,6 +4,19 @@
 All notable changes to this project will be documented in this file.
 This project adheres to [Semantic Versioning](http://semver.org/).
 
+## [3.4.0] - 2022-07-27
+
+### Fixed
+
+- finding the build directory when newer versions of setuptools are used
+
+### Changed
+
+- improve error message when writing to a writer that is already closed
+- update to pybind 2.10.0
+- drop support for Python 3.5
+
+
 ## [3.3.0] - 2022-03-22
 
 ### Added


=====================================
README.md
=====================================
@@ -8,7 +8,7 @@ manner.
 
 ## Installation
 
-Pyosmium works with Python >= 3.5. Pypy is known to not work.
+Pyosmium works with Python >= 3.6. Pypy is known to not work.
 
 ### Using Pip
 


=====================================
debian/changelog
=====================================
@@ -1,8 +1,10 @@
-pyosmium (3.3.0-3) UNRELEASED; urgency=medium
+pyosmium (3.4.0-1) unstable; urgency=medium
 
+  * New upstream release.
   * Bump Standards-Version to 4.6.1, no changes.
+  * Add patch to fix doc build.
 
- -- Bas Couwenberg <sebastic at debian.org>  Tue, 21 Jun 2022 07:19:02 +0200
+ -- Bas Couwenberg <sebastic at debian.org>  Thu, 28 Jul 2022 05:33:45 +0200
 
 pyosmium (3.3.0-2) unstable; urgency=medium
 


=====================================
debian/patches/pybuild.patch
=====================================
@@ -0,0 +1,29 @@
+Description: Also support pybuild directory for doc build.
+Author: Bas Couwenberg <sebastic at debian.org>
+Forwarded: https://github.com/osmcode/pyosmium/pull/207
+
+--- a/doc/conf.py
++++ b/doc/conf.py
+@@ -28,11 +28,17 @@ if not os.path.exists(build_dir):
+     build_dir = "../build/lib.%s-%s" % (sysconfig.get_platform(),
+                                         sys.implementation.cache_tag)
+     if not os.path.exists(build_dir):
+-        print("""
+-            Compiled version of pyosmium not found, please build pyosmium for Python {}.{}
+-            before building the documentation.
+-            """.format(*sys.version_info))
+-        raise RuntimeError("Cannot find pyosmium")
++        # pybuild
++        build_dir = "../.pybuild/cpython3_%s.%s_pyosmium/build" % (
++            sys.version_info[0], sys.version_info[1]
++        )
++
++        if not os.path.exists(build_dir):
++            print("""
++                Compiled version of pyosmium not found, please build pyosmium for Python {}.{}
++                before building the documentation.
++                """.format(*sys.version_info))
++            raise RuntimeError("Cannot find pyosmium")
+ 
+ # insert after the current directory
+ sys.path.insert(0, os.path.normpath(os.path.join(os.path.abspath('.'), build_dir)))


=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+pybuild.patch


=====================================
debian/rules
=====================================
@@ -28,8 +28,8 @@ override_dh_clean:
 override_dh_auto_build-indep:
 	dh_auto_build --indep
 
-	(cd doc && PYTHONPATH=$(CURDIR)/.pybuild/cpython3_`py3versions -vd`_pyosmium/build make html)
-	(cd doc && PYTHONPATH=$(CURDIR)/.pybuild/cpython3_`py3versions -vd`_pyosmium/build make man)
+	(cd doc && make html)
+	(cd doc && make man)
 
 override_dh_auto_install:
 	PYBUILD_INSTALL_ARGS="--install-scripts=/usr/lib/{package}" dh_auto_install


=====================================
doc/conf.py
=====================================
@@ -20,24 +20,25 @@ import os
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
-build_dir = "../build/lib.%s-%d.%d" % (
-                    sysconfig.get_platform(),
-                    sys.version_info[0], sys.version_info[1])
+# old style distutils libraries
+build_dir = "../build/lib.%s-%d.%d" % (sysconfig.get_platform(),
+                                       sys.version_info[0], sys.version_info[1])
+if not os.path.exists(build_dir):
+    # new style distutils libraries
+    build_dir = "../build/lib.%s-%s" % (sysconfig.get_platform(),
+                                        sys.implementation.cache_tag)
+    if not os.path.exists(build_dir):
+        print("""
+            Compiled version of pyosmium not found, please build pyosmium for Python {}.{}
+            before building the documentation.
+            """.format(*sys.version_info))
+        raise RuntimeError("Cannot find pyosmium")
 
 # insert after the current directory
 sys.path.insert(0, os.path.normpath(os.path.join(os.path.abspath('.'), build_dir)))
 sys.path.insert(0, os.path.normpath(os.path.join(os.path.abspath('.'), '../tools')))
 
-try:
-    from osmium.version import pyosmium_major, pyosmium_release
-except ImportError:
-    print("""
-        Compiled version of pyosmium not found, please build pyosmium
-        for Python %d.%d.
-        Expected build directory: %s """
-        % (sys.version_info[0], sys.version_info[1], build_dir))
-    raise
+from osmium.version import pyosmium_major, pyosmium_release
 
 # -- General configuration ------------------------------------------------
 


=====================================
lib/simple_writer.cc
=====================================
@@ -36,6 +36,10 @@ public:
 
     void add_node(py::object o)
     {
+        if (!buffer) {
+            throw std::runtime_error{"Writer already closed."};
+        }
+
         if (py::isinstance<osmium::Node>(o)) {
             buffer.add_item(o.cast<osmium::Node &>());
         } else {
@@ -57,6 +61,10 @@ public:
 
     void add_way(py::object o)
     {
+        if (!buffer) {
+            throw std::runtime_error{"Writer already closed."};
+        }
+
         if (py::isinstance<osmium::Way>(o)) {
             buffer.add_item(o.cast<osmium::Way &>());
         } else {
@@ -76,6 +84,10 @@ public:
 
     void add_relation(py::object o)
     {
+        if (!buffer) {
+            throw std::runtime_error{"Writer already closed."};
+        }
+
         if (py::isinstance<osmium::Relation>(o)) {
             buffer.add_item(o.cast<osmium::Relation &>());
         } else {


=====================================
setup.py
=====================================
@@ -131,8 +131,8 @@ class CMakeBuild(build_ext):
 
 versions = get_versions()
 
-if sys.version_info < (3,5):
-    raise RuntimeError("Python 3.5 or larger required.")
+if sys.version_info < (3,6):
+    raise RuntimeError("Python 3.6 or larger required.")
 
 with open('README.rst', 'r') as descfile:
     long_description = descfile.read()
@@ -155,7 +155,6 @@ setup(
         "Development Status :: 4 - Beta",
         "Intended Audience :: Developers",
         "License :: OSI Approved :: BSD License",
-        "Programming Language :: Python :: 3.5",
         "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
@@ -167,7 +166,7 @@ setup(
     ext_modules=[CMakeExtension('cmake_example')],
     packages = ['osmium', 'osmium/osm', 'osmium/replication'],
     package_dir = {'' : 'src'},
-    python_requires = ">=3.5",
+    python_requires = ">=3.6",
     install_requires = ['requests'],
     cmdclass=dict(build_ext=CMakeBuild, sdist=Pyosmium_sdist),
     zip_safe=False,


=====================================
src/osmium/version.py
=====================================
@@ -3,13 +3,13 @@ Version information.
 """
 
 # the major version
-pyosmium_major = '3.3'
+pyosmium_major = '3.4'
 # current release (Pip version)
-pyosmium_release = '3.3.0'
+pyosmium_release = '3.4.0'
 
 # libosmium version shipped with the Pip release
 libosmium_version = '2.18.0'
 # protozero version shipped with the Pip release
 protozero_version = '1.7.1'
 # pybind11 version shipped with the Pip release
-pybind11_version = '2.9.1'
+pybind11_version = '2.10.0'


=====================================
test/conftest.py
=====================================
@@ -11,12 +11,16 @@ import uuid
 from textwrap import dedent
 
 SRC_DIR = (Path(__file__) / '..' / '..').resolve()
+
 BUILD_DIR = "build/lib.{}-{}.{}".format(sysconfig.get_platform(),
                                         sys.version_info[0], sys.version_info[1])
+if not (SRC_DIR / BUILD_DIR).exists():
+    BUILD_DIR = "build/lib.{}-{}".format(sysconfig.get_platform(),
+                                            sys.implementation.cache_tag)
 
-# always test against the source
-sys.path.insert(0, str(SRC_DIR))
-sys.path.insert(0, str(SRC_DIR / BUILD_DIR))
+if (SRC_DIR / BUILD_DIR).exists():
+    sys.path.insert(0, str(SRC_DIR))
+    sys.path.insert(0, str(SRC_DIR / BUILD_DIR))
 
 import pytest
 


=====================================
test/test_writer.py
=====================================
@@ -214,3 +214,35 @@ def test_set_custom_header(tmp_path):
         assert h.box().top_right == o.osm.Location(10, 45)
     finally:
         rd.close()
+
+
+def test_add_node_after_close(tmp_path, simple_handler):
+    node_opl = "n235 v1 dV c0 t i0 u Telephant=yes x98.7 y-3.45"
+
+    filename = tmp_path / (str(uuid.uuid4()) + '.opl')
+    writer = o.SimpleWriter(str(filename), 1024*1024)
+    writer.close()
+
+    with pytest.raises(RuntimeError, match='closed'):
+        simple_handler(node_opl, node=lambda o: writer.add_node(o))
+
+
+def test_add_way_after_close(tmp_path, simple_handler):
+    node_opl = "w1 Nn1"
+
+    filename = tmp_path / (str(uuid.uuid4()) + '.opl')
+    writer = o.SimpleWriter(str(filename), 1024*1024)
+    writer.close()
+
+    with pytest.raises(RuntimeError, match='closed'):
+        simple_handler(node_opl, way=lambda o: writer.add_way(o))
+
+def test_add_relation_after_close(tmp_path, simple_handler):
+    node_opl = "r54 Mn1@,w3 at foo"
+
+    filename = tmp_path / (str(uuid.uuid4()) + '.opl')
+    writer = o.SimpleWriter(str(filename), 1024*1024)
+    writer.close()
+
+    with pytest.raises(RuntimeError, match='closed'):
+        simple_handler(node_opl, relation=lambda o: writer.add_relation(o))



View it on GitLab: https://salsa.debian.org/debian-gis-team/pyosmium/-/compare/18f54591c497c6161231ce27050c9baf5b9afa92...dc8b6ecf0fadbb67e20263724acdd1b84f7817d5

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyosmium/-/compare/18f54591c497c6161231ce27050c9baf5b9afa92...dc8b6ecf0fadbb67e20263724acdd1b84f7817d5
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/20220728/434d634c/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list