@@ -42,41 +42,40 @@ pyosmium has the following dependencies:
4242 * [ libbz2] ( https://www.sourceware.org/bzip2/ )
4343 * [ Boost] ( https://www.boost.org/ ) variant and iterator >= 1.70
4444 * [ Python Requests] ( https://docs.python-requests.org/ )
45- * Python setuptools
45+ * [ scikit-build-core ] ( https://scikit-build-core.readthedocs.io )
4646 * a C++17-compatible compiler (Clang 13+, GCC 10+ are supported)
4747
4848### Compiling from Source
4949
50- Get the latest versions of libosmium, protozero and pybind11 source code. It is
51- recommended that you put them in a subdirectory ` contrib ` .
50+ Make sure to install the development packages for expat, libz, libbz2
51+ and boost.
5252
53- You can do this by cloning their repositories into that location.
53+ The appropriate versions for Libosmium and Protozero will be downloaded into
54+ the ` contrib ` directory when building the source package:
5455
55- Following commands should achieve this:
56+ python3 -m build -s
5657
57- ```
58- mkdir contrib
59- cd contrib
60- git clone https://github.com/osmcode/libosmium.git
61- git clone https://github.com/mapbox/protozero.git
62- git clone https://github.com/pybind/pybind11.git
63- ```
58+ Alternatively, provide custom locations for these libraries by setting
59+ ` Libosmium_ROOT ` and ` Protozero_ROOT ` .
6460
65- You can also set custom locations with ` LIBOSMIUM_PREFIX ` , ` PROTOZERO_PREFIX ` and
66- ` PYBIND11_PREFIX ` respectively.
61+ To compile and install the bindings, run
6762
68- To use a custom boost installation, set ` BOOST_PREFIX ` .
63+ pip install .
6964
70- To compile the bindings during development, you can use
71- [ build] ( https://pypa-build.readthedocs.io/en/stable/ ) .
72- On Debian/Ubuntu-like systems, install ` python3-build ` , then
73- run:
65+ ### Compiling for Development
7466
75- python3 -m build -w
67+ To compile during development, you can use the experimental
68+ [ Editable install mode] ( https://scikit-build-core.readthedocs.io/en/latest/configuration/index.html#editable-installs )
69+ of scikit-build-core:
7670
77- To compile and install the bindings, run
71+ Create a virtualenv with scikit-build-core and pybind11 preinstalled:
7872
79- pip install .
73+ virtualenv /tmp/dev-venv
74+ /tmp/dev-venv/bin/pip install scikit-build-core pybind11
75+
76+ Now compile pyosmium with:
77+
78+ /tmp/dev-venv/bin/pip --no-build-isolation --config-settings=editable.rebuild=true -Cbuild-dir=/tmp/build -ve.
8079
8180
8281## Examples
@@ -90,18 +89,18 @@ They are mostly ports of the examples in Libosmium and osmium-contrib.
9089There is a small test suite in the test directory. This provides unit
9190test for the python bindings, it is not meant to be a test suite for Libosmium.
9291
93- Testing requires ` pytest ` and ` pytest-httpserver ` . On Debian/Ubuntu install
94- the dependencies with :
92+ Testing requires ` pytest ` and ` pytest-httpserver ` and optionally
93+ pytest-run-parallel and shapely. Install those into your dev environment :
9594
96- sudo apt-get install python3-pytest python3-pytest-httpserver
95+ /tmp/dev-venv/bin/pip install --no-build-isolation --config-settings=editable.rebuild=true -Cbuild-dir=build -ve.[tests]
9796
98- or install them with pip using :
97+ The test suite can be run with :
9998
100- pip install osmium[tests]
99+ /tmp/dev-venv/bin/pytest test
101100
102- The test suite can be run with :
101+ To test parallel execution on free-threaded Python, run :
103102
104- pytest test
103+ /tmp/dev-venv/bin/ pytest test --parallel-threads 10 --iterations 100
105104
106105
107106## Documentation
@@ -145,4 +144,5 @@ Pyosmium is available under the BSD 2-Clause License. See LICENSE.TXT.
145144
146145## Authors
147146
148- Sarah Hoffmann (
[email protected] )
147+ Sarah Hoffmann (
[email protected] ) and otheres. See commit logs for a full
148+ list.
0 commit comments