text: #!/usr/bin/env python
  # -*- coding: utf-8 -*-
  
  import os
  import sys
  
  
  try:
      from setuptools import setup
  except ImportError:
      from distutils.core import setup
  
  from setuptools.command.test import test as TestCommand
  
  if sys.argv[-1] == 'publish':
      os.system('python setup.py sdist upload')
      sys.exit()
  
  readme = open('README.rst').read()
  history = open('HISTORY.rst').read().replace('.. :changelog:', '')
  
  class PyTest(TestCommand):
      def finalize_options(self):
          TestCommand.finalize_options(self)
          self.test_args = []
          self.test_suite = True
  
      def run_tests(self):
          import pytest
          errcode = pytest.main(self.test_args)
          sys.exit(errcode)
  
  setup(
      name='dictregister',
      version='1.0.0',
      description='A searchable list of dictionaries',
      long_description=readme + '\n\n' + history,
      author='Leonardo Giordani',
      author_email='giordani.leonardo@gmail.com',
      url='https://github.com/lgiordani/dictregister',
      packages=[
          'dictregister',
      ],
      package_dir={'dictregister': 'dictregister'},
      include_package_data=True,
      install_requires=[
      ],
      license="BSD",
      zip_safe=False,
      keywords='dictregister',
      classifiers=[
          'Development Status :: 5 - Production/Stable',
          'Intended Audience :: Developers',
          'License :: OSI Approved :: BSD License',
          'Natural Language :: English',
          "Programming Language :: Python :: 2",
          'Programming Language :: Python :: 2.6',
          'Programming Language :: Python :: 2.7',
          'Programming Language :: Python :: 3',
          'Programming Language :: Python :: 3.3',
      ],
      tests_require=['pytest'],
      cmdclass={'test': PyTest},
  )
  