2014-11-09 19:56:50 +08:00
|
|
|
#!/usr/bin/env python
|
2014-07-24 23:38:42 +08:00
|
|
|
"""pytest-bdd package config."""
|
2014-11-09 19:56:50 +08:00
|
|
|
|
2014-06-11 03:58:24 +08:00
|
|
|
import codecs
|
2013-08-10 09:32:25 +08:00
|
|
|
import os
|
2015-06-16 04:34:53 +08:00
|
|
|
import re
|
2013-05-01 20:03:28 +08:00
|
|
|
import sys
|
2013-04-03 13:57:31 +08:00
|
|
|
|
2013-05-01 20:03:28 +08:00
|
|
|
from setuptools import setup
|
|
|
|
from setuptools.command.test import test as TestCommand
|
2013-04-03 13:57:31 +08:00
|
|
|
|
|
|
|
|
2015-01-06 17:57:11 +08:00
|
|
|
class ToxTestCommand(TestCommand):
|
2014-07-24 23:38:42 +08:00
|
|
|
|
2015-01-06 17:57:11 +08:00
|
|
|
"""Test command which runs tox under the hood."""
|
|
|
|
|
|
|
|
user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
|
|
|
|
|
|
|
|
def initialize_options(self):
|
|
|
|
"""Initialize options and set their defaults."""
|
|
|
|
TestCommand.initialize_options(self)
|
|
|
|
self.tox_args = '--recreate'
|
2014-07-24 23:38:42 +08:00
|
|
|
|
2013-04-03 13:57:31 +08:00
|
|
|
def finalize_options(self):
|
2015-01-06 17:57:11 +08:00
|
|
|
"""Add options to the test runner (tox)."""
|
2013-05-01 20:03:28 +08:00
|
|
|
TestCommand.finalize_options(self)
|
2015-01-06 17:57:11 +08:00
|
|
|
self.test_args = []
|
2013-05-01 20:03:28 +08:00
|
|
|
self.test_suite = True
|
2013-04-03 13:57:31 +08:00
|
|
|
|
2013-05-01 20:03:28 +08:00
|
|
|
def run_tests(self):
|
2015-01-06 17:57:11 +08:00
|
|
|
"""Invoke the test runner (tox)."""
|
|
|
|
# import here, cause outside the eggs aren't loaded
|
|
|
|
import tox
|
|
|
|
import shlex
|
|
|
|
errno = tox.cmdline(args=shlex.split(self.tox_args))
|
2013-05-01 20:03:28 +08:00
|
|
|
sys.exit(errno)
|
2013-03-31 09:03:40 +08:00
|
|
|
|
2013-08-17 23:57:33 +08:00
|
|
|
|
|
|
|
dirname = os.path.dirname(__file__)
|
|
|
|
|
|
|
|
long_description = (
|
2014-11-09 19:56:50 +08:00
|
|
|
codecs.open(os.path.join(dirname, "README.rst"), encoding="utf-8").read() + "\n" +
|
2015-01-18 04:24:14 +08:00
|
|
|
codecs.open(os.path.join(dirname, "AUTHORS.rst"), encoding="utf-8").read() + "\n" +
|
|
|
|
codecs.open(os.path.join(dirname, "CHANGES.rst"), encoding="utf-8").read()
|
2013-08-17 23:57:33 +08:00
|
|
|
)
|
2013-03-31 09:03:40 +08:00
|
|
|
|
2015-06-16 04:34:53 +08:00
|
|
|
with codecs.open(os.path.join(dirname, 'pytest_bdd', '__init__.py'), encoding='utf-8') as fd:
|
|
|
|
VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(fd.read()).group(1)
|
|
|
|
|
2013-03-31 09:03:40 +08:00
|
|
|
setup(
|
2014-11-09 19:56:50 +08:00
|
|
|
name="pytest-bdd",
|
|
|
|
description="BDD for pytest",
|
2013-08-17 23:57:33 +08:00
|
|
|
long_description=long_description,
|
2014-12-10 06:16:52 +08:00
|
|
|
author="Oleg Pidsadnyi, Anatoly Bubenkov and others",
|
2014-11-09 19:56:50 +08:00
|
|
|
license="MIT license",
|
|
|
|
author_email="oleg.pidsadnyi@gmail.com",
|
2015-03-01 19:44:43 +08:00
|
|
|
url="https://github.com/pytest-dev/pytest-bdd",
|
2015-06-16 04:34:53 +08:00
|
|
|
version=VERSION,
|
2013-06-16 21:52:20 +08:00
|
|
|
classifiers=[
|
2014-11-09 19:56:50 +08:00
|
|
|
"Development Status :: 6 - Mature",
|
|
|
|
"Intended Audience :: Developers",
|
|
|
|
"License :: OSI Approved :: MIT License",
|
|
|
|
"Operating System :: POSIX",
|
|
|
|
"Operating System :: Microsoft :: Windows",
|
|
|
|
"Operating System :: MacOS :: MacOS X",
|
|
|
|
"Topic :: Software Development :: Testing",
|
|
|
|
"Topic :: Software Development :: Libraries",
|
|
|
|
"Topic :: Utilities",
|
|
|
|
"Programming Language :: Python :: 2",
|
|
|
|
"Programming Language :: Python :: 3"
|
2015-08-04 21:49:05 +08:00
|
|
|
] + [("Programming Language :: Python :: %s" % x) for x in "2.7 3.0 3.1 3.2 3.3 3.4".split()],
|
2015-01-06 17:57:11 +08:00
|
|
|
cmdclass={"test": ToxTestCommand},
|
2013-03-31 09:03:40 +08:00
|
|
|
install_requires=[
|
2014-11-09 19:56:50 +08:00
|
|
|
"glob2",
|
|
|
|
"Mako",
|
2015-01-07 01:16:23 +08:00
|
|
|
"parse",
|
|
|
|
"parse_type",
|
|
|
|
"pytest>=2.6.0",
|
2015-06-16 04:18:26 +08:00
|
|
|
"six>=1.9.0",
|
2013-03-31 09:03:40 +08:00
|
|
|
],
|
2013-05-28 23:11:47 +08:00
|
|
|
# the following makes a plugin available to py.test
|
2013-06-16 21:52:20 +08:00
|
|
|
entry_points={
|
2014-11-09 19:56:50 +08:00
|
|
|
"pytest11": [
|
|
|
|
"pytest-bdd = pytest_bdd.plugin",
|
2014-03-14 20:20:43 +08:00
|
|
|
],
|
2014-11-09 19:56:50 +08:00
|
|
|
"console_scripts": [
|
|
|
|
"pytest-bdd = pytest_bdd.scripts:main",
|
2013-05-28 23:11:47 +08:00
|
|
|
]
|
|
|
|
},
|
2015-01-06 17:57:11 +08:00
|
|
|
tests_require=["tox"],
|
2014-11-09 19:56:50 +08:00
|
|
|
packages=["pytest_bdd"],
|
2014-09-18 11:30:51 +08:00
|
|
|
include_package_data=True,
|
2013-03-31 09:03:40 +08:00
|
|
|
)
|