Add requirements.txt and requirements-dev.txt (#172)
This commit is contained in:
parent
94e5b175d7
commit
dcc9e6772a
|
@ -12,11 +12,7 @@ matrix:
|
|||
allow_failures:
|
||||
- python: "nightly"
|
||||
install:
|
||||
- pip install --upgrade coveralls pytest "pytest-cov>=2.5.1" dataclasses typing_extensions
|
||||
# mypy can't be installed on pypy
|
||||
- if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* ]] ; then pip install mypy ; fi
|
||||
# Black is Python 3.6+-only
|
||||
- if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* ]] ; then pip install black ; fi
|
||||
- pip install --upgrade -r requirements.txt -r requirements-dev.txt
|
||||
script:
|
||||
- py.test -vv --cov=injector --cov-branch --cov-report html --cov-report term
|
||||
- if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* ]] ; then mypy injector ; fi
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
pytest
|
||||
coveralls
|
||||
pytest-cov>=2.5.1
|
||||
dataclasses;python_version<"3.7"
|
||||
mypy;implementation_name=="cpython"
|
||||
black;implementation_name=="cpython"
|
|
@ -0,0 +1 @@
|
|||
typing_extensions>=3.7.4;python_version<"3.9"
|
15
setup.py
15
setup.py
|
@ -6,6 +6,13 @@ import warnings
|
|||
warnings.filterwarnings("always", module=__name__)
|
||||
|
||||
|
||||
def obtain_requirements(file_name):
|
||||
with open(file_name) as fd_in:
|
||||
for line in fd_in:
|
||||
if '#' not in line:
|
||||
yield line.strip()
|
||||
|
||||
|
||||
class PyTest(Command):
|
||||
user_options = []
|
||||
|
||||
|
@ -34,6 +41,11 @@ def read_injector_variable(name):
|
|||
version = read_injector_variable('__version__')
|
||||
version_tag = read_injector_variable('__version_tag__')
|
||||
|
||||
|
||||
requirements = list(obtain_requirements('requirements.txt'))
|
||||
requirements_dev = list(obtain_requirements('requirements-dev.txt'))
|
||||
|
||||
|
||||
try:
|
||||
import pypandoc
|
||||
|
||||
|
@ -61,6 +73,7 @@ setup(
|
|||
author='Alec Thomas',
|
||||
author_email='alec@swapoff.org',
|
||||
cmdclass={'test': PyTest},
|
||||
extras_require={'dev': requirements_dev},
|
||||
keywords=[
|
||||
'Dependency Injection',
|
||||
'DI',
|
||||
|
@ -69,5 +82,5 @@ setup(
|
|||
'IoC',
|
||||
'Inversion of Control container',
|
||||
],
|
||||
install_requires=['typing_extensions>=3.7.4;python_version<"3.9"'],
|
||||
install_requires=requirements,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue