/ setup.py
setup.py
  1  import codecs
  2  import os
  3  import re
  4  import sys
  5  
  6  from setuptools import setup
  7  from setuptools import find_packages
  8  
  9  # Workaround for http://bugs.python.org/issue8876, see
 10  # http://bugs.python.org/issue8876#msg208792
 11  # This can be removed when using Python 2.7.9 or later:
 12  # https://hg.python.org/cpython/raw-file/v2.7.9/Misc/NEWS
 13  if os.path.abspath(__file__).split(os.path.sep)[1] == 'vagrant':
 14      del os.link
 15  
 16  
 17  def read_file(filename, encoding='utf8'):
 18      """Read unicode from given file."""
 19      with codecs.open(filename, encoding=encoding) as fd:
 20          return fd.read()
 21  
 22  
 23  here = os.path.abspath(os.path.dirname(__file__))
 24  
 25  # read version number (and other metadata) from package init
 26  init_fn = os.path.join(here, 'letsencrypt', '__init__.py')
 27  meta = dict(re.findall(r"""__([a-z]+)__ = '([^']+)""", read_file(init_fn)))
 28  
 29  readme = read_file(os.path.join(here, 'README.rst'))
 30  changes = read_file(os.path.join(here, 'CHANGES.rst'))
 31  version = meta['version']
 32  
 33  install_requires = [
 34      'acme=={0}'.format(version),
 35      'ConfigArgParse',
 36      'configobj',
 37      'cryptography>=0.7',  # load_pem_x509_certificate
 38      'parsedatetime',
 39      'psutil>=2.1.0',  # net_connections introduced in 2.1.0
 40      'PyOpenSSL',
 41      'pyrfc3339',
 42      'python2-pythondialog>=3.2.2rc1',  # Debian squeeze support, cf. #280
 43      'pytz',
 44      'requests',
 45      'setuptools',  # pkg_resources
 46      'six',
 47      'zope.component',
 48      'zope.interface',
 49  ]
 50  
 51  # env markers in extras_require cause problems with older pip: #517
 52  if sys.version_info < (2, 7):
 53      install_requires.extend([
 54          # only some distros recognize stdlib argparse as already satisfying
 55          'argparse',
 56          'mock<1.1.0',
 57      ])
 58  else:
 59      install_requires.append('mock')
 60  
 61  dev_extras = [
 62      # Pin astroid==1.3.5, pylint==1.4.2 as a workaround for #289
 63      'astroid==1.3.5',
 64      'pylint==1.4.2',  # upstream #248
 65      'twine',
 66      'wheel',
 67  ]
 68  
 69  docs_extras = [
 70      'repoze.sphinx.autointerface',
 71      'Sphinx>=1.0',  # autodoc_member_order = 'bysource', autodoc_default_flags
 72      'sphinx_rtd_theme',
 73      'sphinxcontrib-programoutput',
 74  ]
 75  
 76  testing_extras = [
 77      'coverage',
 78      'nose',
 79      'nosexcover',
 80      'pep8',
 81      'tox',
 82  ]
 83  
 84  setup(
 85      name='letsencrypt',
 86      version=version,
 87      description="Let's Encrypt client",
 88      long_description=readme,  # later: + '\n\n' + changes
 89      url='https://github.com/letsencrypt/letsencrypt',
 90      author="Let's Encrypt Project",
 91      author_email='client-dev@letsencrypt.org',
 92      license='Apache License 2.0',
 93      classifiers=[
 94          'Development Status :: 3 - Alpha',
 95          'Environment :: Console',
 96          'Environment :: Console :: Curses',
 97          'Intended Audience :: System Administrators',
 98          'License :: OSI Approved :: Apache Software License',
 99          'Operating System :: POSIX :: Linux',
100          'Programming Language :: Python',
101          'Programming Language :: Python :: 2',
102          'Programming Language :: Python :: 2.6',
103          'Programming Language :: Python :: 2.7',
104          'Topic :: Internet :: WWW/HTTP',
105          'Topic :: Security',
106          'Topic :: System :: Installation/Setup',
107          'Topic :: System :: Networking',
108          'Topic :: System :: Systems Administration',
109          'Topic :: Utilities',
110      ],
111  
112      packages=find_packages(exclude=['docs', 'examples', 'tests', 'venv']),
113      include_package_data=True,
114  
115      install_requires=install_requires,
116      extras_require={
117          'dev': dev_extras,
118          'docs': docs_extras,
119          'testing': testing_extras,
120      },
121  
122      tests_require=install_requires,
123      # to test all packages run "python setup.py test -s
124      # {acme,letsencrypt_apache,letsencrypt_nginx}"
125      test_suite='letsencrypt',
126  
127      entry_points={
128          'console_scripts': [
129              'letsencrypt = letsencrypt.cli:main',
130              'letsencrypt-renewer = letsencrypt.renewer:main',
131          ],
132          'letsencrypt.plugins': [
133              'manual = letsencrypt.plugins.manual:Authenticator',
134              'null = letsencrypt.plugins.null:Installer',
135              'standalone = letsencrypt.plugins.standalone:Authenticator',
136              'webroot = letsencrypt.plugins.webroot:Authenticator',
137          ],
138      },
139  )