Properly configure unit tests

This commit is contained in:
Lucidiot 2019-07-06 15:40:59 +02:00
parent 60ad48c95e
commit 62230b0c18
No known key found for this signature in database
GPG Key ID: AE3F7205692FA205
4 changed files with 19 additions and 10 deletions

2
.coveragerc Normal file
View File

@ -0,0 +1,2 @@
[run]
include=pylspci/*

View File

@ -17,13 +17,13 @@ before_script:
- source venv/bin/activate
- pip install .[dev]
# tests:
# stage: test
# coverage: '/TOTAL[\s\d]+\s(\d+%)/'
# script:
# - coverage run setup.py test
# - coverage report
# - codecov
tests:
stage: test
coverage: '/TOTAL[\s\d]+\s(\d+%)/'
script:
- coverage run setup.py test
- coverage report
- codecov
flake8:
stage: test

View File

View File

@ -1,11 +1,16 @@
#!/usr/bin/env python3
from setuptools import setup, find_packages
from typing import List
def read_requirements(filename):
def read_requirements(filename: str) -> List[str]:
return [req.strip() for req in open(filename)]
# requirements = read_requirements('requirements.txt')
requirements = None
dev_requirements = read_requirements('requirements-dev.txt')
setup(
name='pylspci',
version=open('VERSION').read().strip(),
@ -17,10 +22,12 @@ setup(
'': ['*.md', 'LICENSE', 'README'],
},
python_requires='>=3.5',
install_requires=read_requirements('requirements.txt'),
install_requires=None,
extras_require={
'dev': read_requirements('requirements-dev.txt'),
'dev': dev_requirements,
},
tests_require=dev_requirements,
test_suite='pylspci.tests',
license='GNU General Public License 3',
description="Simple parser for lspci -mmnn.",
long_description=open('README.rst').read(),