Skip to content

Commit

Permalink
Add Makefile command for building code (#201)
Browse files Browse the repository at this point in the history
* feat: add Makefile command for building code

* fix workflows

* changed my mind about requirements.txt

* fix: add opencv dependency

* rm build line useless

* use make from workflow

* don't use poetry in a workflow

* Update .github/workflows/docker.yml

* Update .github/workflows/docker.yml

* fix: add newline
  • Loading branch information
RonanMorgan authored Jun 11, 2024
1 parent 0da320d commit d8d6082
Show file tree
Hide file tree
Showing 9 changed files with 579 additions and 192 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: echo "${{ secrets.DOCKERHUB_PW }}" | docker login -u "${{ secrets.DOCKERHUB_LOGIN }}" --password-stdin

- name: Build Docker image
run: make build
run: make build-app

- name: Push Docker image
run: docker push pyronear/pyro-engine:latest
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build docker image
run: docker build . -t pyronear/pyro-engine:python3.8.1-slim
run: make build-app
- name: Run docker container
run: docker run pyronear/pyro-engine:python3.8.1-slim python -c 'import pyroengine'
run: make run
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ venv/
ENV/
env.bak/
venv.bak/
venv*

# Spyder project settings
.spyderproject
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ ENV PYTHONDONTWRITEBYTECODE 1
# set work directory
WORKDIR /usr/src/app


COPY ./pyproject.toml /tmp/pyproject.toml
COPY ./README.md /tmp/README.md
COPY ./setup.py /tmp/setup.py

Expand Down
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,28 @@ test:
single-docs:
sphinx-build docs/source docs/_build -a


# update requirements.txt
lock:
cd src; poetry lock
cd src; poetry export -f requirements.txt --without-hashes --output requirements.txt

# Build the docker
build:
docker build . -t pyronear/pyro-engine:python3.8.1-slim
build-app:
docker build . -t pyronear/pyro-engine:latest

build-lib:
pip install -e .

build-optional-lib:
pip install -e .[test]
pip install -e .[quality]
pip install -e .[docs]
pip install -e .[dev]

# Run the engine wrapper
run:
bash scripts/setup-docker-compose.sh
docker build . -t pyronear/pyro-engine:latest
docker compose up -d

# Get log from engine wrapper
Expand Down
4 changes: 0 additions & 4 deletions src/Makefile

This file was deleted.

685 changes: 531 additions & 154 deletions src/poetry.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ license = "Apache-2.0"
python = "^3.8"
pyroengine = "^0.2.0"
python-dotenv = ">=0.15.0"
opencv-python = "^4.5.5.64"
53 changes: 27 additions & 26 deletions src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
certifi==2022.6.15; python_version >= "3.7" and python_version < "4" and python_full_version >= "3.7.0"
charset-normalizer==2.1.0; python_version >= "3.7" and python_version < "4" and python_full_version >= "3.7.0"
colorama==0.4.5; python_version >= "3.6" and python_version < "4" and python_full_version >= "3.7.0" and platform_system == "Windows"
coloredlogs==15.0.1; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "4" or python_version >= "3.6" and python_version < "4" and python_full_version >= "3.5.0"
filelock==3.7.1; python_version >= "3.7" and python_version < "4" and python_full_version >= "3.7.0"
flatbuffers==2.0; python_version >= "3.6" and python_version < "4"
humanfriendly==10.0; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "4" or python_version >= "3.6" and python_version < "4" and python_full_version >= "3.5.0"
idna==3.3; python_version >= "3.7" and python_version < "4" and python_full_version >= "3.7.0"
mpmath==1.2.1; python_version >= "3.7" and python_version < "4"
numpy==1.23.1; python_version >= "3.8" and python_version < "4"
onnxruntime==1.12.1; python_version >= "3.6" and python_version < "4"
packaging==21.3; python_version >= "3.6" and python_version < "4" and python_full_version >= "3.7.0"
pillow==9.2.0; python_version >= "3.7"
protobuf==4.21.4; python_version >= "3.7" and python_version < "4"
pyparsing==3.0.9; python_version >= "3.6" and python_version < "4" and python_full_version >= "3.7.0"
pyreadline3==3.4.1; sys_platform == "win32" and python_version >= "3.8" and (python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "4" or python_version >= "3.6" and python_version < "4" and python_full_version >= "3.5.0")
pyroclient==0.1.2; python_version >= "3.6" and python_version < "4"
pyroengine==0.2.0; python_version >= "3.6" and python_version < "4"
python-dotenv==0.20.0; python_version >= "3.5"
pyyaml==6.0; python_version >= "3.6" and python_version < "4" and python_full_version >= "3.7.0"
requests==2.28.1; python_version >= "3.7" and python_version < "4"
sympy==1.10.1; python_version >= "3.7" and python_version < "4"
tqdm==4.64.0; python_version >= "3.6" and python_version < "4" and python_full_version >= "3.7.0"
typing-extensions==4.3.0; python_version >= "3.7" and python_version < "4" and python_full_version >= "3.7.0"
urllib3==1.26.11; python_full_version >= "3.7.0" and python_version < "4" and python_version >= "3.7"
opencv-python==4.5.5.64; python_full_version >= "3.7.0" and python_version < "4" and python_version >= "3.7"
certifi==2024.2.2 ; python_version >= "3.8" and python_version < "4"
charset-normalizer==3.3.2 ; python_version >= "3.8" and python_version < "4"
colorama==0.4.6 ; python_version >= "3.8" and python_version < "4" and platform_system == "Windows"
coloredlogs==15.0.1 ; python_version >= "3.8" and python_version < "4"
filelock==3.14.0 ; python_version >= "3.8" and python_version < "4"
flatbuffers==24.3.25 ; python_version >= "3.8" and python_version < "4"
fsspec==2024.5.0 ; python_version >= "3.8" and python_version < "4"
huggingface-hub==0.23.2 ; python_version >= "3.8" and python_version < "4"
humanfriendly==10.0 ; python_version >= "3.8" and python_version < "4"
idna==3.7 ; python_version >= "3.8" and python_version < "4"
mpmath==1.3.0 ; python_version >= "3.8" and python_version < "4"
numpy==1.24.4 ; python_version >= "3.8" and python_version < "4"
onnxruntime==1.18.0 ; python_version >= "3.8" and python_version < "4"
opencv-python==4.9.0.80 ; python_version >= "3.8" and python_version < "4.0"
packaging==24.0 ; python_version >= "3.8" and python_version < "4"
pillow==10.3.0 ; python_version >= "3.8" and python_version < "4"
protobuf==5.27.0 ; python_version >= "3.8" and python_version < "4"
pyreadline3==3.4.1 ; sys_platform == "win32" and python_version >= "3.8" and python_version < "4"
pyroclient==0.1.2 ; python_version >= "3.8" and python_version < "4"
pyroengine==0.2.0 ; python_version >= "3.8" and python_version < "4"
python-dotenv==1.0.1 ; python_version >= "3.8" and python_version < "4.0"
pyyaml==6.0.1 ; python_version >= "3.8" and python_version < "4"
requests==2.32.2 ; python_version >= "3.8" and python_version < "4"
sympy==1.12 ; python_version >= "3.8" and python_version < "4"
tqdm==4.66.4 ; python_version >= "3.8" and python_version < "4"
typing-extensions==4.12.0 ; python_version >= "3.8" and python_version < "4"
urllib3==2.2.1 ; python_version >= "3.8" and python_version < "4"

0 comments on commit d8d6082

Please sign in to comment.