Skip to content

Commit cd09218

Browse files
committed
Packaging and testing cleanups
1 parent 96f931a commit cd09218

File tree

5 files changed

+27
-31
lines changed

5 files changed

+27
-31
lines changed

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ python:
33
- "3.5"
44
- "3.6"
55

6-
install:
7-
- pip install tox tox-travis
6+
install: pip install tox-travis coveralls
87

98
script: tox
109

11-
after_success:
12-
- pip install coveralls && cd tests && coveralls
10+
after_success: coveralls

setup.cfg

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
[coverage:run]
2+
source = pytest_asyncio
3+
4+
[coverage:report]
5+
show_missing = true
6+
7+
[tool:pytest]
8+
addopts = -rsx --tb=short --cov
9+
testpaths = tests
10+
111
[metadata]
212
# ensure LICENSE is included in wheel metadata
3-
license_file = LICENSE
13+
license_file = LICENSE

setup.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,29 @@
1-
import codecs
2-
import os
31
import re
4-
from setuptools import setup, find_packages
5-
6-
with open('README.rst') as f:
7-
readme = f.read()
8-
2+
from pathlib import Path
93

10-
def read(*parts):
11-
here = os.path.abspath(os.path.dirname(__file__))
12-
return codecs.open(os.path.join(here, *parts), 'r').read()
4+
from setuptools import setup, find_packages
135

146

15-
def find_version(*file_paths):
16-
version_file = read(*file_paths)
7+
def find_version():
8+
version_file = Path(__file__).parent.joinpath('pytest_asyncio', '__init__.py').read_text()
179
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
1810
version_file, re.M)
1911
if version_match:
2012
return version_match.group(1)
2113

2214
raise RuntimeError("Unable to find version string.")
2315

16+
2417
setup(
2518
name='pytest-asyncio',
26-
version=find_version('pytest_asyncio', '__init__.py'),
19+
version=find_version(),
2720
packages=find_packages(),
2821
url='https://github.com/pytest-dev/pytest-asyncio',
2922
license='Apache 2.0',
30-
author='Tin Tvrtkovic',
23+
author='Tin Tvrtković',
3124
author_email='tinchester@gmail.com',
3225
description='Pytest support for asyncio.',
33-
long_description=readme,
26+
long_description=Path(__file__).parent.joinpath('README.rst').read_text(),
3427
classifiers=[
3528
"Development Status :: 4 - Beta",
3629
"Intended Audience :: Developers",
@@ -40,11 +33,13 @@ def find_version(*file_paths):
4033
"Topic :: Software Development :: Testing",
4134
"Framework :: Pytest",
4235
],
36+
python_requires='>= 3.5',
4337
install_requires=[
4438
'pytest >= 3.0.6',
4539
],
4640
extras_require={
47-
':python_version == "3.5"': 'async_generator >= 1.3'
41+
':python_version == "3.5"': 'async_generator >= 1.3',
42+
'testing': ['pytest-cov', 'async_generator >= 1.3'],
4843
},
4944
entry_points={
5045
'pytest11': ['asyncio = pytest_asyncio.plugin'],

test_requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

tox.ini

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
[tox]
22
envlist = py35, py36
3+
minversion = 2.5.0
34

45
[testenv]
5-
deps =
6-
pip >= 6
7-
-rtest_requirements.txt
8-
commands =
9-
coverage run --source pytest_asyncio -m py.test
10-
coverage report
11-
changedir = tests
6+
extras = testing
7+
commands = python -m pytest {posargs}

0 commit comments

Comments
 (0)