diff --git a/.gitignore b/.gitignore index 982aedac9..56c038d00 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ +MANIFEST docs/_build build dist env +.tox hashindex.c chunker.c *.egg-info diff --git a/COPYING b/COPYING new file mode 100644 index 000000000..e9ff9e548 --- /dev/null +++ b/COPYING @@ -0,0 +1,28 @@ +Copyright (C) 2010-2013 Jonas Borgström +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The name of the author may not be used to endorse or promote + products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/darc/__init__.py b/darc/__init__.py index c37c5d939..f1b65e4c6 100644 --- a/darc/__init__.py +++ b/darc/__init__.py @@ -1,4 +1,3 @@ # This is a python package -__version__ = '0.5' -__release__ = __version__ + 'dev' +__version__ = '0.6dev' diff --git a/fake_pyrex/Pyrex/Distutils/__init__.py b/fake_pyrex/Pyrex/Distutils/__init__.py deleted file mode 100644 index c21916735..000000000 --- a/fake_pyrex/Pyrex/Distutils/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# This is a python package diff --git a/fake_pyrex/Pyrex/Distutils/build_ext.py b/fake_pyrex/Pyrex/Distutils/build_ext.py deleted file mode 100644 index 5a184acbc..000000000 --- a/fake_pyrex/Pyrex/Distutils/build_ext.py +++ /dev/null @@ -1,6 +0,0 @@ -from distutils.command.build_ext import build_ext -# -#def build_ext(*args, **kw): -# from distutils import build_ext as build_ext_orig -# return build_ext_orig(*args, **kw) - diff --git a/fake_pyrex/Pyrex/__init__.py b/fake_pyrex/Pyrex/__init__.py deleted file mode 100644 index c21916735..000000000 --- a/fake_pyrex/Pyrex/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# This is a python package diff --git a/fake_pyrex/README b/fake_pyrex/README deleted file mode 100644 index 3d7f7b021..000000000 --- a/fake_pyrex/README +++ /dev/null @@ -1 +0,0 @@ -This workaround is needed for setuptools to work properly with Cython when Pyrex isn't installed. \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 3c2fdf511..000000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[egg_info] -tag_build = dev diff --git a/setup.py b/setup.py index a403ec725..1f3c07ccb 100644 --- a/setup.py +++ b/setup.py @@ -10,14 +10,9 @@ if sys.version_info < min_python: print("Darc requires Python %d.%d or later" % min_python) sys.exit(1) -try: - import Cython - sys.path.insert(0, os.path.join(os.path.dirname(__file__), "fake_pyrex")) -except ImportError: - pass - -from distutils.core import setup -from distutils.extension import Extension +#from distutils.core import setup +#from distutils.extension import Extension +from setuptools import setup, Extension from distutils.command.sdist import sdist chunker_source = 'darc/chunker.pyx' @@ -35,27 +30,44 @@ try: sdist.__init__(self, *args, **kwargs) def make_distribution(self): - self.filelist += ['darc/chunker.c', 'darc/chunker.h', 'darc/hashindex.c', 'darc/hashindex.h'] - sdist.make_distribution(self) + self.filelist.extend(['darc/chunker.c', 'darc/_chunker.c', 'darc/hashindex.c', 'darc/_hashindex.c']) + super(Sdist, self).make_distribution() except ImportError: + class Sdist(sdist): + def __init__(self, *args, **kwargs): + raise Exception('Cython is required to run sdist') + chunker_source = chunker_source.replace('.pyx', '.c') hashindex_source = hashindex_source.replace('.pyx', '.c') from distutils.command.build_ext import build_ext - Sdist = sdist if not os.path.exists(chunker_source) or not os.path.exists(hashindex_source): raise ImportError('The GIT version of darc needs Cython. Install Cython or use a released version') -setup(name='darc', - 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}, - ext_modules=[ - Extension('darc.chunker', [chunker_source]), - Extension('darc.hashindex', [hashindex_source])], - scripts=['scripts/darc'], - ) - +setup( + name='Darc', + version=darc.__version__, + author='Jonas Borgström', + author_email='jonas@borgstrom.se', + url='http://github.com/jborg/darc/', + description='Deduplicating ARChiver written in Python', + license='BSD', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: Console', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: BSD License', + 'Operating System :: POSIX', + 'Programming Language :: Python', + 'Topic :: Security :: Cryptography', + 'Topic :: System :: Archiving :: Backup', + ], + packages=['darc'], + scripts=['scripts/darc'], + cmdclass={'build_ext': build_ext, 'sdist': Sdist}, + ext_modules=[ + Extension('darc.chunker', [chunker_source]), + Extension('darc.hashindex', [hashindex_source]) + ], + install_requires=['msgpack-python', 'pyxattr'] +) diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..a61dbb7a3 --- /dev/null +++ b/tox.ini @@ -0,0 +1,5 @@ +[tox] +envlist = py32, py33 + +[testenv] +commands = fakeroot {envpython} -m darc.test