From 125693a8e11d689be3a19ca9c9e29033c531b50d Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 3 Mar 2024 19:33:10 +0100 Subject: [PATCH 1/5] move apply functionality from BaseHandler to SimpleHandler The only other child class WriteHandler uses a different implementation for apply, so the generic variant is pointless. --- lib/base_handler.h | 80 ----------------------------------------- lib/simple_handler.h | 86 +++++++++++++++++++++++++++++++++++++++++--- lib/write_handler.cc | 3 -- 3 files changed, 82 insertions(+), 87 deletions(-) diff --git a/lib/base_handler.h b/lib/base_handler.h index f06424c9..db393e28 100644 --- a/lib/base_handler.h +++ b/lib/base_handler.h @@ -8,32 +8,12 @@ #ifndef PYOSMIUM_BASE_HANDLER_HPP #define PYOSMIUM_BASE_HANDLER_HPP -#include -#include #include -#include -#include class BaseHandler : public osmium::handler::Handler { - using IndexType = - osmium::index::map::Map; - using IndexFactory = - osmium::index::MapFactory; - using MpManager = - osmium::area::MultipolygonManager; - - -protected: - enum pre_handler { - no_handler, - location_handler, - area_handler - }; - public: virtual ~BaseHandler() = default; - virtual osmium::osm_entity_bits::type enabled_callbacks() = 0; // work around pybind's bad copy policy // (see https://github.com/pybind/pybind11/issues/1241) @@ -50,66 +30,6 @@ class BaseHandler : public osmium::handler::Handler virtual void changeset(const osmium::Changeset*) {} virtual void area(const osmium::Area*) {} - -private: - void apply_with_location(osmium::io::Reader &r, const std::string &idx) - { - const auto &map_factory = IndexFactory::instance(); - auto index = map_factory.create_map(idx); - osmium::handler::NodeLocationsForWays location_handler(*index); - location_handler.ignore_errors(); - - osmium::apply(r, location_handler, *this); - } - - void apply_with_area(osmium::io::Reader &r, MpManager &mp_manager, - const std::string &idx) - { - const auto &map_factory = IndexFactory::instance(); - auto index = map_factory.create_map(idx); - osmium::handler::NodeLocationsForWays location_handler(*index); - location_handler.ignore_errors(); - - osmium::apply(r, location_handler, *this, - mp_manager.handler([this](const osmium::memory::Buffer &ab) - { osmium::apply(ab, *this); })); - } - -protected: - void apply(const osmium::io::File &file, osmium::osm_entity_bits::type types, - pre_handler pre = no_handler, - const std::string &idx = "flex_mem") - { - switch (pre) { - case no_handler: - { - osmium::io::Reader reader(file, types); - osmium::apply(reader, *this); - reader.close(); - break; - } - case location_handler: - { - osmium::io::Reader reader(file, types); - apply_with_location(reader, idx); - reader.close(); - break; - } - case area_handler: - { - osmium::area::Assembler::config_type assembler_config; - MpManager mp_manager{assembler_config}; - - osmium::relations::read_relations(file, mp_manager); - - osmium::io::Reader reader2(file); - apply_with_area(reader2, mp_manager, idx); - reader2.close(); - break; - } - } - } - }; #endif // PYOSMIUM_BASE_HANDLER_HPP diff --git a/lib/simple_handler.h b/lib/simple_handler.h index dfb2fe59..ad85328f 100644 --- a/lib/simple_handler.h +++ b/lib/simple_handler.h @@ -13,14 +13,36 @@ #include #include #include +#include +#include +#include +#include + #include "base_handler.h" #include "osm_base_objects.h" class SimpleHandler: public BaseHandler { + using IndexType = + osmium::index::map::Map; + using IndexFactory = + osmium::index::MapFactory; + using MpManager = + osmium::area::MultipolygonManager; + + +protected: + enum pre_handler { + no_handler, + location_handler, + area_handler + }; + + public: virtual ~SimpleHandler() = default; + virtual osmium::osm_entity_bits::type enabled_callbacks() = 0; void apply_file(pybind11::object filename, bool locations = false, const std::string &idx = "flex_mem") @@ -49,16 +71,14 @@ class SimpleHandler: public BaseHandler void apply_object(osmium::io::File file, bool locations, const std::string &idx) { osmium::osm_entity_bits::type entities = osmium::osm_entity_bits::nothing; - BaseHandler::pre_handler handler = locations? - BaseHandler::location_handler - :BaseHandler::no_handler; + pre_handler handler = locations? location_handler : no_handler; auto callbacks = enabled_callbacks(); if (callbacks & osmium::osm_entity_bits::area) { entities = osmium::osm_entity_bits::object; - handler = BaseHandler::area_handler; + handler = area_handler; } else { if (locations || callbacks & osmium::osm_entity_bits::node) entities |= osmium::osm_entity_bits::node; @@ -74,6 +94,64 @@ class SimpleHandler: public BaseHandler pybind11::gil_scoped_release release; apply(file, entities, handler, idx); } + + + void apply_with_location(osmium::io::Reader &r, const std::string &idx) + { + const auto &map_factory = IndexFactory::instance(); + auto index = map_factory.create_map(idx); + osmium::handler::NodeLocationsForWays location_handler(*index); + location_handler.ignore_errors(); + + osmium::apply(r, location_handler, *this); + } + + void apply_with_area(osmium::io::Reader &r, MpManager &mp_manager, + const std::string &idx) + { + const auto &map_factory = IndexFactory::instance(); + auto index = map_factory.create_map(idx); + osmium::handler::NodeLocationsForWays location_handler(*index); + location_handler.ignore_errors(); + + osmium::apply(r, location_handler, *this, + mp_manager.handler([this](const osmium::memory::Buffer &ab) + { osmium::apply(ab, *this); })); + } + + void apply(const osmium::io::File &file, osmium::osm_entity_bits::type types, + pre_handler pre = no_handler, + const std::string &idx = "flex_mem") + { + switch (pre) { + case no_handler: + { + osmium::io::Reader reader(file, types); + osmium::apply(reader, *this); + reader.close(); + break; + } + case location_handler: + { + osmium::io::Reader reader(file, types); + apply_with_location(reader, idx); + reader.close(); + break; + } + case area_handler: + { + osmium::area::Assembler::config_type assembler_config; + MpManager mp_manager{assembler_config}; + + osmium::relations::read_relations(file, mp_manager); + + osmium::io::Reader reader2(file); + apply_with_area(reader2, mp_manager, idx); + reader2.close(); + break; + } + } + } }; template diff --git a/lib/write_handler.cc b/lib/write_handler.cc index 1a3135a9..eabd8d20 100644 --- a/lib/write_handler.cc +++ b/lib/write_handler.cc @@ -36,9 +36,6 @@ class WriteHandler : public BaseHandler virtual ~WriteHandler() { close(); } - osmium::osm_entity_bits::type enabled_callbacks() override - { return osmium::osm_entity_bits::all; } - void node(const osmium::Node* o) override { buffer.add_item(*o); From 88c37f859f96f44b5b26fba4637309fa0b841607 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 3 Mar 2024 20:52:10 +0100 Subject: [PATCH 2/5] make NodeLocationForWays a generic BaseHandler That way, it can be used with generic apply functions. --- CMakeLists.txt | 1 + lib/base_handler.h | 6 ++-- lib/merge_input_reader.cc | 6 ++-- lib/node_location_handler.cc | 65 ++++++++++++++++++++++++++++++++++++ lib/osmium.cc | 28 +++------------- lib/osmium_module.h | 3 +- lib/simple_handler.h | 6 ++-- lib/write_handler.cc | 4 +-- 8 files changed, 84 insertions(+), 35 deletions(-) create mode 100644 lib/node_location_handler.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a2b6a41..99efa604 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,7 @@ set_module_output(_osm osmium/osm) pybind11_add_module(_osmium lib/osmium.cc lib/merge_input_reader.cc + lib/node_location_handler.cc lib/simple_writer.cc lib/write_handler.cc) set_module_output(_osmium osmium) diff --git a/lib/base_handler.h b/lib/base_handler.h index db393e28..06e92e99 100644 --- a/lib/base_handler.h +++ b/lib/base_handler.h @@ -2,7 +2,7 @@ * * This file is part of pyosmium. (https://osmcode.org/pyosmium/) * - * Copyright (C) 2023 Sarah Hoffmann and others. + * Copyright (C) 2024 Sarah Hoffmann and others. * For a full list of authors see the git log. */ #ifndef PYOSMIUM_BASE_HANDLER_HPP @@ -18,14 +18,14 @@ class BaseHandler : public osmium::handler::Handler // work around pybind's bad copy policy // (see https://github.com/pybind/pybind11/issues/1241) void node(const osmium::Node &o) { node(&o); } - void way(const osmium::Way &o) { way(&o); } + void way(osmium::Way &o) { way(&o); } void relation(const osmium::Relation &o) { relation(&o); } void changeset(const osmium::Changeset &o) { changeset(&o); } void area(const osmium::Area &o) { area(&o); } // actual handler functions virtual void node(const osmium::Node*) {} - virtual void way(const osmium::Way*) {} + virtual void way(osmium::Way *) {} virtual void relation(const osmium::Relation*) {} virtual void changeset(const osmium::Changeset*) {} virtual void area(const osmium::Area*) {} diff --git a/lib/merge_input_reader.cc b/lib/merge_input_reader.cc index 5aca5c60..0c6ba1ac 100644 --- a/lib/merge_input_reader.cc +++ b/lib/merge_input_reader.cc @@ -2,7 +2,7 @@ * * This file is part of pyosmium. (https://osmcode.org/pyosmium/) * - * Copyright (C) 2023 Sarah Hoffmann and others. + * Copyright (C) 2024 Sarah Hoffmann and others. * For a full list of authors see the git log. */ #include @@ -133,7 +133,7 @@ class MergeInputReader objects.sort(osmium::object_order_type_id_reverse_version()); osmium::item_type prev_type = osmium::item_type::undefined; osmium::object_id_type prev_id = 0; - for (const auto &item: objects) { + for (auto &item: objects) { if (item.type() != prev_type || item.id() != prev_id) { prev_type = item.type(); prev_id = item.id(); @@ -142,7 +142,7 @@ class MergeInputReader } } else { objects.sort(osmium::object_order_type_id_version()); - osmium::apply(objects.cbegin(), objects.cend(), handler); + osmium::apply(objects.begin(), objects.end(), handler); } objects = osmium::ObjectPointerCollection(); diff --git a/lib/node_location_handler.cc b/lib/node_location_handler.cc new file mode 100644 index 00000000..98a3bbc5 --- /dev/null +++ b/lib/node_location_handler.cc @@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: BSD-2-Clause + * + * This file is part of pyosmium. (https://osmcode.org/pyosmium/) + * + * Copyright (C) 2024 Sarah Hoffmann and others. + * For a full list of authors see the git log. + */ +#include + +#include +#include + +#include "base_handler.h" + +using LocationTable = + osmium::index::map::Map; +using NodeLocationHandler = + osmium::handler::NodeLocationsForWays; + + +class NodeLocationsForWays : public BaseHandler +{ +public: + NodeLocationsForWays(LocationTable &idx) + : handler(idx) + {} + + void node(const osmium::Node *o) override + { + handler.node(*o); + } + + void way(osmium::Way *o) override + { + if (apply_nodes_to_ways) { + handler.way(*o); + } + } + + bool get_apply_nodes_to_ways() const { return apply_nodes_to_ways; } + + void set_apply_nodes_to_ways(bool val) { apply_nodes_to_ways = val; } + + void ignore_errors() { handler.ignore_errors(); } + +private: + NodeLocationHandler handler; + bool apply_nodes_to_ways = true; +}; + +namespace py = pybind11; + +void init_node_location_handler(py::module &m) +{ + py::class_(m, "NodeLocationsForWays") + .def(py::init(), py::keep_alive<1, 2>()) + .def("ignore_errors", &NodeLocationsForWays::ignore_errors) + .def_property("apply_nodes_to_ways", + &NodeLocationsForWays::get_apply_nodes_to_ways, + &NodeLocationsForWays::set_apply_nodes_to_ways, + "When set to false, locations are only collected " + "and not automatically applied to way nodes.") + ; + +} diff --git a/lib/osmium.cc b/lib/osmium.cc index 56693460..d8f46534 100644 --- a/lib/osmium.cc +++ b/lib/osmium.cc @@ -2,15 +2,12 @@ * * This file is part of pyosmium. (https://osmcode.org/pyosmium/) * - * Copyright (C) 2023 Sarah Hoffmann and others. + * Copyright (C) 2024 Sarah Hoffmann and others. * For a full list of authors see the git log. */ #include #include -#include -#include -#include #include "simple_handler.h" #include "osmium_module.h" @@ -18,11 +15,6 @@ namespace py = pybind11; PYBIND11_MODULE(_osmium, m) { - using LocationTable = - osmium::index::map::Map; - using NodeLocationHandler = - osmium::handler::NodeLocationsForWays; - py::register_exception(m, "InvalidLocationError"); py::register_exception_translator([](std::exception_ptr p) { try { @@ -32,24 +24,13 @@ PYBIND11_MODULE(_osmium, m) { } }); - py::class_>( - m, "NodeLocationsForWays") - .def(py::init()) - .def("ignore_errors", &osmium::handler::NodeLocationsForWays::ignore_errors) - ; - m.def("apply", [](osmium::io::Reader &rd, BaseHandler &h) { py::gil_scoped_release release; osmium::apply(rd, h); }, py::arg("reader"), py::arg("handler"), "Apply a chain of handlers."); - m.def("apply", [](osmium::io::Reader &rd, NodeLocationHandler &h) - { py::gil_scoped_release release; osmium::apply(rd, h); }, - py::arg("reader"), py::arg("node_handler"), - "Apply a chain of handlers."); - m.def("apply", [](osmium::io::Reader &rd, NodeLocationHandler &l, - BaseHandler &h) - { py::gil_scoped_release release; osmium::apply(rd, l, h); }, - py::arg("reader"), py::arg("node_handler"), py::arg("handler"), + m.def("apply", [](osmium::io::Reader &rd, BaseHandler &b1, BaseHandler &b2) + { py::gil_scoped_release release; osmium::apply(rd, b1, b2); }, + py::arg("reader"), py::arg("handler1"), py::arg("handler2"), "Apply a chain of handlers."); py::class_(m, "BaseHandler"); @@ -84,4 +65,5 @@ PYBIND11_MODULE(_osmium, m) { init_merge_input_reader(m); init_write_handler(m); init_simple_writer(m); + init_node_location_handler(m); }; diff --git a/lib/osmium_module.h b/lib/osmium_module.h index af392cc7..04b01397 100644 --- a/lib/osmium_module.h +++ b/lib/osmium_module.h @@ -2,7 +2,7 @@ * * This file is part of pyosmium. (https://osmcode.org/pyosmium/) * - * Copyright (C) 2023 Sarah Hoffmann and others. + * Copyright (C) 2024 Sarah Hoffmann and others. * For a full list of authors see the git log. */ #ifndef PYOSMIUM_OSMIUM_MODULE_H @@ -13,5 +13,6 @@ void init_merge_input_reader(pybind11::module &m); void init_write_handler(pybind11::module &m); void init_simple_writer(pybind11::module &m); +void init_node_location_handler(pybind11::module &m); #endif // PYOSMIUM_OSMIUM_MODULE_H diff --git a/lib/simple_handler.h b/lib/simple_handler.h index ad85328f..5e959638 100644 --- a/lib/simple_handler.h +++ b/lib/simple_handler.h @@ -2,7 +2,7 @@ * * This file is part of pyosmium. (https://osmcode.org/pyosmium/) * - * Copyright (C) 2023 Sarah Hoffmann and others. + * Copyright (C) 2024 Sarah Hoffmann and others. * For a full list of authors see the git log. */ #ifndef PYOSMIUM_SIMPLE_HANDLER_HPP @@ -115,7 +115,7 @@ class SimpleHandler: public BaseHandler location_handler.ignore_errors(); osmium::apply(r, location_handler, *this, - mp_manager.handler([this](const osmium::memory::Buffer &ab) + mp_manager.handler([this](osmium::memory::Buffer &&ab) { osmium::apply(ab, *this); })); } @@ -203,7 +203,7 @@ class PySimpleHandler : public SimpleHandler } } - void way(osmium::Way const *w) override + void way(osmium::Way *w) override { pybind11::gil_scoped_acquire acquire; auto func = callback("way"); diff --git a/lib/write_handler.cc b/lib/write_handler.cc index eabd8d20..e6bea85e 100644 --- a/lib/write_handler.cc +++ b/lib/write_handler.cc @@ -2,7 +2,7 @@ * * This file is part of pyosmium. (https://osmcode.org/pyosmium/) * - * Copyright (C) 2023 Sarah Hoffmann and others. + * Copyright (C) 2024 Sarah Hoffmann and others. * For a full list of authors see the git log. */ #include @@ -42,7 +42,7 @@ class WriteHandler : public BaseHandler flush_buffer(); } - void way(const osmium::Way* o) override + void way(osmium::Way* o) override { buffer.add_item(*o); flush_buffer(); From ec01ea2d71adb852e3aa96a0dae07b6d1e2d7f0c Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 3 Mar 2024 17:35:33 +0100 Subject: [PATCH 3/5] add test for NodeLocationHandler --- test/conftest.py | 8 ++++++ test/test_osmium.py | 69 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 test/test_osmium.py diff --git a/test/conftest.py b/test/conftest.py index a8777ac8..05b40930 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -52,6 +52,14 @@ def _mkfile(data): return _mkfile +@pytest.fixture +def opl_reader(test_data): + + def _mkbuffer(data): + return o.io.Reader(test_data(data)) + + return _mkbuffer + @pytest.fixture def simple_handler(to_opl): diff --git a/test/test_osmium.py b/test/test_osmium.py new file mode 100644 index 00000000..c9c0c333 --- /dev/null +++ b/test/test_osmium.py @@ -0,0 +1,69 @@ +# SPDX-License-Identifier: BSD +# +# This file is part of Pyosmium. +# +# Copyright (C) 2024 Sarah Hoffmann. +import pytest +import osmium as o + + +def test_read_node_location_with_handler(opl_reader): + idx = o.index.create_map("flex_mem") + hdlr = o.NodeLocationsForWays(idx) + + data = """\ + n1 x6 y7 + n45 x-3 y0 + """ + + o.apply(opl_reader(data), hdlr) + + assert idx.get(1).lon == pytest.approx(6) + assert idx.get(1).lat == pytest.approx(7) + assert idx.get(45).lon == pytest.approx(-3) + assert idx.get(45).lat == 0.0 + + with pytest.raises(KeyError): + idx.get(2) + + +@pytest.mark.parametrize('ignore_error', [(True, False)]) +def test_apply_node_location_handler(opl_reader, ignore_error): + + hdlr = o.NodeLocationsForWays(o.index.create_map("flex_mem")) + if ignore_error: + hdlr.ignore_errors() + + class WayNodeHandler(o.SimpleHandler): + def __init__(self): + super().__init__() + self.collect = [] + self.with_error = [] + + def way(self, w): + try: + self.collect.append((w.id, [(n.lon, n.lat) for n in w.nodes])) + except o.InvalidLocationError: + self.with_error.append(w.id) + + + data = """\ + n1 x6 y7 + n2 x6 y7.1 + n45 x-3 y0 + n55 x-2.9 y0 + w3 Nn1,n2 + w4 Nn45,n55,n56 + """ + + tester = WayNodeHandler() + + if ignore_error: + o.apply(opl_reader(data), hdlr, tester) + + assert tester.collect == [(3, [(pytest.approx(6), pytest.approx(7)), + (pytest.approx(6), pytest.approx(7.1))])] + assert tester.with_error == [4] + else: + with pytest.raises(osmium.InvalidLocationError): + o.apply(opl.reader(data), hdlr, tester) From df82c95f9008c978b5c73d86dfc662e3b47b4cfd Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 3 Mar 2024 21:38:18 +0100 Subject: [PATCH 4/5] allow arbitrary number of handlers in apply --- lib/osmium.cc | 73 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 69 insertions(+), 4 deletions(-) diff --git a/lib/osmium.cc b/lib/osmium.cc index d8f46534..30e70cd4 100644 --- a/lib/osmium.cc +++ b/lib/osmium.cc @@ -5,15 +5,74 @@ * Copyright (C) 2024 Sarah Hoffmann and others. * For a full list of authors see the git log. */ +#include + #include #include +#include #include "simple_handler.h" #include "osmium_module.h" namespace py = pybind11; +class HandlerChain : public osmium::handler::Handler +{ +public: + HandlerChain(std::vector &&handlers) + : m_handlers(handlers) + {} + + void node(osmium::Node const &o) { + for (auto const &handler : m_handlers) { + handler->node(&o); + } + } + + void way(osmium::Way &w) { + for (auto const &handler : m_handlers) { + handler->way(&w); + } + } + + void relation(osmium::Relation const &o) { + for (auto const &handler : m_handlers) { + handler->relation(&o); + } + } + + void changeset(osmium::Changeset const &o) { + for (auto const &handler : m_handlers) { + handler->changeset(&o); + } + } + + void area(osmium::Area const &o) { + for (auto const &handler : m_handlers) { + handler->area(&o); + } + } + +private: + std::vector m_handlers; +}; + + +static HandlerChain make_handler_chain(py::args args) +{ + std::vector handlers; + for (auto const &arg: args) { + if (py::isinstance(arg)) { + handlers.push_back(arg.cast()); + } else { + throw py::type_error{"Argument must be a handler-like object."}; + } + } + + return HandlerChain(std::move(handlers)); +} + PYBIND11_MODULE(_osmium, m) { py::register_exception(m, "InvalidLocationError"); py::register_exception_translator([](std::exception_ptr p) { @@ -27,10 +86,16 @@ PYBIND11_MODULE(_osmium, m) { m.def("apply", [](osmium::io::Reader &rd, BaseHandler &h) { py::gil_scoped_release release; osmium::apply(rd, h); }, py::arg("reader"), py::arg("handler"), - "Apply a chain of handlers."); - m.def("apply", [](osmium::io::Reader &rd, BaseHandler &b1, BaseHandler &b2) - { py::gil_scoped_release release; osmium::apply(rd, b1, b2); }, - py::arg("reader"), py::arg("handler1"), py::arg("handler2"), + "Apply a single handler."); + m.def("apply", [](osmium::io::Reader &rd, py::args args) + { + auto handler = make_handler_chain(args); + { + py::gil_scoped_release release; + osmium::apply(rd, handler); + } + }, + py::arg("reader"), "Apply a chain of handlers."); py::class_(m, "BaseHandler"); From 7fb887d95af521a67eeb39d60e95bd40bfd42aff Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 3 Mar 2024 21:53:57 +0100 Subject: [PATCH 5/5] actions: update script versions --- .github/workflows/ci.yml | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1dfd59e2..b40bed37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,13 +7,13 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - 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.6 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.6 @@ -24,7 +24,7 @@ jobs: shell: bash - name: Set up Python 3.7 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.7 @@ -35,7 +35,7 @@ jobs: shell: bash - name: Set up Python 3.8 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 @@ -46,7 +46,7 @@ jobs: shell: bash - name: Set up Python 3.9 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.9 @@ -57,7 +57,7 @@ jobs: shell: bash - name: Set up Python 3.10 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.10" @@ -68,7 +68,7 @@ jobs: shell: bash - name: Set up Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" @@ -79,7 +79,7 @@ jobs: shell: bash - name: Set up Python 3.12 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.12" @@ -105,10 +105,10 @@ jobs: python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -167,13 +167,13 @@ jobs: CXX: ${{ matrix.cxx }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/actions/install-dependencies with: version: ${{ matrix.deps }} - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "${{ matrix.python }}" @@ -212,7 +212,7 @@ jobs: VCPKG_DEFAULT_BINARY_CACHE: C:/vcpkg_binary_cache steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/cache@v3 with: @@ -229,7 +229,7 @@ jobs: shell: bash - name: Set up Python 3.6 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.6 @@ -242,7 +242,7 @@ jobs: CMAKE_TOOLCHAIN_FILE: C:/vcpkg/scripts/buildsystems/vcpkg.cmake - name: Set up Python 3.7 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.7 @@ -255,7 +255,7 @@ jobs: CMAKE_TOOLCHAIN_FILE: C:/vcpkg/scripts/buildsystems/vcpkg.cmake - name: Set up Python 3.8 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 @@ -268,7 +268,7 @@ jobs: CMAKE_TOOLCHAIN_FILE: C:/vcpkg/scripts/buildsystems/vcpkg.cmake - name: Set up Python 3.9 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.9 @@ -281,7 +281,7 @@ jobs: CMAKE_TOOLCHAIN_FILE: C:/vcpkg/scripts/buildsystems/vcpkg.cmake - name: Set up Python 3.10 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.10" @@ -294,7 +294,7 @@ jobs: CMAKE_TOOLCHAIN_FILE: C:/vcpkg/scripts/buildsystems/vcpkg.cmake - name: Set up Python 3.11 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" @@ -325,10 +325,10 @@ jobs: PYTEST_ADDOPTS: ${{ matrix.test-args }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }}