Skip to content

Commit

Permalink
Install test deps only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Jan 28, 2021
1 parent 418fb38 commit 506670b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 48 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/mypy.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,19 @@
name: Test

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install and run Tox
run: pip install tox
- name: Run Tox
run: tox -e py -c netkan
21 changes: 0 additions & 21 deletions .github/workflows/unittest.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -5,3 +5,5 @@
/pr_tester
__pycache__
.mypy_cache/
.eggs
.tox
3 changes: 0 additions & 3 deletions netkan/Dockerfile
Expand Up @@ -3,11 +3,9 @@ RUN useradd -ms /bin/bash netkan
ADD . /netkan
WORKDIR /netkan
RUN pip install pip --upgrade
RUN pip install mypy
RUN chown -R netkan:netkan /netkan
USER netkan
RUN pip install --user . --no-warn-script-location --force-reinstall
RUN mypy .
RUN python -m unittest -v

FROM python:3.7 as production
Expand All @@ -29,7 +27,6 @@ RUN chown -R netkan:netkan /netkan
ADD run_dev.sh /usr/local/bin/
USER netkan
RUN pip install --user /netkan/.[development]
RUN pip install --user /netkan/.[test]
ENTRYPOINT ["/usr/local/bin/run_dev.sh"]

FROM production
3 changes: 0 additions & 3 deletions netkan/setup.py
Expand Up @@ -38,9 +38,6 @@
'pylint',
'autopep8',
'troposphere',
],
'test': [
'mypy',
]
},
)
8 changes: 8 additions & 0 deletions netkan/tox.ini
@@ -0,0 +1,8 @@
[tox]
envlist = py

[testenv]
deps = mypy
commands =
python -m unittest -v
mypy .

0 comments on commit 506670b

Please sign in to comment.