Add requirements.txt and requirements-dev.txt (#172)
This commit is contained in:
parent
94e5b175d7
commit
dcc9e6772a
|
@ -12,11 +12,7 @@ matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- python: "nightly"
|
- python: "nightly"
|
||||||
install:
|
install:
|
||||||
- pip install --upgrade coveralls pytest "pytest-cov>=2.5.1" dataclasses typing_extensions
|
- pip install --upgrade -r requirements.txt -r requirements-dev.txt
|
||||||
# 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
|
|
||||||
script:
|
script:
|
||||||
- py.test -vv --cov=injector --cov-branch --cov-report html --cov-report term
|
- py.test -vv --cov=injector --cov-branch --cov-report html --cov-report term
|
||||||
- if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* ]] ; then mypy injector ; fi
|
- 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__)
|
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):
|
class PyTest(Command):
|
||||||
user_options = []
|
user_options = []
|
||||||
|
|
||||||
|
@ -34,6 +41,11 @@ def read_injector_variable(name):
|
||||||
version = read_injector_variable('__version__')
|
version = read_injector_variable('__version__')
|
||||||
version_tag = read_injector_variable('__version_tag__')
|
version_tag = read_injector_variable('__version_tag__')
|
||||||
|
|
||||||
|
|
||||||
|
requirements = list(obtain_requirements('requirements.txt'))
|
||||||
|
requirements_dev = list(obtain_requirements('requirements-dev.txt'))
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import pypandoc
|
import pypandoc
|
||||||
|
|
||||||
|
@ -61,6 +73,7 @@ setup(
|
||||||
author='Alec Thomas',
|
author='Alec Thomas',
|
||||||
author_email='alec@swapoff.org',
|
author_email='alec@swapoff.org',
|
||||||
cmdclass={'test': PyTest},
|
cmdclass={'test': PyTest},
|
||||||
|
extras_require={'dev': requirements_dev},
|
||||||
keywords=[
|
keywords=[
|
||||||
'Dependency Injection',
|
'Dependency Injection',
|
||||||
'DI',
|
'DI',
|
||||||
|
@ -69,5 +82,5 @@ setup(
|
||||||
'IoC',
|
'IoC',
|
||||||
'Inversion of Control container',
|
'Inversion of Control container',
|
||||||
],
|
],
|
||||||
install_requires=['typing_extensions>=3.7.4;python_version<"3.9"'],
|
install_requires=requirements,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue