diff --git a/README.md b/README.md index 8e029921..0fec8a5e 100644 --- a/README.md +++ b/README.md @@ -45,14 +45,21 @@ in the file. ## Installation -1. Make sure you have [cython](http://cython.org/) installed. +1. Make sure you have [cython](http://cython.org/) installed. -2. Compile the python extension: + +2. Install into your Python environment: + ```sh + pip install git+https://github.com/pauldmccarthy/indexed_gzip.git + ``` + + +3. Or, if you don't want to install, compile the python extension: ```sh python setup.py build_ext --inplace ``` -3. Put the `indexed_gzip` directory on your `$PYTHONPATH`. + And put the `indexed_gzip` directory on your `$PYTHONPATH`. ## Usage diff --git a/setup.py b/setup.py index 79c79fb9..a8304163 100644 --- a/setup.py +++ b/setup.py @@ -5,15 +5,28 @@ from Cython.Build import cythonize -# TODO -# if Cython present: -# build indexed_gzip.pyx -# -# else: -# build pre-generated indexed_gzip.c -# +import indexed_gzip as igzip setup( + name='indexed_gzip', + version=str(igzip.__version__), + author='Paul McCarthy', + author_email='pauldmccarthy@gmail.com', + description='Fast random access of gzip files in Python', + url='https://github.com/pauldmccarthy/indexed_gzip', + license='zlib', + + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: zlib/libpng License', + 'Programming Language :: C', + 'Programming Language :: Cython', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', + 'Topic :: System :: Archiving :: Compression', + ], + ext_modules=cythonize([ Extension('indexed_gzip', ['indexed_gzip.pyx', 'zran.c'], @@ -26,6 +39,7 @@ include_dirs=['.'], extra_compile_args=['-Wno-unused-function']) ]), + setup_requires=['pytest-runner'], tests_require=['pytest', 'numpy'], test_suite='tests',