diff --git a/.gitignore b/.gitignore index 69478c95..021dc356 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ docs/_build build +dist env +hashindex.c *.egg-info *.pyc *.pyo diff --git a/darc/__init__.py b/darc/__init__.py index c2191673..c37c5d93 100644 --- a/darc/__init__.py +++ b/darc/__init__.py @@ -1 +1,4 @@ # This is a python package + +__version__ = '0.5' +__release__ = __version__ + 'dev' diff --git a/docs/conf.py b/docs/conf.py index 1cb31fa4..425d064a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,7 +11,7 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import sys, os, darc # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -48,9 +48,9 @@ copyright = u'2010-2011, Jonas Borgström' # built documents. # # The short X.Y version. -version = '0.1' +version = darc.__release__ # The full version, including alpha/beta/rc tags. -release = '0.1' +release = darc.__release__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..3c2fdf51 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[egg_info] +tag_build = dev diff --git a/setup.py b/setup.py index 25f4ef3f..285cbceb 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,16 @@ import os import sys from glob import glob +import darc + +min_python = (2, 5) +if sys.version_info < min_python: + print "Darc requires Python %d.%d or later" % min_python + sys.exit(1) + +if sys.version_info >= (3,): + print "Darc doesn't support Python 3 (yet)" + sys.exit(1) try: import Cython @@ -17,6 +27,7 @@ hashindex_sources = ['darc/hashindex.pyx', 'darc/_hashindex.c'] try: from Cython.Distutils import build_ext import Cython.Compiler.Main as cython_compiler + class Sdist(sdist): def __init__(self, *args, **kwargs): for src in glob('darc/*.pyx'): @@ -43,17 +54,17 @@ if sys.version_info < (2, 7): setup(name='darc', - version='0.1', + version=darc.__version__, author='Jonas Borgström', author_email='jonas@borgstrom.se', url='http://github.com/jborg/darc/', packages=['darc'], - cmdclass = {'build_ext': build_ext, 'sdist': Sdist}, + cmdclass={'build_ext': build_ext, 'sdist': Sdist}, ext_modules=[ Extension('darc._speedups', ['darc/_speedups.c']), Extension('darc.hashindex', hashindex_sources)], install_requires=dependencies, - entry_points = { + entry_points={ 'console_scripts': [ 'darc = darc.archiver:main', ]