diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml index 41ee6ee..78bba75 100644 --- a/.github/workflows/pip.yml +++ b/.github/workflows/pip.yml @@ -30,7 +30,7 @@ jobs: echo "MACOS_DEPLOYMENT_TARGET=10.14" >> $GITHUB_ENV - name: Build and install - run: pip install --verbose .[test] + run: pip install --verbose .[test] && make data_pull - name: Test run: python -m pytest diff --git a/src/bindings/pybind11_network.cpp b/src/bindings/pybind11_network.cpp index c767dd8..c2e1922 100644 --- a/src/bindings/pybind11_network.cpp +++ b/src/bindings/pybind11_network.cpp @@ -6,7 +6,13 @@ #include "nano_fmm/network.hpp" #include "nano_fmm/indexer.hpp" + #include "spdlog/spdlog.h" +// fix exposed macro 'GetObject' from wingdi.h (included by spdlog.h) under +// windows, see https://github.com/Tencent/rapidjson/issues/1448 +#ifdef GetObject +#undef GetObject +#endif namespace nano_fmm { diff --git a/tests/test_basic.py b/tests/test_basic.py index 498fa99..5c3d97e 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -673,7 +673,21 @@ def test_network_query_enu(): hits = network.query([5, 0, 0], radius=5) hits = [h.to_rapidjson()() for h in hits] - assert hits == [ + hit1 = { + "position": [5.0, 5.0, 0.0], + "direction": [1.0, 0.0, 0.0], + "distance": 5.0, + "road_id": 0, + "offset": 5.0, + } + hit2 = { + "position": [10.0, 0.0, 0.0], + "direction": [0.0, 1.0, 0.0], + "distance": 5.0, + "road_id": 2, + "offset": 5.0, + } + assert hits[0] == [ { "position": [5.0, 0.0, 0.0], "direction": [1.0, 0.0, 0.0], @@ -681,21 +695,8 @@ def test_network_query_enu(): "road_id": 1, "offset": 5.0, }, - { - "position": [5.0, 5.0, 0.0], - "direction": [1.0, 0.0, 0.0], - "distance": 5.0, - "road_id": 0, - "offset": 5.0, - }, - { - "position": [10.0, 0.0, 0.0], - "direction": [0.0, 1.0, 0.0], - "distance": 5.0, - "road_id": 2, - "offset": 5.0, - }, ] + assert hits[1:] == [hit1, hit2] or hits[1:] == [hit2, hit1] def pytest_main(dir: str, *, test_file: str):