Commit 73e83c24 authored by scoder's avatar scoder Committed by GitHub

Merge pull request #2184 from jkleckner/add-no_zip_safe-to-documentation

Add zip_safe=False to userguide setup.py
parents 59f26d18 f4d03b3d
...@@ -56,6 +56,12 @@ To build, run ``python setup.py build_ext --inplace``. Then simply ...@@ -56,6 +56,12 @@ To build, run ``python setup.py build_ext --inplace``. Then simply
start a Python session and do ``from hello import say_hello_to`` and start a Python session and do ``from hello import say_hello_to`` and
use the imported function as you see fit. use the imported function as you see fit.
One caveat if you use setuptools instead of distutils, the default
action when running ``python setup.py install`` is to create a zipped
``egg`` file which will not work with ``cimport`` for ``pxd`` files
when you try to use them from a dependent package.
To prevent this, include ``zip_safe=False`` in the arguments to ``setup()``.
.. _jupyter-notebook: .. _jupyter-notebook:
Using the Jupyter notebook Using the Jupyter notebook
......
...@@ -140,6 +140,12 @@ Note that when using setuptools, you should import it before Cython as ...@@ -140,6 +140,12 @@ Note that when using setuptools, you should import it before Cython as
setuptools may replace the ``Extension`` class in distutils. Otherwise, setuptools may replace the ``Extension`` class in distutils. Otherwise,
both might disagree about the class to use here. both might disagree about the class to use here.
Note also that if you use setuptools instead of distutils, the default
action when running ``python setup.py install`` is to create a zipped
``egg`` file which will not work with ``cimport`` for ``pxd`` files
when you try to use them from a dependent package.
To prevent this, include ``zip_safe=False`` in the arguments to ``setup()``.
If your options are static (for example you do not need to call a tool like If your options are static (for example you do not need to call a tool like
``pkg-config`` to determine them) you can also provide them directly in your ``pkg-config`` to determine them) you can also provide them directly in your
.pyx or .pxd source file using a special comment block at the start of the file:: .pyx or .pxd source file using a special comment block at the start of the file::
...@@ -324,6 +330,12 @@ e.g.:: ...@@ -324,6 +330,12 @@ e.g.::
These ``.pxd`` files need not have corresponding ``.pyx`` These ``.pxd`` files need not have corresponding ``.pyx``
modules if they contain purely declarations of external libraries. modules if they contain purely declarations of external libraries.
Remember that if you use setuptools instead of distutils, the default
action when running ``python setup.py install`` is to create a zipped
``egg`` file which will not work with ``cimport`` for ``pxd`` files
when you try to use them from a dependent package.
To prevent this, include ``zip_safe=False`` in the arguments to ``setup()``.
Integrating multiple modules Integrating multiple modules
============================ ============================
......
...@@ -263,3 +263,8 @@ Some things to note about this example: ...@@ -263,3 +263,8 @@ Some things to note about this example:
doesn't bind the name Shrubbing in Landscaping's module namespace at run doesn't bind the name Shrubbing in Landscaping's module namespace at run
time, so to access :func:`Shrubbing.standard_shrubbery` we also need to time, so to access :func:`Shrubbing.standard_shrubbery` we also need to
``import Shrubbing``. ``import Shrubbing``.
* One caveat if you use setuptools instead of distutils, the default
action when running ``python setup.py install`` is to create a zipped
``egg`` file which will not work with ``cimport`` for ``pxd`` files
when you try to use them from a dependent package.
To prevent this, include ``zip_safe=False`` in the arguments to ``setup()``.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment