Skip to content

Instantly share code, notes, and snippets.

View dcreager's full-sized avatar

Douglas Creager dcreager

View GitHub Profile
@dcreager
dcreager / cython_zmq_setup.py
Created September 1, 2010 15:40
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:
@dcreager
dcreager / version.py
Created February 10, 2010 20:30
Extract a setuptools version from the git repository
# -*- coding: utf-8 -*-
# Author: Douglas Creager <[email protected]>
# This file is placed into the public domain.
# Calculates the current version number. If possible, this is the
# output of “git describe”, modified to conform to the versioning
# scheme that setuptools uses. If “git describe” returns an error
# (most likely because we're in an unpacked copy of a release tarball,
# rather than in a git working copy), then we fall back on reading the
# contents of the RELEASE-VERSION file.