Skip to content

Commit 604d985

Browse files
authored
Merge pull request #29 from brain-facens/develop
Develop
2 parents 5004d2b + 5f7c46e commit 604d985

File tree

10 files changed

+17
-51
lines changed

10 files changed

+17
-51
lines changed

.github/workflows/pylint.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/python-app.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,14 @@ jobs:
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
29-
pip install flake8 pytest
29+
pip install flake8 pytest pylint
3030
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31-
- name: Lint with flake8
31+
- name: Analysing the code with pylint
3232
run: |
33-
# stop the build if there are Python syntax errors or undefined names
34-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37-
- name: Run api
38-
run: python src/field_vision_api/main.py
39-
- name: Test with pytest
33+
pylint $(git ls-files '*.py')
34+
- name: Build the Docker image
4035
run: |
41-
pytest
36+
docker build . --file Dockerfile --tag fiel-vision-api
37+
- name: Run API docker image
38+
run: |
39+
docker run -d -p 8085:8085 fiel-vision-api

Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM python:3.7
1+
FROM python:3.8
22

33
WORKDIR /app
44

55
RUN apt-get update && apt-get install -y libgtk2.0-dev && apt-get install ffmpeg libsm6 libxext6 -y
66

7-
RUN git clone https://github.com/PaddlePaddle/PaddleOCR.git
7+
RUN git clone https://github.com/brain-facens/FieldVision-AI.git
88

99
RUN pip install --upgrade pip
1010

@@ -22,7 +22,4 @@ ENV PYTHONPATH=/app/PaddleOCR
2222

2323
EXPOSE 8080
2424

25-
COPY python_scripts/utils.py /app
26-
COPY python_scripts/main.py /app
27-
28-
CMD ["python", "main.py", "--filter", "first,second,third"]
25+
CMD ["python", "FieldVision-AI/src/field_vision_api/main.py"]

src/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/test_get_filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pytest # W0611, pylint: disable=unused-import
66
import requests
77

8-
def test_api_get_filter(url = "http://0.0.0.0:8085/v1/filter/") -> None:
8+
def test_api_get_filter(url = "http://localhost:8085/v1/filter/") -> None:
99
"""
1010
Test for endpoint filter result /v1/filter/.
1111

tests/test_get_raw_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest # W0611, pylint: disable=unused-import
55
import requests
66

7-
def test_api_get_raw_result(url = "http://0.0.0.0:8085/v1/raw_result/"):
7+
def test_api_get_raw_result(url = "http://localhost:8085/v1/raw_result/"):
88
"""
99
Test for endpoint raw result /v1/raw_result/.
1010

tests/test_get_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest # W0611, pylint: disable=unused-import
55
import requests
66

7-
def test_api_get_result(url = "http://0.0.0.0:8085/v1/result/"):
7+
def test_api_get_result(url = "http://localhost:8085/v1/result/"):
88
"""
99
Test for endpoint raw result /v1/result/.
1010

tests/test_get_root.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest # W0611, pylint: disable=unused-import
55
import requests
66

7-
def test_api_get_root(url = "http://0.0.0.0:8085/"):
7+
def test_api_get_root(url = "http://localhost:8085/"):
88
"""
99
Test for root endpoint /.
1010

tests/test_post_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest # W0611, pylint: disable=unused-import
55
import requests
66

7-
def test_api_post_img(url = "http://0.0.0.0:8085/v1/post_image/"):
7+
def test_api_post_img(url = "http://localhost:8085/v1/post_image/"):
88
"""
99
Test for endpoint /v1/post_image/.
1010

tests/test_put_filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest # W0611, pylint: disable=unused-import
55
import requests
66

7-
def test_api_put_result(url = "http://0.0.0.0:8085/v1/filter/"):
7+
def test_api_put_result(url = "http://localhost:8085/v1/filter/"):
88
"""
99
Test for endpoint /v1/filter/.
1010

0 commit comments

Comments
 (0)