forked from mindee/doctr
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] move requirements to pyproject.toml (mindee#1031)
- Loading branch information
1 parent
61d0f1c
commit bf356a3
Showing
26 changed files
with
232 additions
and
374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,20 +17,32 @@ jobs: | |
run: docker run doctr-tf-py3.8-slim python -c 'import doctr' | ||
|
||
pytest-api: | ||
runs-on: ubuntu-latest | ||
env: | ||
# Port for web container | ||
# See docker-compose.yml | ||
PORT: 8002 | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python: [3.8] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
architecture: x64 | ||
- name: Install poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.1.13 | ||
- name: Lock the requirements | ||
run: | | ||
cd api | ||
make lock | ||
- name: Build & run docker | ||
run: docker-compose up -d --build | ||
run: cd api && docker-compose up -d --build | ||
- name: Ping server | ||
run: wget --spider --tries=12 http://localhost:$PORT/docs | ||
- name: Install dependencies in docker | ||
run: | | ||
docker-compose exec -T web python -m pip install --upgrade pip | ||
docker-compose exec -T web pip install -r requirements-dev.txt | ||
run: wget --spider --tries=12 http://localhost:8080/docs | ||
- name: Run docker test | ||
run: docker-compose exec -T web pytest . | ||
run: | | ||
docker cp api/requirements-dev.txt api_web_1:/app/requirements-dev.txt | ||
docker-compose -f api/docker-compose.yml exec -T web pip install -r requirements-dev.txt | ||
docker cp api/tests api_web_1:/app/tests | ||
docker-compose -f api/docker-compose.yml exec -T web pytest tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# api setup is borrowed from https://github.com/frgfm/Holocron/blob/main/api | ||
|
||
.PHONY: lock run stop test | ||
# Pin the dependencies | ||
lock: | ||
poetry lock | ||
poetry export -f requirements.txt --without-hashes --output requirements.txt | ||
poetry export -f requirements.txt --without-hashes --dev --output requirements-dev.txt | ||
|
||
# Run the docker | ||
run: | ||
docker-compose up -d --build | ||
|
||
# Run the docker | ||
stop: | ||
docker-compose down | ||
|
||
# Run tests for the library | ||
test: | ||
docker-compose up -d --build | ||
docker cp requirements-dev.txt api_web_1:/app/requirements-dev.txt | ||
docker-compose exec -T web pip install -r requirements-dev.txt | ||
docker cp tests api_web_1:/app/tests | ||
docker-compose exec -T web pytest tests/ | ||
docker-compose down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[build-system] | ||
requires = ["poetry>=1.0"] | ||
build-backend = "poetry.masonry.api" | ||
|
||
[tool.poetry] | ||
name = "doctr-api" | ||
version = "0.5.2a0" | ||
description = "Backend template for your OCR API with docTR" | ||
authors = ["Mindee <[email protected]>"] | ||
license = "Apache-2.0" | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.8,<3.11" | ||
tensorflow = ">=2.9.0,<3.0.0" | ||
tensorflow-addons = ">=0.17.1" | ||
python-doctr = ">=0.2.0" | ||
# Fastapi: minimum version required to avoid pydantic error | ||
# cf. https://github.com/tiangolo/fastapi/issues/4168 | ||
fastapi = ">=0.73.0" | ||
uvicorn = ">=0.11.1" | ||
python-multipart = "==0.0.5" | ||
|
||
[tool.poetry.dev-dependencies] | ||
pytest = ">=5.3.2,<8.0.0" | ||
pytest-asyncio = ">=0.14.0,<1.0.0" | ||
httpx = ">=0.23.0" | ||
requests = "^2.20.0" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.