mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Prepare mypy for typing checks
This commit is contained in:
parent
d749cf2e6b
commit
d995761419
4
.github/workflows/pull_request.yml
vendored
4
.github/workflows/pull_request.yml
vendored
@ -56,5 +56,7 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
- name: Build
|
- name: Build
|
||||||
run: make
|
run: make
|
||||||
|
- name: Run mypy
|
||||||
|
run: docker run --rm --entrypoint=python3 frigate:latest -u -m mypy --config-file frigate/mypy.ini frigate
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: docker run --rm --entrypoint=python3 frigate:latest -u -m unittest
|
run: docker run --rm --entrypoint=python3 frigate:latest -u -m unittest
|
14
Makefile
14
Makefile
@ -14,16 +14,8 @@ frigate: version
|
|||||||
frigate_push: version
|
frigate_push: version
|
||||||
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag blakeblackshear/frigate:0.11.0-$(COMMIT_HASH) --file docker/Dockerfile .
|
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag blakeblackshear/frigate:0.11.0-$(COMMIT_HASH) --file docker/Dockerfile .
|
||||||
|
|
||||||
run_tests:
|
run_tests: frigate
|
||||||
# PLATFORM: linux/arm64/v8 linux/amd64 or linux/arm/v7
|
docker run --rm --entrypoint=python3 frigate:latest -u -m unittest
|
||||||
# ARCH: aarch64 amd64 or armv7
|
docker run --rm --entrypoint=python3 frigate:latest -u -m mypy --config-file frigate/mypy.ini frigate
|
||||||
@cat docker/Dockerfile.base docker/Dockerfile.$(ARCH) > docker/Dockerfile.test
|
|
||||||
@sed -i "s/FROM frigate-web as web/#/g" docker/Dockerfile.test
|
|
||||||
@sed -i "s/COPY --from=web \/opt\/frigate\/build web\//#/g" docker/Dockerfile.test
|
|
||||||
@sed -i "s/FROM frigate-base/#/g" docker/Dockerfile.test
|
|
||||||
@echo "" >> docker/Dockerfile.test
|
|
||||||
@echo "RUN python3 -m unittest" >> docker/Dockerfile.test
|
|
||||||
@docker buildx build --platform=$(PLATFORM) --tag frigate-base --build-arg NGINX_VERSION=1.0.2 --build-arg FFMPEG_VERSION=1.0.0 --build-arg ARCH=$(ARCH) --build-arg WHEELS_VERSION=1.0.3 --file docker/Dockerfile.test .
|
|
||||||
@rm docker/Dockerfile.test
|
|
||||||
|
|
||||||
.PHONY: run_tests
|
.PHONY: run_tests
|
||||||
|
@ -42,7 +42,7 @@ COPY requirements.txt /requirements.txt
|
|||||||
RUN pip3 install -r requirements.txt
|
RUN pip3 install -r requirements.txt
|
||||||
|
|
||||||
COPY requirements-wheels.txt /requirements-wheels.txt
|
COPY requirements-wheels.txt /requirements-wheels.txt
|
||||||
RUN pip3 wheel --wheel-dir=/wheels -r requirements-wheels.txt
|
RUN pip3 wheel --wheel-dir=/wheels -r requirements-wheels.txt
|
||||||
|
|
||||||
# Frigate Container
|
# Frigate Container
|
||||||
FROM debian:11-slim
|
FROM debian:11-slim
|
||||||
|
6
frigate/mypy.ini
Normal file
6
frigate/mypy.ini
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[mypy]
|
||||||
|
python_version = 3.9
|
||||||
|
ignore_missing_imports = true
|
||||||
|
|
||||||
|
[mypy-frigate.*]
|
||||||
|
ignore_errors = true
|
@ -2,6 +2,7 @@ click == 8.1.*
|
|||||||
Flask == 2.1.*
|
Flask == 2.1.*
|
||||||
imutils == 0.5.*
|
imutils == 0.5.*
|
||||||
matplotlib == 3.5.*
|
matplotlib == 3.5.*
|
||||||
|
mypy == 0.942
|
||||||
numpy == 1.22.*
|
numpy == 1.22.*
|
||||||
opencv-python-headless == 4.5.5.*
|
opencv-python-headless == 4.5.5.*
|
||||||
paho-mqtt == 1.6.*
|
paho-mqtt == 1.6.*
|
||||||
|
Loading…
Reference in New Issue
Block a user