Permalink
Browse files

Tune RST

  • Loading branch information...
noirbizarre committed Aug 30, 2012
1 parent bf03f1b commit 8d677e71a8fc8fd41bfaafcfd74e721c2b0648e4
Showing with 93 additions and 132 deletions.
  1. +6 −3 CHANGELOG.python.rst
  2. +75 −127 README.python.rst
  3. +12 −2 setup.py
View
@@ -1,5 +1,7 @@
-Changelog for mapnik
-========================
+Changelog
+=========
+This the PyPI Python bindings only changelog.
+For a full changelog see `the official Mapnik changelog <https://github.com/mapnik/mapnik/blob/master/CHANGELOG.md>`_.
2.1.0
-----
@@ -30,6 +32,7 @@ Changelog for mapnik
2.0.1 (2012-05-06)
------------------
-First public release of mapnik2 eggified python bindings
+
+- First public release of mapnik2 eggified python bindings
View
@@ -1,108 +1,92 @@
-==========================
-Introduction
-==========================
+======================
+Mapnik Python Bindings
+======================
-.. image:: https://secure.travis-ci.org/mapnik/pymapnik2.png
- :target: http://travis-ci.org/mapnik/pymapnik2
+Official `Mapnik`_ python bindings.
-.. contents::
-
-
-Official mapnik bindings repackaged in the distutils way to facilitate deployments.
-
-
-MAPNIK2 Notes
-===============
-
-The python bindings are tied to the mapnik2 library version.
+.. image:: https://secure.travis-ci.org/mapnik/mapnik.png
+ :target: http://travis-ci.org/mapnik/mapnik
-To use with:
-
- - :mapnik2 library - 2.0.1: == mapnik2 2.0.1.3
- ::
+.. contents::
- easy_install -U mapnik2==2.0.1.3
+Installation
+============
- - :mapnik2 library - 2.0.2: == mapnik2 2.0.2.1
- ::
+Prerequisites
+-------------
- easy_install -U mapnik2==2.0.2.1
+Before installing, you need:
+* the ``mapnik-config`` utility in your ``$PATH``
+* ``Boost.Python`` linked to your python interpreter (see `Boost notes`_)
+* ``cairo`` / ``cairomm`` (optionnal but enabled if you compiled mapnik with cairo support)
+* mapnik
+* The current python interpreter
-Credits
-=========
-Companies
-----------------
-|makinacom|_
+Version notes
+-------------
-* `Planet Makina Corpus <http://www.makina-corpus.org>`_
-* `Contact us <mailto:python@makina-corpus.org>`_
+The python bindings are tied to the mapnik library version.
-.. |makinacom| image:: http://depot.makina-corpus.org/public/logo.gif
-.. _makinacom: http://www.makina-corpus.com
+======================== ====================
+ Mapnik library version Python package
+======================== ====================
+2.0.x mapnik2 (==2.0.1.3)
+2.1.0 mapnik (==2.1.0)
+======================== ====================
-Authors
----------------
+You can find your installed version with:
-Contributors
----------------
+.. code-block:: bash
- - kiorky <kiorky@cryptelium.net>
+ $ mapnik-config -v
-Installation
-======================================
-Prerequisites
--------------------
-Don't forget that you can play with LDFLAGS/CFLAGS/LD_LIBRARY_PATH dto indicate non standart locations for the following requirements if it applies.
+Boost notes
+-----------
-You will have to have the includes and libraries for
+To specify which ``boost_python`` lib to link against, you can use:
- - The new mapnik-config utility to be in your $PATH
- - Boost_python linked to your python interpreter
- If it is not installed in standart envionments, you ll have to handle the CFLAGS/LDFLAGS to find it, or use minitage ;)
- - cairo / cairomm (optionnal but enabled if you compiled mapnik with cairo support)
- - mapnik2
- - The current python interpreter
+.. code-block:: bash
+ $ export MAPNIK2_BOOST_PYTHON="libboost_python.so.1"
-BOOST NOTES
---------------
+Where you have on your filesystem
-To specify which boostpython lib to link against, you can use, you can use the following::
+.. code-block:: bash
- export MAPNIK2_BOOST_PYTHON="libboost_python.so.1"
+ /usr/lib/libboost_python.so.1
-Where you have on your filesystem::
+Don't forget that you can play with ``LDFLAGS``/``CFLAGS``/``LD_LIBRARY_PATH`` to indicate non standart locations for the requirements if it applies.
- /usr/lib/libboost_python.so.1
+Standard installation
+---------------------
+You can use either ``easy_install`` or ``pip``.
+Choose the one you prefer into:
-Easy_install with or without virtualenv
----------------------------------------------
-* Say where to find mapnik-config by settings correctly your PATH environment variable
-* When you're reading this you have probably already run
- ``easy_install mapnik2``. Find out how to install setuptools
- (and EasyInstall) here:
- http://peak.telecommunity.com/DevCenter/EasyInstall
+.. code-block:: bash
-::
+ $ easy_install mapnik # to use the last known version
+ $ easy_install mapnik==2.1.0 # to pin the version
+ $ pip install mapnik # to use the last known version
+ $ pip install mapnik==2.1.0 # to pin the version
- virtualenv --no-site-packages test
- source test/bin/activate
- easy_install mapnik2
+Standard installation works with virtualenv too.
-If your boost python installation is not in a standart place, just set the [LD_LIBRARY_PATH, LDFLAGS, CFLAGS] to find it.
+If an error occurs, please read carefully `Prerequisites`_, `Version notes`_ and `Boost notes`_ sections before submitting an issue to the `Mapnik tracker`_.
Buildout
-----------
+--------
+
Some developers use buildout_ to ease deployments.
-* Say where to find mapnik-config by settings correctly your PATH environment variable
+
* Add ``mapnik`` to the list of eggs to install, e.g.
-::
+
+.. code-block:: ini
[buildout]
parts = somepart
@@ -114,76 +98,40 @@ Some developers use buildout_ to ease deployments.
...
eggs =
...
- mapnik2
-
-* Re-run buildout, e.g. with::
-
- $ ./bin/buildout
-
-You can read the buildout installation shipped with this egg for inspiration.
-
-Minitage
---------------
-Some developers use minitage_ to ease deployments (a layer upon buildout).
-Indeed, it takes care a lot of things like those boring compilation flags.
-As an example, to work on this egg in development mode, you can boostrap it by doing this::
-::
-
- easy_install -U virtualenv
- virtualenv --no-site-packages --distribute ~/minitage
- mkdir ~/minitage/others
-
-
-
-
-Install minitage, if you haven't yet ::
+ mapnik
- source ~/minitage/bin/activate
- easy_install -U minitage.core
+* Re-run buildout, e.g. with:
-Initialize it (**mandatory**) ::
+.. code-block:: bash
- source ~/minitage/bin/activate
- minimerge -s
-
-To install the minilay for the mapnik2 egg development you can do
-::
+ $ ./bin/buildout
- cd ~/minitage/others
- git clone https://github.com/mapnik/pymapnik2.git mapnik-egg-(py26 or py27)
- ln -fs ~/minitage/others/mapnik-egg*/minilays/mapnik-egg/ ~/minitage/minilays/mapnik-egg
- #for python-2.6
- minimerge -av mapnik-egg-py26
- #for python-2.7
- minimerge -av mapnik-egg-py27
+Credits
+=======
-Enjoy your installation
-::
+Companies
+---------
- cd ~/minitage/others/mapnik-egg-py26
- or cd ~/minitage/others/mapnik-egg-py27
- ./bin/mypy
- >>> import mapnik2
+|makinacom|_
-For using mapnik2 inside your minitagified application:
+* `Planet Makina Corpus <http://www.makina-corpus.org>`_
+* `Contact us <mailto:python@makina-corpus.org>`_
- - Inside the eggs parts of you buildout add::
+.. |makinacom| image:: http://depot.makina-corpus.org/public/logo.gif
+.. _makinacom: http://www.makina-corpus.com
- [part]
- ...
- eggs += mapnik2
- - In your minibuild, merge the mapnik2 dependencies that you can find here:
+Authors
+-------
- - for python2.6: https://github.com/mapnik/pymapnik2/blob/master/minilays/mapnik-egg/mapnik-egg-py26
- - for python2.7: https://github.com/mapnik/pymapnik2/blob/master/minilays/mapnik-egg/mapnik-egg-py27
+Contributors
+------------
- - Reminimerge your project to build the mapnik2 egg
- - Then add mapnik2 to your setup.py or buildout for it to be grabbed in your pythonpath.
- - Rerun buildout, you're done
+* kiorky <kiorky@cryptelium.net>
+* noirbizarre <noirbizarre+mapnik@gmail.com>
-.. _minitage: http://www.minitage.org
.. _buildout: http://buildout.org
-.. _pythonproducts: http://plone.org/products/pythonproducts
+.. _Mapnik: http://www.mapnik.org
+.. _Mapnik tracker: https://github.com/mapnik/mapnik/issues
View
@@ -8,6 +8,16 @@
from ctypes import CDLL
+def rst(filename):
+ '''
+ Load rst file and sanitize it for PyPI.
+ Remove unsupported github tags:
+ - code-block directive
+ '''
+ content = open(filename).read()
+ return re.sub(r'\.\.\s? code-block::\s*\w+', '::', content)
+
+
def mapnik_config(key):
cmd = 'mapnik-config --%s' % key
try:
@@ -77,8 +87,8 @@ def mapnik_config(key):
long_description = '\n'.join((
- open('README.python.rst').read(),
- open('CHANGELOG.python.rst').read(),
+ rst('README.python.rst'),
+ rst('CHANGELOG.python.rst'),
''
))

0 comments on commit 8d677e7

Please sign in to comment.