2013-06-18 18:36:18 -07:00
#!/usr/bin/env python
2013-07-06 23:41:19 -07:00
try :
from Cython . Build import cythonize
import Cython
except ImportError :
raise RuntimeError ( ' No cython installed. Please run `pip install cython` ' )
if Cython . __version__ < ' 0.19.1 ' :
2013-08-26 10:08:34 -07:00
raise RuntimeError ( ' Old cython installed ( %s ). Please run `pip install -U cython` ' % Cython . __version__ )
import pkg_resources
setuptools_version = pkg_resources . get_distribution ( " setuptools " ) . version
if setuptools_version < ' 0.8 ' :
2013-11-05 15:37:51 -08:00
raise RuntimeError ( ' Old setuptools installed ( %s ). Please run `pip install -U setuptools`. Running `pip install pycapnp` will not work alone, since setuptools needs to be upgraded before installing anything else. ' % setuptools_version )
2013-07-06 23:41:19 -07:00
2013-06-18 18:36:18 -07:00
from distutils . core import setup
2013-07-07 00:12:15 -07:00
import os
2013-07-06 23:41:19 -07:00
MAJOR = 0
2013-11-05 15:37:51 -08:00
MINOR = 4
MICRO = 0
VERSION = ' %d . %d . %d -dev ' % ( MAJOR , MINOR , MICRO )
2013-07-06 23:41:19 -07:00
def write_version_py ( filename = None ) :
cnt = """ \
version = ' %s '
short_version = ' %s '
"""
if not filename :
filename = os . path . join (
os . path . dirname ( __file__ ) , ' capnp ' , ' version.py ' )
a = open ( filename , ' w ' )
try :
a . write ( cnt % ( VERSION , VERSION ) )
finally :
a . close ( )
2013-07-07 00:12:15 -07:00
write_version_py ( )
2013-08-12 12:39:35 -07:00
try :
import pypandoc
long_description = pypandoc . convert ( ' README.md ' , ' rst ' )
except ( IOError , ImportError ) :
long_description = ' '
2013-06-18 18:36:18 -07:00
setup (
2013-09-01 01:20:10 -07:00
name = " pycapnp " ,
2013-07-06 23:41:19 -07:00
packages = [ " capnp " ] ,
2013-08-12 11:56:44 -07:00
version = VERSION ,
2013-12-08 17:43:08 -08:00
package_data = { ' capnp ' : [ ' *.pxd ' , ' *.h ' , ' helpers/*.pxd ' , ' helpers/*.h ' , ' includes/*.pxd ' , ' lib/*.pxd ' , ' lib/*.py ' ] } ,
ext_modules = cythonize ( ' capnp/lib/*.pyx ' , language = " c++ " ) ,
2013-08-18 00:25:51 -07:00
install_requires = [
' cython > 0.19 ' ,
' setuptools >= 0.8 ' ] ,
2013-08-12 11:56:44 -07:00
# PyPi info
2013-11-05 15:37:51 -08:00
description = " A cython wrapping of the C++ Cap ' n Proto library " ,
2013-08-12 12:39:35 -07:00
long_description = long_description ,
2013-08-12 13:03:43 -07:00
license = ' BSD ' ,
2013-08-12 11:56:44 -07:00
author = " Jason Paryani " ,
author_email = " pypi-contact@jparyani.com " ,
2013-09-01 01:15:31 -07:00
url = ' https://github.com/jparyani/pycapnp ' ,
download_url = ' https://github.com/jparyani/pycapnp/archive/v %s .zip ' % VERSION ,
2013-09-01 02:13:19 -07:00
keywords = [ ' capnp ' , ' capnproto ' , " Cap ' n Proto " ] ,
2013-08-12 12:39:35 -07:00
classifiers = [
' Development Status :: 3 - Alpha ' ,
' Intended Audience :: Developers ' ,
' License :: OSI Approved :: BSD License ' ,
' Operating System :: MacOS :: MacOS X ' ,
' Operating System :: POSIX ' ,
2013-08-12 13:03:43 -07:00
' Programming Language :: C++ ' ,
' Programming Language :: Cython ' ,
2013-08-12 12:39:35 -07:00
' Programming Language :: Python :: 2 ' ,
2013-08-12 17:48:20 -07:00
' Programming Language :: Python :: 2.6 ' ,
2013-08-12 12:39:35 -07:00
' Programming Language :: Python :: 2.7 ' ,
' Programming Language :: Python :: 3 ' ,
2013-08-12 17:48:20 -07:00
' Programming Language :: Python :: 3.2 ' ,
2013-08-12 12:39:35 -07:00
' Programming Language :: Python :: 3.3 ' ,
2013-08-15 15:44:54 -07:00
' Programming Language :: Python :: Implementation :: PyPy ' ,
2013-08-12 12:39:35 -07:00
' Topic :: Communications ' ] ,
2013-07-06 16:53:00 -07:00
)