nilsnolde / py-osrm

Python bindings to the OSRM routing framework
https://gis-ops.github.io/py-osrm/
BSD 2-Clause "Simplified" License
8 stars 8 forks source link

Local build & install of new package #1

Closed nilsnolde closed 1 year ago

nilsnolde commented 1 year ago

In the end we should be able to do a python -m build for a local build.

whytro commented 1 year ago

I took a closer look at nanobind's documentation regarding packaging and it seems to not include a Pybind11Extension/setup_helpers equivalent. It instead seems to use scikit-build-core - which is a build system package. It does seems to be standalone, so there would be no worry about importing a large package just for packaging.

The downside is that scikit-build-core only supports Python 3.7+. While Python 3.6 and lower did go EOL years ago, it may be an issue if we want to support those older versions. If scikit-build-core's version requirement is an issue, I can look for alternative solutions, or just revert to using pybind over nanobind.

nilsnolde commented 1 year ago

Thanks @whytro, good research! IMO scikit-build-core seems totally fine. It's platform-independent, has no weird dependencies and solid authors. I'd only aim to support 3.7+ as well, i.e. actually supported minor versions. Some bigger packages even already dropped support for 3.7 (which we could too, EOL in 2 months or so, but let's not unless there's a good reason).

So nanobind is IMO still a good choice.

whytro commented 1 year ago

@nilsnolde I've created a pull request for this for review. python3 -m build also runs successfully, as per desired end-result, and I've also included a test file to test that the installation/bindings linking was successful (although it simply prints out an osrm-related error).

nilsnolde commented 1 year ago

done in #2