Skip to content

Commit

Permalink
Add requirements.txt and requirements-dev.txt (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
GregEremeev committed Jan 6, 2021
1 parent 94e5b17 commit dcc9e67
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions requirements-dev.txt
@@ -0,0 +1,6 @@
pytest
coveralls
pytest-cov>=2.5.1
dataclasses;python_version<"3.7"
mypy;implementation_name=="cpython"
black;implementation_name=="cpython"
1 change: 1 addition & 0 deletions requirements.txt
@@ -0,0 +1 @@
typing_extensions>=3.7.4;python_version<"3.9"
15 changes: 14 additions & 1 deletion setup.py
Expand Up @@ -6,6 +6,13 @@
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 = []

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -61,6 +73,7 @@ def read_injector_variable(name):
author='Alec Thomas',
author_email='alec@swapoff.org',
cmdclass={'test': PyTest},
extras_require={'dev': requirements_dev},
keywords=[
'Dependency Injection',
'DI',
Expand All @@ -69,5 +82,5 @@ def read_injector_variable(name):
'IoC',
'Inversion of Control container',
],
install_requires=['typing_extensions>=3.7.4;python_version<"3.9"'],
install_requires=requirements,
)

0 comments on commit dcc9e67

Please sign in to comment.