diff --git a/Makefile b/Makefile index 3556605..2709a82 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,22 @@ install: - . venv/bin/activate; pip install -Ur requirements.txt + . .venv/bin/activate; pip install -Ur requirements.txt activate: - . venv/bin/activate + . .venv/bin/activate install_venv: - python3 -m venv venv - . venv/bin/activate; python -m pip install --upgrade pip - . venv/bin/activate; python -m pip install -r dev-requirements.txt + python3 -m venv .venv + . .venv/bin/activate; python -m pip install --upgrade pip + . .venv/bin/activate; python -m pip install -r dev-requirements.txt formatter: - . venv/bin/activate; command black --line-length 125 . + . .venv/bin/activate; command black --line-length 125 . check_format: - . venv/bin/activate; command black --line-length 125 . --check + . .venv/bin/activate; command black --line-length 125 . --check test: - . venv/bin/activate; command cd src; command pytest + . .venv/bin/activate; command cd src; command pytest remove_docker_containers: docker compose ps -q | xargs docker rm @@ -43,4 +43,4 @@ stop: docker compose stop delete_queues: - . venv/bin/activate; python scripts/delete_queues.py + . .venv/bin/activate; python scripts/delete_queues.py diff --git a/dev-requirements.txt b/dev-requirements.txt index 862672b..30ec49c 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,4 @@ -r requirements.txt -pytest==7.4.2 -black==23.9.1 +pytest==8.2.0 +black==24.4.2 mongomock==4.1.2 diff --git a/foo.py b/foo.py deleted file mode 100644 index 81f9fc4..0000000 --- a/foo.py +++ /dev/null @@ -1,7 +0,0 @@ -from pathlib import Path - -if __name__ == "__main__": - path = Path("requirements.txt") - dependency_links = [r for r in path.read_text().splitlines() if r.startswith("git+")] - requirements = [r for r in path.read_text().splitlines() if not r.startswith("git+")] - print(requirements) diff --git a/requirements.txt b/requirements.txt index a1fa035..a5af70c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,14 @@ -fastapi==0.110.1 +fastapi==0.110.2 graypy==2.1.0 python-multipart==0.0.9 uvicorn==0.29.0 -gunicorn==21.2.0 +gunicorn==22.0.0 nltk==3.8.1 PyYAML==6.0.1 requests==2.31.0 -pymongo==4.6.3 +pymongo==4.7.0 PyRSMQ==0.5.0 -redis==5.0.3 +redis==5.0.4 httpx==0.27.0 -sentry-sdk==1.44.0 +sentry-sdk==2.0.1 git+https://github.com/huridocs/pdf-tokens-type-labeler@1c12c368887372164ab4981c3277a49e9dc43b9a diff --git a/setup.py b/setup.py index 3082477..58a15f5 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ name=PROJECT_NAME, packages=["paragraph_extraction_trainer"], package_dir={"": "src"}, - version="0.32", + version="0.33", url="https://github.com/huridocs/pdf_paragraphs_extraction", author="HURIDOCS", description="Service for extracting paragraphs from PDFs.", diff --git a/src/app.py b/src/app.py index 76288fc..8bb81f7 100755 --- a/src/app.py +++ b/src/app.py @@ -135,7 +135,7 @@ async def get_xml(tenant: str, pdf_file_name: str): @app.post("/get_toc") -def get_toc(file: UploadFile = File(...)): +async def get_toc(file: UploadFile = File(...)): filename = "No file name!" try: filename = file.filename diff --git a/src/toc/TitleFeatures.py b/src/toc/TitleFeatures.py index cf057e7..2b273f0 100755 --- a/src/toc/TitleFeatures.py +++ b/src/toc/TitleFeatures.py @@ -273,7 +273,7 @@ def get_features_toc(self) -> np.array: 1 if self.italics else 0, self.first_characters_type, self.first_characters_special_markers_count, - self.bullet_points_type + self.bullet_points_type, # self.text_centered, # self.is_left, # self.indentation