|
2 | 2 | # All changes will be overwritten. |
3 | 3 |
|
4 | 4 | from setuptools import setup, find_packages |
| 5 | +from codecs import open |
| 6 | +from os import path |
| 7 | + |
| 8 | +here = path.abspath(path.dirname(__file__)) |
| 9 | + |
| 10 | +# Py3 compatibility hacks, borrowed from IPython. |
| 11 | +try: |
| 12 | + execfile |
| 13 | +except NameError: |
| 14 | + |
| 15 | + def execfile(fname, globs, locs=None): |
| 16 | + locs = locs or globs |
| 17 | + exec(compile(open(fname).read(), fname, "exec"), globs, locs) |
5 | 18 |
|
6 | | -tolines = lambda c: list(filter(None, map(lambda s: s.strip(), c.split('\n')))) |
7 | 19 |
|
8 | | -def read(filename, flt=None): |
9 | | - with open(filename) as f: |
10 | | - content = f.read().strip() |
11 | | - return flt(content) if callable(flt) else content |
| 20 | +# Get the long description from the README file |
| 21 | +try: |
| 22 | + with open(path.join(here, 'README.rst'), encoding='utf-8') as f: |
| 23 | + long_description = f.read() |
| 24 | +except: |
| 25 | + long_description = '' |
| 26 | + |
| 27 | +# Get the classifiers from the classifiers file |
| 28 | +tolines = lambda c: list(filter(None, map(lambda s: s.strip(), c.split('\n')))) |
| 29 | +try: |
| 30 | + with open(path.join(here, 'classifiers.txt'), encoding='utf-8') as f: |
| 31 | + classifiers = tolines(f.read()) |
| 32 | +except: |
| 33 | + classifiers = [] |
12 | 34 |
|
| 35 | +version_ns = {} |
13 | 36 | try: |
14 | | - version = read('version.txt') |
15 | | -except: # pylint: disable=bare-except |
| 37 | + execfile(path.join(here, 'bonobo_selenium/_version.py'), version_ns) |
| 38 | +except EnvironmentError: |
16 | 39 | version = 'dev' |
| 40 | +else: |
| 41 | + version = version_ns.get('__version__', 'dev') |
17 | 42 |
|
18 | 43 | setup( |
19 | | - name = 'bonobo_selenium', |
20 | | - description = 'Bonobo Selenium Extension', |
21 | | - license = 'Apache License, Version 2.0', |
22 | | - install_requires = ['bonobo', 'selenium >=3.0.2,<3.1'], |
23 | | - version = version, |
24 | | - long_description = read('README.rst'), |
25 | | - classifiers = read('classifiers.txt', tolines), |
26 | | - packages = find_packages(exclude=['ez_setup', 'example', 'test']), |
27 | | - include_package_data = True, |
28 | | - extras_require = {'dev': ['coverage >=4.2,<4.3', |
29 | | - 'mock >=2.0,<2.1', |
30 | | - 'nose >=1.3,<1.4', |
31 | | - 'pylint >=1.6,<1.7', |
32 | | - 'pytest >=3,<4', |
33 | | - 'pytest-cov >=2.4,<2.5', |
34 | | - 'sphinx', |
35 | | - 'sphinx_rtd_theme', |
36 | | - 'yapf']}, |
37 | | - url = 'https://bonobo-project.org/', |
38 | | - download_url = 'https://github.com/python-bonobo/bonobo-selenium/tarball/{version}'.format(version=version), |
39 | | -) |
| 44 | + author='Romain Dorgueil', |
| 45 | + author_email='romain@dorgueil.net', |
| 46 | + description='Bonobo Selenium Extension', |
| 47 | + license='Apache License, Version 2.0', |
| 48 | + name='bonobo_selenium', |
| 49 | + version=version, |
| 50 | + long_description=long_description, |
| 51 | + classifiers=classifiers, |
| 52 | + packages=find_packages(exclude=['ez_setup', 'example', 'test']), |
| 53 | + include_package_data=True, |
| 54 | + install_requires=['bonobo (>= 0.4, < 0.5)', 'selenium (>= 3.4, < 3.5)'], |
| 55 | + extras_require={ |
| 56 | + 'dev': |
| 57 | + ['bonobo (>= 0.4, < 0.5)', 'coverage (>= 4.4, < 5.0)', 'pytest (>= 3.1, < 4.0)', 'pytest-cov (>= 2.5, < 3.0)'] |
| 58 | + }, |
| 59 | + url='https://bonobo-project.org/with/selenium', |
| 60 | + download_url='https://github.com/python-bonobo/bonobo-selenium/tarball/{version}'.format(version=version), ) |
0 commit comments