Source

hachoir / hachoir-regex / setup.py

#!/usr/bin/env python

# Todo list to prepare a release:
#  - set version in hachoir_regex/version.py
#  - set release date in the README file
#  - create a Mercurial tag
#  - push the Mercurial
#  - ./setup.py register sdist bdist_egg upload
#  - update the website
#    * http://bitbucket.org/haypo/hachoir/wiki/Install/source
#    * http://bitbucket.org/haypo/hachoir/wiki/Home
#
# After the release:
#  - set version to n+1
#  - add a new empty section in the changelog for version n+1


# Constants
AUTHORS = 'Victor Stinner'
DESCRIPTION = "Manipulation of regular expressions (regex)"
CLASSIFIERS = [
    'Development Status :: 5 - Production/Stable',
    'Intended Audience :: Developers',
    'Intended Audience :: Education',
    'License :: OSI Approved :: GNU General Public License (GPL)',
    'Natural Language :: English',
    'Operating System :: OS Independent',
    'Programming Language :: Python',
    'Topic :: Scientific/Engineering :: Information Analysis',
    'Topic :: Software Development :: Interpreters',
    'Topic :: Software Development :: Libraries :: Python Modules',
    'Topic :: Text Processing',
    'Topic :: Utilities',
]
PACKAGES = {"hachoir_regex": "hachoir_regex"}

from imp import load_source
from os import path
import sys

def main():
    if "--setuptools" in sys.argv:
        sys.argv.remove("--setuptools")
        from setuptools import setup
        use_setuptools = True
    else:
        from distutils.core import setup
        use_setuptools = False

    hachoir_regex = load_source("version", path.join("hachoir_regex", "version.py"))

    install_options = {
        "name": hachoir_regex.PACKAGE,
        "version": hachoir_regex.__version__,
        "url": hachoir_regex.WEBSITE,
        "download_url": hachoir_regex.WEBSITE,
        "license": hachoir_regex.LICENSE,
        "author": AUTHORS,
        "description": DESCRIPTION,
        "classifiers": CLASSIFIERS,
        "packages": PACKAGES.keys(),
        "package_dir": PACKAGES,
        "long_description": open('README').read(),
    }

    if use_setuptools:
        install_options["zip_safe"] = True

    # Call main() setup function
    setup(**install_options)

if __name__ == "__main__":
    main()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.