From cd0921886caef6ae95047c0ec1ad6fb5d23b0267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Sat, 8 Jul 2017 16:41:12 +0300 Subject: [PATCH] Packaging and testing cleanups --- .travis.yml | 6 ++---- setup.cfg | 12 +++++++++++- setup.py | 27 +++++++++++---------------- test_requirements.txt | 3 --- tox.ini | 10 +++------- 5 files changed, 27 insertions(+), 31 deletions(-) delete mode 100644 test_requirements.txt diff --git a/.travis.yml b/.travis.yml index 3a043bd0..3b932d4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,8 @@ python: - "3.5" - "3.6" -install: - - pip install tox tox-travis +install: pip install tox-travis coveralls script: tox -after_success: - - pip install coveralls && cd tests && coveralls +after_success: coveralls diff --git a/setup.cfg b/setup.cfg index 96706d37..7c1c3f96 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,13 @@ +[coverage:run] +source = pytest_asyncio + +[coverage:report] +show_missing = true + +[tool:pytest] +addopts = -rsx --tb=short --cov +testpaths = tests + [metadata] # ensure LICENSE is included in wheel metadata -license_file = LICENSE \ No newline at end of file +license_file = LICENSE diff --git a/setup.py b/setup.py index 6cdade78..3fabfe72 100644 --- a/setup.py +++ b/setup.py @@ -1,19 +1,11 @@ -import codecs -import os import re -from setuptools import setup, find_packages - -with open('README.rst') as f: - readme = f.read() - +from pathlib import Path -def read(*parts): - here = os.path.abspath(os.path.dirname(__file__)) - return codecs.open(os.path.join(here, *parts), 'r').read() +from setuptools import setup, find_packages -def find_version(*file_paths): - version_file = read(*file_paths) +def find_version(): + version_file = Path(__file__).parent.joinpath('pytest_asyncio', '__init__.py').read_text() version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M) if version_match: @@ -21,16 +13,17 @@ def find_version(*file_paths): raise RuntimeError("Unable to find version string.") + setup( name='pytest-asyncio', - version=find_version('pytest_asyncio', '__init__.py'), + version=find_version(), packages=find_packages(), url='https://github.com/pytest-dev/pytest-asyncio', license='Apache 2.0', - author='Tin Tvrtkovic', + author='Tin Tvrtković', author_email='tinchester@gmail.com', description='Pytest support for asyncio.', - long_description=readme, + long_description=Path(__file__).parent.joinpath('README.rst').read_text(), classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Developers", @@ -40,11 +33,13 @@ def find_version(*file_paths): "Topic :: Software Development :: Testing", "Framework :: Pytest", ], + python_requires='>= 3.5', install_requires=[ 'pytest >= 3.0.6', ], extras_require={ - ':python_version == "3.5"': 'async_generator >= 1.3' + ':python_version == "3.5"': 'async_generator >= 1.3', + 'testing': ['pytest-cov', 'async_generator >= 1.3'], }, entry_points={ 'pytest11': ['asyncio = pytest_asyncio.plugin'], diff --git a/test_requirements.txt b/test_requirements.txt deleted file mode 100644 index e2f0b366..00000000 --- a/test_requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -coverage==4.1 -tox==2.5.0 -async_generator==1.8 \ No newline at end of file diff --git a/tox.ini b/tox.ini index 0ebcc6e1..f2508fef 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,7 @@ [tox] envlist = py35, py36 +minversion = 2.5.0 [testenv] -deps = - pip >= 6 - -rtest_requirements.txt -commands = - coverage run --source pytest_asyncio -m py.test - coverage report -changedir = tests +extras = testing +commands = python -m pytest {posargs}