pyvalhalla-git 3.5.1.post187__cp39-cp39-win_amd64.whl → 3.6.0__cp39-cp39-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. _valhalla.cp39-win_amd64.pyd +0 -0
  2. pyvalhalla_git-3.6.0.data/platlib/.load-order-pyvalhalla_git-3.6.0 +20 -0
  3. pyvalhalla_git-3.5.1.post187.data/platlib/Lerc-5492e53a634552d158814335bfd5508b.dll → pyvalhalla_git-3.6.0.data/platlib/Lerc-d4ff05a506ddcfc551c350aa718ab4da.dll +0 -0
  4. pyvalhalla_git-3.5.1.post187.data/platlib/abseil_dll-1fc67c8668f83d1a5bea7b37c99ca6c3.dll → pyvalhalla_git-3.6.0.data/platlib/abseil_dll-bdd8a5a1f5a4da3f67279509940f7994.dll +0 -0
  5. pyvalhalla_git-3.5.1.post187.data/platlib/gdal-ef87f613f24439573ac93245419c57fb.dll → pyvalhalla_git-3.6.0.data/platlib/gdal-e68c9d36ee94002182307d221cc91ce3.dll +0 -0
  6. pyvalhalla_git-3.5.1.post187.data/platlib/geos-6c521f6a54fa614211eebaea0a890f5e.dll → pyvalhalla_git-3.6.0.data/platlib/geos-b8640de6faf146d9855a807e72427e47.dll +0 -0
  7. pyvalhalla_git-3.5.1.post187.data/platlib/geos_c-98a48e4eb33f944d74a394141acb7eaf.dll → pyvalhalla_git-3.6.0.data/platlib/geos_c-7d79920a3a18ad2c1ff594fcef060f0a.dll +0 -0
  8. pyvalhalla_git-3.5.1.post187.data/platlib/geotiff-e36440f3fa837002abf4656c8a82bee1.dll → pyvalhalla_git-3.6.0.data/platlib/geotiff-020296779aedd28fd03f34200e6e3c61.dll +0 -0
  9. pyvalhalla_git-3.5.1.post187.data/platlib/jpeg62-cdecd204dfd888a80dba8d7e15cb5b60.dll → pyvalhalla_git-3.6.0.data/platlib/jpeg62-52d863f4f0f8139faf1608976c1d91f6.dll +0 -0
  10. pyvalhalla_git-3.5.1.post187.data/platlib/json-c-520fb69b2bfce9e17f4c6595040d996f.dll → pyvalhalla_git-3.6.0.data/platlib/json-c-0d6db73c6075abe84a7bdd2a2d393471.dll +0 -0
  11. pyvalhalla_git-3.5.1.post187.data/platlib/libcurl-39889826283c088f2b3897191ab7d21d.dll → pyvalhalla_git-3.6.0.data/platlib/libcurl-bfd466d47923540033e77b192031a728.dll +0 -0
  12. pyvalhalla_git-3.5.1.post187.data/platlib/libexpat-0a3bbd6de9307d0020c69673bdb3d5f1.dll → pyvalhalla_git-3.6.0.data/platlib/libexpat-6da76b3644b9424613b6d75323fcdc82.dll +0 -0
  13. pyvalhalla_git-3.5.1.post187.data/platlib/liblzma-953b7b97af894314faccc0606d85cede.dll → pyvalhalla_git-3.6.0.data/platlib/liblzma-9b97b163f3fff34e786ef56c4f919383.dll +0 -0
  14. pyvalhalla_git-3.5.1.post187.data/platlib/libpng16-4a1fbc9b57e99b9c7881563565bfd72a.dll → pyvalhalla_git-3.6.0.data/platlib/libpng16-45e0d625267ecee5996170051645e533.dll +0 -0
  15. pyvalhalla_git-3.5.1.post187.data/platlib/libprotobuf-lite-ad9267b70ceeab0c301d0a1ec48f2c07.dll → pyvalhalla_git-3.6.0.data/platlib/libprotobuf-lite-2bea258fef20ab8f71dcb2fec86675a8.dll +0 -0
  16. pyvalhalla_git-3.5.1.post187.data/platlib/lz4-77ac014ecbb0e1818a064a0c084142a3.dll → pyvalhalla_git-3.6.0.data/platlib/lz4-cb6b9d0ac653fc68b286ff6ba7ef9bf5.dll +0 -0
  17. pyvalhalla_git-3.5.1.post187.data/platlib/proj_9-0314b900bb5b081106b18666f0921a32.dll → pyvalhalla_git-3.6.0.data/platlib/proj_9-3a2a70c01b92ddd4e14ab2bc22e06ab7.dll +0 -0
  18. pyvalhalla_git-3.5.1.post187.data/platlib/qhull_r-4c36dd0bc4600521ef29dec0973a8da6.dll → pyvalhalla_git-3.6.0.data/platlib/qhull_r-46ecfc2e889bb30a2c3af738edb6eeb9.dll +0 -0
  19. pyvalhalla_git-3.5.1.post187.data/platlib/sqlite3-9f887a0723821b9a01c3c1430763cead.dll → pyvalhalla_git-3.6.0.data/platlib/sqlite3-219685aef036100e03dd97e60c61281d.dll +0 -0
  20. pyvalhalla_git-3.5.1.post187.data/platlib/tiff-2d8ce2b51dc79974e521d680e28b5a30.dll → pyvalhalla_git-3.6.0.data/platlib/tiff-f8c8a1908722e0556fad08f0b5c1bb6f.dll +0 -0
  21. pyvalhalla_git-3.5.1.post187.data/platlib/zlib1-882c7ca16198f8e2a6182b8f5d658a18.dll → pyvalhalla_git-3.6.0.data/platlib/zlib1-8425906e295d322425fe840dc45228db.dll +0 -0
  22. pyvalhalla_git-3.6.0.dist-info/DELVEWHEEL +2 -0
  23. {pyvalhalla_git-3.5.1.post187.dist-info → pyvalhalla_git-3.6.0.dist-info}/METADATA +32 -9
  24. pyvalhalla_git-3.6.0.dist-info/RECORD +39 -0
  25. valhalla/__init__.py +12 -4
  26. valhalla/__main__.py +68 -0
  27. valhalla/__version__.py +2 -2
  28. valhalla/_scripts.py +46 -0
  29. valhalla/_valhalla.cc +81 -0
  30. pyvalhalla_git-3.5.1.post187.data/platlib/.load-order-pyvalhalla_git-3.5.1.post187 +0 -20
  31. pyvalhalla_git-3.5.1.post187.dist-info/DELVEWHEEL +0 -2
  32. pyvalhalla_git-3.5.1.post187.dist-info/RECORD +0 -36
  33. {pyvalhalla_git-3.5.1.post187.data → pyvalhalla_git-3.6.0.data}/platlib/msvcp140-73e7ea186a7d9ab676a764ffa64cf7e6.dll +0 -0
  34. {pyvalhalla_git-3.5.1.post187.dist-info → pyvalhalla_git-3.6.0.dist-info}/WHEEL +0 -0
  35. {pyvalhalla_git-3.5.1.post187.dist-info → pyvalhalla_git-3.6.0.dist-info}/licenses/AUTHORS +0 -0
  36. {pyvalhalla_git-3.5.1.post187.dist-info → pyvalhalla_git-3.6.0.dist-info}/licenses/COPYING +0 -0
  37. {pyvalhalla_git-3.5.1.post187.dist-info → pyvalhalla_git-3.6.0.dist-info}/licenses/LICENSE.md +0 -0
  38. {pyvalhalla_git-3.5.1.post187.dist-info → pyvalhalla_git-3.6.0.dist-info}/top_level.txt +0 -0
Binary file
@@ -0,0 +1,20 @@
1
+ gdal-e68c9d36ee94002182307d221cc91ce3.dll
2
+ libprotobuf-lite-2bea258fef20ab8f71dcb2fec86675a8.dll
3
+ jpeg62-52d863f4f0f8139faf1608976c1d91f6.dll
4
+ msvcp140-73e7ea186a7d9ab676a764ffa64cf7e6.dll
5
+ Lerc-d4ff05a506ddcfc551c350aa718ab4da.dll
6
+ json-c-0d6db73c6075abe84a7bdd2a2d393471.dll
7
+ sqlite3-219685aef036100e03dd97e60c61281d.dll
8
+ qhull_r-46ecfc2e889bb30a2c3af738edb6eeb9.dll
9
+ proj_9-3a2a70c01b92ddd4e14ab2bc22e06ab7.dll
10
+ tiff-f8c8a1908722e0556fad08f0b5c1bb6f.dll
11
+ zlib1-8425906e295d322425fe840dc45228db.dll
12
+ geotiff-020296779aedd28fd03f34200e6e3c61.dll
13
+ libexpat-6da76b3644b9424613b6d75323fcdc82.dll
14
+ libpng16-45e0d625267ecee5996170051645e533.dll
15
+ abseil_dll-bdd8a5a1f5a4da3f67279509940f7994.dll
16
+ geos-b8640de6faf146d9855a807e72427e47.dll
17
+ libcurl-bfd466d47923540033e77b192031a728.dll
18
+ geos_c-7d79920a3a18ad2c1ff594fcef060f0a.dll
19
+ liblzma-9b97b163f3fff34e786ef56c4f919383.dll
20
+ lz4-cb6b9d0ac653fc68b286ff6ba7ef9bf5.dll
@@ -0,0 +1,2 @@
1
+ Version: 1.10.1
2
+ Arguments: ['C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\Scripts\\delvewheel', 'repair', '--add-path', 'build/vcpkg_installed/custom-x64-windows/bin', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-dvfz7_9f\\cp39-win_amd64\\built_wheel\\pyvalhalla_git-3.6.0-cp39-cp39-win_amd64.whl', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-dvfz7_9f\\cp39-win_amd64\\repaired_wheel']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyvalhalla-git
3
- Version: 3.5.1.post187
3
+ Version: 3.6.0
4
4
  Summary: High-level bindings to the Valhalla C++ library
5
5
  Home-page: https://github.com/valhalla/valhalla
6
6
  Author: Nils Nolde
@@ -26,7 +26,7 @@ Dynamic: summary
26
26
 
27
27
  ## Valhalla Python bindings
28
28
 
29
- This package contains the Python bindings to [Valhalla routing engine](https://github.com/valhalla/valhalla).
29
+ This folder contains the Python bindings to [Valhalla routing engine](https://github.com/valhalla/valhalla).
30
30
 
31
31
  > [!NOTE]
32
32
  > `pyvalhalla(-git)` packages are currently only published for:
@@ -34,9 +34,7 @@ This package contains the Python bindings to [Valhalla routing engine](https://g
34
34
  > - `win-amd64`
35
35
  > - `macos-arm64`
36
36
 
37
- ### License
38
-
39
- Due to the dependencies we package, the Python bindings are licensed under GNU Lesser General Public License v2 or later (LGPLv2+).
37
+ On top of the (very) high-level Python bindings, we package some data-building Valhalla executables to ease the process of graph creation.
40
38
 
41
39
  ### Installation
42
40
 
@@ -47,7 +45,9 @@ We distribute all currently maintained CPython versions as **binary wheels** for
47
45
 
48
46
  ### Usage
49
47
 
50
- Find a more extended notebook in `./examples`, e.g. how to [use the actor](./examples/actor_examples.ipynb).
48
+ #### Bindings
49
+
50
+ Find a more extended notebook in `./examples`, e.g. how to [use the actor](https://github.com/valhalla/valhalla/blob/master/src/bindings/python/examples/actor_examples.ipynb).
51
51
 
52
52
  Before using the Python bindings you need to have access to a routable Valhalla graph. Either install Valhalla from source and built the graph from OSM compatible data or use our [Valhalla docker image](https://github.com/gis-ops/docker-valhalla) for a painless experience, e.g. this will build the routing graph for Andorra in `./custom_files`:
53
53
 
@@ -71,6 +71,24 @@ actor = Actor(config)
71
71
  route = actor.route({"locations": [...]})
72
72
  ```
73
73
 
74
+ #### Valhalla executables (**`linux-x86_x64` only**)
75
+
76
+ To access the C++ (native) executables, there are 2 options:
77
+ - (recommended) execute the module, e.g. `python -m valhalla valhalla_build_tiles -h`
78
+ - execute the Python wrapper scripts directly, e.g. `valhalla_build_tiles -h`
79
+
80
+ > [!NOTE]
81
+ > For the latter option to work, the Python environment's `bin/` folder has to be in the `$PATH`. Inside virtual environments, that's always the case.
82
+
83
+ Executing the scripts directly might also not work properly if there's a system-wide Valhalla installation, unless the Python environment's `bin/` folder has higher priority than system folders in `$PATH`. The module execution uses an explicit Python executable which should be preferred.
84
+
85
+ There are also some additional commands we added:
86
+ - `--help`: print the help for `python -m valhalla` explicitly
87
+ - `--quiet`: redirect `stdout` of the C++ executables to `/dev/null`; can be added **once** anywhere in the command, will not be forwarded to a C++ executable
88
+ - `print_bin_path`: simply prints the absolute path to the package-internal `bin/` directory where the C++ executables are; useful if the executables should be accessed directly in some script
89
+
90
+ To find out which Valhalla executables are currently included, run `python -m valhalla --help`. We limit the number of executables to control the wheel size. However, we're open to include any other executable if there's a good reason.
91
+
74
92
  ### Building from source
75
93
 
76
94
  #### Linux
@@ -94,7 +112,7 @@ Once built, start a container to actually build Valhalla using AlmaLinux 8:
94
112
  ```shell
95
113
  cd valhalla
96
114
  docker run -dt -v $PWD:/valhalla-py --name valhalla-py --workdir /valhalla-py ghcr.io/valhalla/manylinux:2_28_valhalla_python
97
- docker exec -t valhalla-py /valhalla-py/src/bindings/python/build_linux.sh build_manylinux 3.12
115
+ docker exec -t valhalla-py /valhalla-py/src/bindings/python/build_linux.sh build_manylinux 3.13
98
116
  ```
99
117
 
100
118
  This will also build & install `libvalhalla` before building the bindings. At this point there should be a `wheelhouse` folder with the fixed python wheel, ready to be installed or distributed to arbitrary python 3.12 installations.
@@ -104,11 +122,16 @@ This will also build & install `libvalhalla` before building the bindings. At th
104
122
  On our CI, this orchestrates the packaging of all `pyvalhalla` wheels for every supported, minor Python version and every platform. It can also be run locally (obviously only being able to build wheels for _your_ platform), e.g.
105
123
 
106
124
  ```shell
107
- # specifiers from https://cibuildwheel.pypa.io/en/stable/options/#build-skip
125
+ python -m pip install cibuildwheel
126
+ cibuildwheel --print-build-identifiers
108
127
  cibuildwheel --only cp313-manylinux_x86_64
109
128
 
110
129
  # for windows you'll have to set an env var to the vcpkg win root
111
130
  VCPKG_ARCH_ROOT="build/vcpkg_installed/custom-x64-windows" cibuildwheel --only cp313-manylinux_x86_64
112
131
  ```
113
132
 
114
- On Linux, this might download the `manylinux` docker image. In the end, you'll find the wheel in `./wheelhouse`.
133
+ On Linux, this might download the [`manylinux` docker image](https://github.com/valhalla/manylinux/pkgs/container/manylinux). In the end, you'll find the wheel in `./wheelhouse`.
134
+
135
+ ### Testing (**`linux-x86_x64` only**)
136
+
137
+ We have a small [test script](https://github.com/valhalla/valhalla/blob/master/src/bindings/python/test/test_pyvalhalla_package.sh) which makes sure that all the executables are working properly. If run locally for some reason, install a `pyvalhalla` wheel first. We run this in CI in a fresh Docker container with no dependencies installed, mostly to verify dynamic linking of the vendored dependencies.
@@ -0,0 +1,39 @@
1
+ _valhalla.cp39-win_amd64.pyd,sha256=jEG80RzJZk93kEacSO7fhKisC5mafSf3UXGflTCwZEs,8123392
2
+ pyvalhalla_git-3.6.0.data/platlib/.load-order-pyvalhalla_git-3.6.0,sha256=55ZJyGsyTYhUsY_0VIkue18IpGCFRjcILYoVy6I9x3g,893
3
+ pyvalhalla_git-3.6.0.data/platlib/abseil_dll-bdd8a5a1f5a4da3f67279509940f7994.dll,sha256=1tPsKVjXYxXSMRqiwisqWBZqan9oTY0QdIbO1lkPkKA,1887744
4
+ pyvalhalla_git-3.6.0.data/platlib/gdal-e68c9d36ee94002182307d221cc91ce3.dll,sha256=9hXkACzQk79BuHHgTl-ez5WRfMX1wbSvYKSq-erJW1w,18052096
5
+ pyvalhalla_git-3.6.0.data/platlib/geos-b8640de6faf146d9855a807e72427e47.dll,sha256=rMxgojYCprUIpViJo_yVD_pdo-dMNrJDKjIdw7gDI9w,2582016
6
+ pyvalhalla_git-3.6.0.data/platlib/geos_c-7d79920a3a18ad2c1ff594fcef060f0a.dll,sha256=4Y7CAmrVctYKVXfrZCg0VFvxhKaJHNijLPUdM6OtTTs,457728
7
+ pyvalhalla_git-3.6.0.data/platlib/geotiff-020296779aedd28fd03f34200e6e3c61.dll,sha256=PWk3itN74x-HJAediz-Gjw83Z3NyTwa1cvXxA7h65w0,161792
8
+ pyvalhalla_git-3.6.0.data/platlib/jpeg62-52d863f4f0f8139faf1608976c1d91f6.dll,sha256=SjnGiaIWwMiUwvuTBP_vkfsWjjvVLXkpmC7CFy5iDac,683520
9
+ pyvalhalla_git-3.6.0.data/platlib/json-c-0d6db73c6075abe84a7bdd2a2d393471.dll,sha256=IlPXuHM61ne0troWglvEwMK378fN8duzzNGUog7p6YU,58880
10
+ pyvalhalla_git-3.6.0.data/platlib/Lerc-d4ff05a506ddcfc551c350aa718ab4da.dll,sha256=-DySnPhaoH9nCPkQ2Y7Vq2w3pRWyg9B4NPbM-0l5Vcw,526848
11
+ pyvalhalla_git-3.6.0.data/platlib/libcurl-bfd466d47923540033e77b192031a728.dll,sha256=nB2vYmFVYjnnrOeYwmbtHQY6xCwq6JDToh6oq71Tf0c,595456
12
+ pyvalhalla_git-3.6.0.data/platlib/libexpat-6da76b3644b9424613b6d75323fcdc82.dll,sha256=vxuy9QhoEf_ft2kgIRIdOVVnfj_sVkU-Dhf6VhxZf-c,159232
13
+ pyvalhalla_git-3.6.0.data/platlib/liblzma-9b97b163f3fff34e786ef56c4f919383.dll,sha256=ud-buTBlGnilzkiz-jyM8R8cECpICtG6YIlnRGwuCZU,185856
14
+ pyvalhalla_git-3.6.0.data/platlib/libpng16-45e0d625267ecee5996170051645e533.dll,sha256=MZvYOuWjg9vqE9Vik1Q0bR19UEqakLekRuBBbsCWgCM,201216
15
+ pyvalhalla_git-3.6.0.data/platlib/libprotobuf-lite-2bea258fef20ab8f71dcb2fec86675a8.dll,sha256=z437wWJ5T6V4xBrWjpXjFoXO4KeDXIzWfhJOE-yc1ZY,1502208
16
+ pyvalhalla_git-3.6.0.data/platlib/lz4-cb6b9d0ac653fc68b286ff6ba7ef9bf5.dll,sha256=miEEE0apHQb6DFgVksS8WI1XNUuKI5dLDbp8JI4f_QA,127488
17
+ pyvalhalla_git-3.6.0.data/platlib/msvcp140-73e7ea186a7d9ab676a764ffa64cf7e6.dll,sha256=cDrXxV8uCWYH7Gp3qLX1LVNdvnH93wIel8vLvCP3SSo,576128
18
+ pyvalhalla_git-3.6.0.data/platlib/proj_9-3a2a70c01b92ddd4e14ab2bc22e06ab7.dll,sha256=K4UyFrthaMgtt5JDBbJBcS3fqLz-M4rbB0A_9mm-aL0,3414528
19
+ pyvalhalla_git-3.6.0.data/platlib/qhull_r-46ecfc2e889bb30a2c3af738edb6eeb9.dll,sha256=r4AobL8RQVZlP8WWC5x3ia_Z2LcFwDJNX6g6nNo6k5I,451072
20
+ pyvalhalla_git-3.6.0.data/platlib/sqlite3-219685aef036100e03dd97e60c61281d.dll,sha256=2pgdTUHtB3sMMJDytAVh6Ca83hcPjPK7BLrIBQVbosA,1118208
21
+ pyvalhalla_git-3.6.0.data/platlib/tiff-f8c8a1908722e0556fad08f0b5c1bb6f.dll,sha256=znbA_SkIowGQeQ8bR22yrlCDH9xEcvK8BEVbGNOxlKI,468480
22
+ pyvalhalla_git-3.6.0.data/platlib/zlib1-8425906e295d322425fe840dc45228db.dll,sha256=krva8_8mnj2x_8xU3AcXFXyjJFT0ybZhKiIWURHpYu0,90624
23
+ pyvalhalla_git-3.6.0.dist-info/DELVEWHEEL,sha256=8C2B02VdtiKpaM_tXZgwsPXv20aBJ9FEVFRKtusYRR0,421
24
+ pyvalhalla_git-3.6.0.dist-info/METADATA,sha256=jwX-eoenRnISKSE-yftauFLxD5nCIIm9QMBj5aiMmGk,6921
25
+ pyvalhalla_git-3.6.0.dist-info/RECORD,,
26
+ pyvalhalla_git-3.6.0.dist-info/top_level.txt,sha256=mU472JpF5fOfpVQ8UxZ_dwLmecLogajAMO5RmYsU1gw,19
27
+ pyvalhalla_git-3.6.0.dist-info/WHEEL,sha256=XkFE14KmFh7mutkkb-qn_ueuH2lwfT8rLdfc5xpQ7wE,99
28
+ pyvalhalla_git-3.6.0.dist-info/licenses/AUTHORS,sha256=zfqnWlS9zAHTcyIVTaquUA0hwOLARt8RbHyxV8ksIdo,176
29
+ pyvalhalla_git-3.6.0.dist-info/licenses/COPYING,sha256=0-hXmYGEWqvizZa7uHZz_AefTiGcyE6O9mZH1e9Pf10,1157
30
+ pyvalhalla_git-3.6.0.dist-info/licenses/LICENSE.md,sha256=TTSAvGrQ2khsitpI11WKnicjvEODZlalhi8PAzaRrV4,45
31
+ valhalla/actor.py,sha256=_A8eZpk7xk-7C6Xzz5nFE5Qp5GNInFjXurzjlh_ZmFA,4195
32
+ valhalla/config.py,sha256=LnxZ7uA42QOIB68ld_8VhRdTdsfs-sXQlu_AylLLFi4,1533
33
+ valhalla/utils.py,sha256=-hHjEDCftpOlRBib4CSZVDCLAZMqgtOtkX2V3-5bsJg,1985
34
+ valhalla/valhalla_build_config.py,sha256=xx8HY5RnP492PMP_DgJSgrum7OjkGWeUQAkZgag6LQM,43267
35
+ valhalla/_scripts.py,sha256=t7qQvmsbTfw7aVyJtI0o6aClfoC1rt4KUT2C8YQer74,1550
36
+ valhalla/_valhalla.cc,sha256=2PTlFjS5hA_mWn7_43zsSqx_lhjEzJZE2Ud6N3WpvnI,3780
37
+ valhalla/__init__.py,sha256=aP0OqRVJreCpunCftDk4OKOZm9_GI_671NXUzcO0T44,1962
38
+ valhalla/__main__.py,sha256=nRj1lPEotv-DDr6eTcQ7Y6WQc0jojCgqfNWcR2hs1Cg,2137
39
+ valhalla/__version__.py,sha256=gjaLAkUsBET1sUPJb8F_jnhiFLEWqCIkrz1Y419AaLk,532
valhalla/__init__.py CHANGED
@@ -10,10 +10,10 @@ def _delvewheel_patch_1_10_1():
10
10
  if os.path.isdir(libs_dir):
11
11
  os.add_dll_directory(libs_dir)
12
12
  else:
13
- load_order_filepath = os.path.join(libs_dir, '.load-order-pyvalhalla_git-3.5.1.post187')
13
+ load_order_filepath = os.path.join(libs_dir, '.load-order-pyvalhalla_git-3.6.0')
14
14
  if os.path.isfile(load_order_filepath):
15
15
  import ctypes.wintypes
16
- with open(os.path.join(libs_dir, '.load-order-pyvalhalla_git-3.5.1.post187')) as file:
16
+ with open(os.path.join(libs_dir, '.load-order-pyvalhalla_git-3.6.0')) as file:
17
17
  load_order = file.read().split()
18
18
  kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
19
19
  kernel32.LoadLibraryExW.restype = ctypes.wintypes.HMODULE
@@ -28,11 +28,19 @@ _delvewheel_patch_1_10_1()
28
28
  del _delvewheel_patch_1_10_1
29
29
  # end delvewheel patch
30
30
 
31
+ from pathlib import Path
32
+
31
33
  try:
32
34
  from ._valhalla import *
33
35
  except ModuleNotFoundError:
34
36
  from _valhalla import *
35
-
36
37
  from .actor import Actor
37
38
  from .config import get_config, get_help
38
- from .__version__ import __version__
39
+
40
+ # if run from CMake, Docker or tests
41
+ try:
42
+ from .__version__ import __version__
43
+ except ModuleNotFoundError:
44
+ __version__ = "undefined"
45
+
46
+ PYVALHALLA_DIR = Path(__file__).parent.resolve()
valhalla/__main__.py ADDED
@@ -0,0 +1,68 @@
1
+ import subprocess
2
+ import sys
3
+ from typing import Optional
4
+
5
+ from ._scripts import PYVALHALLA_BIN_DIR, run
6
+ from . import __version__
7
+
8
+ PRINT_BIN_PATH = "print_bin_path"
9
+
10
+
11
+ def print_help():
12
+ # left-align executable names
13
+ exe_names = [p.name for p in PYVALHALLA_BIN_DIR.iterdir()]
14
+ fixed_width = len(max(exe_names, key=lambda x: len(x)))
15
+
16
+ # TODO: we also want the git commit to show here, probably written to __version__.py by setup.py's BDistWheelCommand
17
+ print(
18
+ F"""
19
+ valhalla Python package {__version__}
20
+
21
+ pyvalhalla package provides a CLI to run Valhalla C++ executables. Arguments are simply passed on as they are.
22
+ One notable exception is --quiet/-q, which will forward the C++ executable's stdout to /dev/null.
23
+ 'python -m valhalla --help' will print this help.
24
+
25
+ Example usage: 'python -m valhalla --quiet valhalla_build_tiles -c valhalla.json -s initialize -e build test.pbf'
26
+
27
+ Available commands (in {PYVALHALLA_BIN_DIR}):
28
+ \t{PRINT_BIN_PATH:<{fixed_width}} - Print the absolute path of directory containing the C++ executables
29
+ """
30
+ )
31
+
32
+
33
+ def main():
34
+ if len(sys.argv) < 2:
35
+ print("[FATAL] command needs arguments, see 'python -m valhalla --help': \n")
36
+ print_help()
37
+ sys.exit(1)
38
+
39
+ prog_or_opt = sys.argv[1]
40
+
41
+ if prog_or_opt in ("--help", "-h"):
42
+ print_help()
43
+ sys.exit(0)
44
+ elif prog_or_opt == PRINT_BIN_PATH:
45
+ # useful when another script wants to run the executables directly for some reason
46
+ print(PYVALHALLA_BIN_DIR)
47
+ else:
48
+ exc: Optional[Exception] = None
49
+ try:
50
+ run(from_main=True)
51
+ except (FileNotFoundError, subprocess.CalledProcessError) as e:
52
+ exc = e
53
+ finally:
54
+ if not exc:
55
+ sys.exit(0)
56
+
57
+ if isinstance(exc, subprocess.CalledProcessError):
58
+ print(f"Failed calling command '{exc.cmd}'\n")
59
+
60
+ print_help()
61
+ print("Sub-command failed with:\n")
62
+ print(exc, file=sys.stderr)
63
+
64
+ sys.exit(1)
65
+
66
+
67
+ if __name__ == "__main__":
68
+ main()
valhalla/__version__.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '3.5.1.post187'
21
- __version_tuple__ = version_tuple = (3, 5, 1, 'post187')
20
+ __version__ = version = '3.6.0'
21
+ __version_tuple__ = version_tuple = (3, 6, 0)
valhalla/_scripts.py ADDED
@@ -0,0 +1,46 @@
1
+ from pathlib import Path
2
+ from shutil import which
3
+ import subprocess
4
+ import sys
5
+
6
+ from . import PYVALHALLA_DIR
7
+
8
+ PYVALHALLA_BIN_DIR = PYVALHALLA_DIR.joinpath("bin").resolve()
9
+
10
+
11
+ def run(from_main=False) -> None:
12
+ """
13
+ Parses the command line arguments and runs the Valhalla executables with the
14
+ provided arguments. Note, by default we assume this is not being called by
15
+ __main__.py via e.g. 'python -m valhalla ...', but directly with e.g.d
16
+ 'valhalla_build_tiles -h'. sys.argv relates to different executables for
17
+ both scenarios.
18
+
19
+ :param from_main: We parse sys.argv differently if it's called from __main__.py
20
+ """
21
+ prog = sys.argv[1] if from_main else Path(sys.argv[0]).name
22
+ prog_args = sys.argv[2:] if from_main else sys.argv[1:]
23
+
24
+ if not which(prog):
25
+ raise FileNotFoundError(f"Can't find executable at {prog}")
26
+ prog_path = PYVALHALLA_BIN_DIR.joinpath(prog).resolve()
27
+
28
+ print(f"[INFO] Running {prog_path} with args: {prog_args}...")
29
+
30
+ # --quiet/-q is our option, don't pass it to the executables
31
+ is_quiet = False
32
+ for arg in prog_args:
33
+ if arg not in ("--quiet", "-q"):
34
+ continue
35
+ prog_args.pop(prog_args.index(arg))
36
+ is_quiet = True
37
+
38
+ # recommended way to call exe
39
+ proc = subprocess.run(
40
+ [str(prog_path)] + prog_args,
41
+ stderr=sys.stderr,
42
+ stdout=subprocess.DEVNULL if is_quiet else sys.stdout,
43
+ )
44
+
45
+ # raises CalledProcessError if not successful
46
+ proc.check_returncode()
valhalla/_valhalla.cc ADDED
@@ -0,0 +1,81 @@
1
+ #include "baldr/rapidjson_utils.h"
2
+ #include "midgard/logging.h"
3
+ #include "midgard/util.h"
4
+ #include "tyr/actor.h"
5
+
6
+ #include <boost/make_shared.hpp>
7
+ #include <boost/noncopyable.hpp>
8
+ #include <boost/property_tree/ptree.hpp>
9
+ #include <pybind11/pybind11.h>
10
+
11
+ #include <string>
12
+
13
+ namespace vt = valhalla::tyr;
14
+ namespace {
15
+
16
+ // configuring multiple times is wasteful/ineffectual but not harmful
17
+ // TODO: make this threadsafe just in case its abused
18
+ const boost::property_tree::ptree configure(const std::string& config) {
19
+ boost::property_tree::ptree pt;
20
+ try {
21
+ // parse the config and configure logging
22
+ rapidjson::read_json(config, pt);
23
+
24
+ auto logging_subtree = pt.get_child_optional("mjolnir.logging");
25
+ if (logging_subtree) {
26
+ auto logging_config = valhalla::midgard::ToMap<const boost::property_tree::ptree&,
27
+ std::unordered_map<std::string, std::string>>(
28
+ logging_subtree.get());
29
+ valhalla::midgard::logging::Configure(logging_config);
30
+ }
31
+ } catch (...) { throw std::runtime_error("Failed to load config from: " + config); }
32
+
33
+ return pt;
34
+ }
35
+ } // namespace
36
+
37
+ namespace py = pybind11;
38
+
39
+ PYBIND11_MODULE(_valhalla, m) {
40
+ py::class_<vt::actor_t>(m, "_Actor", "Valhalla Actor class")
41
+ .def(py::init<>([](std::string config) { return vt::actor_t(configure(config), true); }))
42
+ .def(
43
+ "route", [](vt::actor_t& self, std::string& req) { return self.route(req); },
44
+ "Calculates a route.")
45
+ .def(
46
+ "locate", [](vt::actor_t& self, std::string& req) { return self.locate(req); },
47
+ "Provides information about nodes and edges.")
48
+ .def(
49
+ "optimized_route",
50
+ [](vt::actor_t& self, std::string& req) { return self.optimized_route(req); },
51
+ "Optimizes the order of a set of waypoints by time.")
52
+ .def(
53
+ "matrix", [](vt::actor_t& self, std::string& req) { return self.matrix(req); },
54
+ "Computes the time and distance between a set of locations and returns them as a matrix table.")
55
+ .def(
56
+ "isochrone", [](vt::actor_t& self, std::string& req) { return self.isochrone(req); },
57
+ "Calculates isochrones and isodistances.")
58
+ .def(
59
+ "trace_route", [](vt::actor_t& self, std::string& req) { return self.trace_route(req); },
60
+ "Map-matching for a set of input locations, e.g. from a GPS.")
61
+ .def(
62
+ "trace_attributes",
63
+ [](vt::actor_t& self, std::string& req) { return self.trace_attributes(req); },
64
+ "Returns detailed attribution along each portion of a route calculated from a set of input locations, e.g. from a GPS trace.")
65
+ .def(
66
+ "height", [](vt::actor_t& self, std::string& req) { return self.height(req); },
67
+ "Provides elevation data for a set of input geometries.")
68
+ .def(
69
+ "transit_available",
70
+ [](vt::actor_t& self, std::string& req) { return self.transit_available(req); },
71
+ "Lookup if transit stops are available in a defined radius around a set of input locations.")
72
+ .def(
73
+ "expansion", [](vt::actor_t& self, std::string& req) { return self.expansion(req); },
74
+ "Returns all road segments which were touched by the routing algorithm during the graph traversal.")
75
+ .def(
76
+ "centroid", [](vt::actor_t& self, std::string& req) { return self.centroid(req); },
77
+ "Returns routes from all the input locations to the minimum cost meeting point of those paths.")
78
+ .def(
79
+ "status", [](vt::actor_t& self, std::string& req) { return self.status(req); },
80
+ "Returns nothing or optionally details about Valhalla's configuration.");
81
+ }
@@ -1,20 +0,0 @@
1
- sqlite3-9f887a0723821b9a01c3c1430763cead.dll
2
- geotiff-e36440f3fa837002abf4656c8a82bee1.dll
3
- lz4-77ac014ecbb0e1818a064a0c084142a3.dll
4
- Lerc-5492e53a634552d158814335bfd5508b.dll
5
- libcurl-39889826283c088f2b3897191ab7d21d.dll
6
- libexpat-0a3bbd6de9307d0020c69673bdb3d5f1.dll
7
- json-c-520fb69b2bfce9e17f4c6595040d996f.dll
8
- tiff-2d8ce2b51dc79974e521d680e28b5a30.dll
9
- geos-6c521f6a54fa614211eebaea0a890f5e.dll
10
- liblzma-953b7b97af894314faccc0606d85cede.dll
11
- libpng16-4a1fbc9b57e99b9c7881563565bfd72a.dll
12
- gdal-ef87f613f24439573ac93245419c57fb.dll
13
- libprotobuf-lite-ad9267b70ceeab0c301d0a1ec48f2c07.dll
14
- proj_9-0314b900bb5b081106b18666f0921a32.dll
15
- jpeg62-cdecd204dfd888a80dba8d7e15cb5b60.dll
16
- msvcp140-73e7ea186a7d9ab676a764ffa64cf7e6.dll
17
- zlib1-882c7ca16198f8e2a6182b8f5d658a18.dll
18
- abseil_dll-1fc67c8668f83d1a5bea7b37c99ca6c3.dll
19
- qhull_r-4c36dd0bc4600521ef29dec0973a8da6.dll
20
- geos_c-98a48e4eb33f944d74a394141acb7eaf.dll
@@ -1,2 +0,0 @@
1
- Version: 1.10.1
2
- Arguments: ['C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\Scripts\\delvewheel', 'repair', '--add-path', 'build/vcpkg_installed/custom-x64-windows/bin', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-ma6bo3dy\\cp39-win_amd64\\built_wheel\\pyvalhalla_git-3.5.1.post187-cp39-cp39-win_amd64.whl', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-ma6bo3dy\\cp39-win_amd64\\repaired_wheel']
@@ -1,36 +0,0 @@
1
- _valhalla.cp39-win_amd64.pyd,sha256=lKYQJb5hjR6ZJpACCH55bNryInokaHPkToG8pSGuY4k,8123392
2
- pyvalhalla_git-3.5.1.post187.data/platlib/.load-order-pyvalhalla_git-3.5.1.post187,sha256=grehf6-nfUgDvRpDRHN68A4H--2n8Z5_UkSfq0HjDoI,893
3
- pyvalhalla_git-3.5.1.post187.data/platlib/abseil_dll-1fc67c8668f83d1a5bea7b37c99ca6c3.dll,sha256=JxC8gzXY3ULA4kzXVPmiGAH8pYggofnRKpuKI8RWs5Q,1887744
4
- pyvalhalla_git-3.5.1.post187.data/platlib/gdal-ef87f613f24439573ac93245419c57fb.dll,sha256=1ShlE9E_IYmbSDJaq7KruNMv0w_hbJ7q-2X93ePtcas,18052096
5
- pyvalhalla_git-3.5.1.post187.data/platlib/geos-6c521f6a54fa614211eebaea0a890f5e.dll,sha256=MRf-bLrP82WB92IKnuwkM6YMvd8gnIE9gp6S_B9kL-Y,2582016
6
- pyvalhalla_git-3.5.1.post187.data/platlib/geos_c-98a48e4eb33f944d74a394141acb7eaf.dll,sha256=M4Tea5iyOgcuTHtAb6UxjC8TDYETx6EWrNCFcxjhq90,457728
7
- pyvalhalla_git-3.5.1.post187.data/platlib/geotiff-e36440f3fa837002abf4656c8a82bee1.dll,sha256=OtzL5DG5Yi0MlvFQB-mgDiCkHtR98V8EGY9kAzWDEOc,161792
8
- pyvalhalla_git-3.5.1.post187.data/platlib/jpeg62-cdecd204dfd888a80dba8d7e15cb5b60.dll,sha256=3Njm9u2ynTA5_AON3ui6APK5bExn3Nxci_IYMuE4XUE,683520
9
- pyvalhalla_git-3.5.1.post187.data/platlib/json-c-520fb69b2bfce9e17f4c6595040d996f.dll,sha256=eSo-EsI3ISu3UGQcLEdRA4a84mOs_6PsWuNo7aW2Qfg,58880
10
- pyvalhalla_git-3.5.1.post187.data/platlib/Lerc-5492e53a634552d158814335bfd5508b.dll,sha256=hi5fqms3kpEnvFhz1eJdYYq4omMI_1Ve7iAUU-2iUv4,526848
11
- pyvalhalla_git-3.5.1.post187.data/platlib/libcurl-39889826283c088f2b3897191ab7d21d.dll,sha256=tf01uKIBv0LrQFBKzzhTuhnCANJLcKFMREepfIjbpDI,595456
12
- pyvalhalla_git-3.5.1.post187.data/platlib/libexpat-0a3bbd6de9307d0020c69673bdb3d5f1.dll,sha256=YNDK4-_p_xUPZU_U9i2iUKSxzk5w6sT9_RUtbFnggYQ,159232
13
- pyvalhalla_git-3.5.1.post187.data/platlib/liblzma-953b7b97af894314faccc0606d85cede.dll,sha256=v3x9ERcMQ_qQiLQoPeDBqEMIM4sdL14w9jjL7_WmqOc,185856
14
- pyvalhalla_git-3.5.1.post187.data/platlib/libpng16-4a1fbc9b57e99b9c7881563565bfd72a.dll,sha256=jCssnGKi0ui84VBxahsYSZZxNocwdJcUyncZehtkcoU,201216
15
- pyvalhalla_git-3.5.1.post187.data/platlib/libprotobuf-lite-ad9267b70ceeab0c301d0a1ec48f2c07.dll,sha256=3RbsupqD_7SrGoF7_zBSFthIDVFl7wRhoSuEhLi3Q2A,1502208
16
- pyvalhalla_git-3.5.1.post187.data/platlib/lz4-77ac014ecbb0e1818a064a0c084142a3.dll,sha256=2tUogjKUHWJga91pezGBczrFXVBsCa63N86rAuLdapA,127488
17
- pyvalhalla_git-3.5.1.post187.data/platlib/msvcp140-73e7ea186a7d9ab676a764ffa64cf7e6.dll,sha256=cDrXxV8uCWYH7Gp3qLX1LVNdvnH93wIel8vLvCP3SSo,576128
18
- pyvalhalla_git-3.5.1.post187.data/platlib/proj_9-0314b900bb5b081106b18666f0921a32.dll,sha256=L01PdfyGtx3E3xgrYj8cph5zdVgUgukGX47WK7KJZkw,3414528
19
- pyvalhalla_git-3.5.1.post187.data/platlib/qhull_r-4c36dd0bc4600521ef29dec0973a8da6.dll,sha256=2yVG47tZEHYsgZfdIUDfTrElFKNn94cQgx9iONqk34o,451072
20
- pyvalhalla_git-3.5.1.post187.data/platlib/sqlite3-9f887a0723821b9a01c3c1430763cead.dll,sha256=gtLH4aBFxIb9cG1YzUfDpKOkE6B3rxcWKIA16kdhNBY,1118208
21
- pyvalhalla_git-3.5.1.post187.data/platlib/tiff-2d8ce2b51dc79974e521d680e28b5a30.dll,sha256=0JvOzW9tXCUaTcNxVwbALYxb2ddgj-dFLUEFJ7AUXpc,468480
22
- pyvalhalla_git-3.5.1.post187.data/platlib/zlib1-882c7ca16198f8e2a6182b8f5d658a18.dll,sha256=u74_0pDv2tbGlcORzlK00nsSnRUSKelODkN9ZgZ_CjM,90624
23
- pyvalhalla_git-3.5.1.post187.dist-info/DELVEWHEEL,sha256=hUTqHxUFeTpqo8Kvfl1UsxHZMYm5U-S9B1nIGxZ-gkU,429
24
- pyvalhalla_git-3.5.1.post187.dist-info/METADATA,sha256=i_E_MayGCtiYsfAh9UIGju86d9vnhWHdTvLk_SnjrQI,4887
25
- pyvalhalla_git-3.5.1.post187.dist-info/RECORD,,
26
- pyvalhalla_git-3.5.1.post187.dist-info/top_level.txt,sha256=mU472JpF5fOfpVQ8UxZ_dwLmecLogajAMO5RmYsU1gw,19
27
- pyvalhalla_git-3.5.1.post187.dist-info/WHEEL,sha256=XkFE14KmFh7mutkkb-qn_ueuH2lwfT8rLdfc5xpQ7wE,99
28
- pyvalhalla_git-3.5.1.post187.dist-info/licenses/AUTHORS,sha256=zfqnWlS9zAHTcyIVTaquUA0hwOLARt8RbHyxV8ksIdo,176
29
- pyvalhalla_git-3.5.1.post187.dist-info/licenses/COPYING,sha256=0-hXmYGEWqvizZa7uHZz_AefTiGcyE6O9mZH1e9Pf10,1157
30
- pyvalhalla_git-3.5.1.post187.dist-info/licenses/LICENSE.md,sha256=TTSAvGrQ2khsitpI11WKnicjvEODZlalhi8PAzaRrV4,45
31
- valhalla/actor.py,sha256=_A8eZpk7xk-7C6Xzz5nFE5Qp5GNInFjXurzjlh_ZmFA,4195
32
- valhalla/config.py,sha256=LnxZ7uA42QOIB68ld_8VhRdTdsfs-sXQlu_AylLLFi4,1533
33
- valhalla/utils.py,sha256=-hHjEDCftpOlRBib4CSZVDCLAZMqgtOtkX2V3-5bsJg,1985
34
- valhalla/valhalla_build_config.py,sha256=xx8HY5RnP492PMP_DgJSgrum7OjkGWeUQAkZgag6LQM,43267
35
- valhalla/__init__.py,sha256=JjS5BntnO2gRJdpf4zss8q6vx1a7AkNlEV42WWE96TU,1790
36
- valhalla/__version__.py,sha256=WEKpsulOk70PsadYG2C7WVxGNaBF9BS3gGG2wOLgnbU,551