Skip to content

Instantly share code, notes, and snippets.

@dcreager
Created September 1, 2010 15:40
Show Gist options
  • Save dcreager/560882 to your computer and use it in GitHub Desktop.
Save dcreager/560882 to your computer and use it in GitHub Desktop.
setup.py snippet for accessing pyzmq's Cython interface
# Check that ZMQ is installed at compile-time. If it is, update our
# Cython include path to find the pyzmq .pxd files. If not, print out
# a warning.
cython_include_path = []
try:
import zmq
cython_include_path.append(zmq.include_dir())
except ImportError:
print "WARNING!"
print "We need the pyzmq package installed at compile time in order"
print "to build this package."
@dcreager
Copy link
Author

dcreager commented Sep 1, 2010

If you need to access pyzmq's .pxd files, add the above snippet to your setup.py file, and add

Extension(
  ...
  include_dirs=cython_include_path,
)

to all of your Extension modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment