Skip to content

Commit 248003c

Browse files
authored
Merge pull request #276 from mapnik/pybind11
Pybind11 [WIP]
2 parents 5ab32f0 + 7edaed1 commit 248003c

File tree

109 files changed

+5139
-5899
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+5139
-5899
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
[submodule "test/data"]
55
path = test/data
66
url = https://github.com/mapnik/test-data.git
7+
[submodule "extern/pybind11"]
8+
path = extern/pybind11
9+
url = ../../pybind/pybind11
10+
branch = stable

.travis.yml

Lines changed: 0 additions & 93 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,25 @@
1+
**New** Python bindings for Mapnik **[WIP]**
12

2-
[![Build Status](https://travis-ci.org/mapnik/python-mapnik.svg)](https://travis-ci.org/mapnik/python-mapnik)
3-
4-
Python bindings for Mapnik.
3+
https://github.com/pybind/pybind11
54

65
## Installation
76

8-
Eventually we hope that many people will simply be able to `pip install mapnik` in order to get prebuilt binaries,
9-
this currently does not work though. So for now here are the instructions
10-
11-
### Create a virtual environment
12-
13-
It is highly suggested that you have [a python virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/) when developing
14-
on mapnik.
15-
16-
### Building from Mason
17-
18-
If you do not have mapnik built from source and simply wish to develop from the latest version in [mapnik master branch](https://github.com/mapnik/mapnik) you can setup your environment with a mason build. In order to trigger a mason build prior to building you must set the `MASON_BUILD` environment variable.
19-
20-
```bash
21-
export MASON_BUILD=true
22-
```
23-
24-
After this is done simply follow the directions as per a source build.
25-
267
### Building from Source
278

28-
Assuming that you built your own mapnik from source, and you have run `make install`. Set any compiler or linking environment variables as necessary so that your installation of mapnik is found. Next simply run one of the two methods:
29-
30-
```
31-
python setup.py develop
32-
```
33-
34-
If you are currently developing on mapnik-python and wish to change the code in place and immediately have python changes reflected in your environment.
35-
36-
37-
```
38-
python setup.py install
39-
```
40-
41-
If you wish to just install the package.
42-
43-
```
44-
python setup.py develop --uninstall
45-
```
46-
47-
Will de-activate the development install by removing the `python-mapnik` entry from `site-packages/easy-install.pth`.
48-
49-
50-
If you need Pycairo, make sure that PYCAIRO is set to true in your environment or run:
9+
Make sure 'mapnik-config' is present and accessible via $PATH env variable
5110

5211
```
53-
PYCAIRO=true python setup.py develop
12+
pip install . -v
5413
```
5514

56-
### Building against Mapnik 3.0.x
57-
58-
The `master` branch is no longer compatible with `3.0.x` series of Mapnik. To build against Mapnik 3.0.x, use [`v3.0.x`](https://github.com/mapnik/python-mapnik/tree/v3.0.x) branch.
59-
6015
## Testing
6116

6217
Once you have installed you can test the package by running:
6318

6419
```
65-
git submodule update --init
66-
python setup.py test
67-
```
68-
69-
The test data in `./test/data` and `./test/data-visual` are standalone modules. If you need to update them see https://github.com/mapnik/mapnik/blob/master/docs/contributing.md#testing
70-
71-
72-
### Troubleshooting
73-
74-
If you hit an error like:
75-
76-
```
77-
Fatal Python error: PyThreadState_Get: no current thread
78-
Abort trap: 6
20+
pytest test/python_tests/
7921
```
8022

81-
That means you likely have built python-mapnik linked against a different python version than what you are running. To solve this try running:
82-
83-
```
84-
/usr/bin/python <your script.py>
85-
```
86-
87-
If you hit an error like the following when building with mason:
88-
89-
```
90-
EnvironmentError:
91-
Missing boost_python boost library, try to add its name with BOOST_PYTHON_LIB environment var.
92-
```
93-
94-
Try to set `export BOOST_PYTHON_LIB=boost_python` before build.
95-
Also, if `boost_thread` or `boost_system` is missing, do likewise:
96-
97-
```
98-
export BOOST_SYSTEM_LIB=boost_system
99-
export BOOST_THREAD_LIB=boost_thread
100-
```
10123

102-
If you still hit a problem create an issue and we'll try to help.
10324

104-
## Tutorials
10525

106-
- [Getting started with Python bindings](docs/getting-started.md)

bootstrap.sh

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)