From 9894fc69938dc18ff415db1ad31a082b08b3e57e Mon Sep 17 00:00:00 2001 From: Ashpreet Bedi Date: Sun, 4 Feb 2024 00:08:34 +0000 Subject: [PATCH] v2.3.13 --- .github/workflows/validate.yml | 6 ++---- api/routes/assistants.py | 2 +- pyproject.toml | 7 ++----- requirements.txt | 36 +++++++++++++++++----------------- scripts/validate.sh | 6 ++---- tests/__init__.py | 0 tests/test_placeholder.py | 2 -- workspace/dev_resources.py | 7 ++----- workspace/prd_resources.py | 8 +++----- workspace/settings.py | 8 ++++---- 10 files changed, 34 insertions(+), 48 deletions(-) delete mode 100644 tests/__init__.py delete mode 100644 tests/test_placeholder.py diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index a00194a..d6484ff 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,6 +1,7 @@ name: Validate on: + push: pull_request: types: - opened @@ -27,7 +28,7 @@ jobs: run: | python -m pip install -U \ pip setuptools wheel \ - mypy pytest ruff + mypy ruff pip install --no-deps -r requirements.txt - name: Format with ruff run: | @@ -38,6 +39,3 @@ jobs: - name: Type-check with mypy run: | mypy . - - name: Test with pytest - run: | - pytest . diff --git a/api/routes/assistants.py b/api/routes/assistants.py index 29c886b..9125110 100644 --- a/api/routes/assistants.py +++ b/api/routes/assistants.py @@ -12,7 +12,7 @@ from utils.log import logger ###################################################### -## Router for PDF Assistants +## Router for Serving Assistants ###################################################### assistants_router = APIRouter(prefix=endpoints.ASSISTANTS, tags=["Assistants"]) diff --git a/pyproject.toml b/pyproject.toml index 291bc8c..439f292 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ # Linting and Formatting "ruff", # phidata - "phidata==2.3.5", + "phidata==2.3.13", ] [build-system] @@ -44,7 +44,7 @@ build-backend = "setuptools.build_meta" [tool.ruff] line-length = 110 exclude = ["aienv*", ".venv*"] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Ignore `F401` (import violations) in all `__init__.py` files "__init__.py" = ["F401"] @@ -58,6 +58,3 @@ exclude = ["aienv*", ".venv*"] [[tool.mypy.overrides]] module = ["pgvector.*", "setuptools.*"] ignore_missing_imports = true - -[tool.pytest.ini_options] -testpaths = "tests" diff --git a/requirements.txt b/requirements.txt index 9718b05..31c6583 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,20 +2,20 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# ./scripts/upgrade.sh +# ./scripts/upgrade.sh all # alembic==1.13.1 annotated-types==0.6.0 anyio==4.2.0 -beautifulsoup4==4.12.2 -boto3==1.34.19 -botocore==1.34.19 -certifi==2023.11.17 +beautifulsoup4==4.12.3 +boto3==1.34.34 +botocore==1.34.34 +certifi==2024.2.2 charset-normalizer==3.3.2 click==8.1.7 distro==1.9.0 docker==7.0.0 -fastapi==0.109.0 +fastapi==0.109.1 gitdb==4.0.11 gitpython==3.1.41 h11==0.14.0 @@ -24,33 +24,33 @@ httpx==0.26.0 idna==3.6 iniconfig==2.0.0 jmespath==1.0.1 -mako==1.3.0 +mako==1.3.2 markdown-it-py==3.0.0 -markupsafe==2.1.3 +markupsafe==2.1.5 mdurl==0.1.2 mypy==1.8.0 mypy-extensions==1.0.0 numpy==1.26.3 -openai==1.7.2 +openai==1.11.0 packaging==23.2 pgvector==0.2.4 -phidata==2.3.5 -pluggy==1.3.0 +phidata==2.3.13 +pluggy==1.4.0 psycopg[binary]==3.1.17 psycopg-binary==3.1.17 -pydantic==2.3.0 -pydantic-core==2.6.3 +pydantic==2.6.0 +pydantic-core==2.16.1 pydantic-settings==2.1.0 pygments==2.17.2 -pypdf==3.17.4 -pytest==7.4.4 +pypdf==4.0.1 +pytest==8.0.0 python-dateutil==2.8.2 -python-dotenv==1.0.0 +python-dotenv==1.0.1 pyyaml==6.0.1 regex==2023.12.25 requests==2.31.0 rich==13.7.0 -ruff==0.1.13 +ruff==0.2.0 s3transfer==0.10.0 six==1.16.0 smmap==5.0.1 @@ -66,4 +66,4 @@ types-beautifulsoup4==4.12.0.20240106 types-html5lib==1.1.11.20240106 typing-extensions==4.9.0 urllib3==2.0.7 -uvicorn==0.25.0 +uvicorn==0.27.0.post1 diff --git a/scripts/validate.sh b/scripts/validate.sh index b6db0cd..e852b1d 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -16,12 +16,10 @@ source ${CURR_DIR}/_utils.sh main() { print_heading "Validating workspace..." - print_heading "Running: mypy ${REPO_ROOT}" - mypy ${REPO_ROOT} - print_heading "Running: pytest ${REPO_ROOT}" - pytest ${REPO_ROOT} print_heading "Running: ruff check ${REPO_ROOT}" ruff check ${REPO_ROOT} + print_heading "Running: mypy ${REPO_ROOT}" + mypy ${REPO_ROOT} } main "$@" diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/test_placeholder.py b/tests/test_placeholder.py deleted file mode 100644 index 3ada1ee..0000000 --- a/tests/test_placeholder.py +++ /dev/null @@ -1,2 +0,0 @@ -def test_placeholder(): - assert True diff --git a/workspace/dev_resources.py b/workspace/dev_resources.py index ab7af83..fba4997 100644 --- a/workspace/dev_resources.py +++ b/workspace/dev_resources.py @@ -13,14 +13,11 @@ # -*- Dev image dev_image = DockerImage( - name=f"{ws_settings.image_repo}/{ws_settings.ws_name}", + name=f"{ws_settings.image_repo}/{ws_settings.image_name}", tag=ws_settings.dev_env, enabled=ws_settings.build_images, path=str(ws_settings.ws_root), - pull=ws_settings.force_pull_images, - # Uncomment to push the dev image - # push_image=ws_settings.push_images, - skip_docker_cache=ws_settings.skip_image_cache, + push_image=False, ) # -*- Dev database running on port 5432:5432 diff --git a/workspace/prd_resources.py b/workspace/prd_resources.py index 5fdae08..71dff57 100644 --- a/workspace/prd_resources.py +++ b/workspace/prd_resources.py @@ -25,14 +25,12 @@ # -*- Production image prd_image = DockerImage( - name=f"{ws_settings.image_repo}/{ws_settings.ws_name}", + name=f"{ws_settings.image_repo}/{ws_settings.image_name}", tag=ws_settings.prd_env, enabled=ws_settings.build_images, path=str(ws_settings.ws_root), - platform="linux/amd64", - pull=ws_settings.force_pull_images, - push_image=ws_settings.push_images, - skip_docker_cache=ws_settings.skip_image_cache, + platforms=["linux/amd64", "linux/arm64"], + push_image=True, ) # -*- S3 bucket for production data (set enabled=True when needed) diff --git a/workspace/settings.py b/workspace/settings.py index b91fc5b..ab0dd21 100644 --- a/workspace/settings.py +++ b/workspace/settings.py @@ -30,10 +30,10 @@ # Subnet IDs in the aws_region # subnet_ids=["subnet-xyz", "subnet-xyz"], # -*- Image Settings - # Repository for images (for example, to use ECR use the following format) - # image_repo="[ACCOUNT_ID].dkr.ecr.us-east-1.amazonaws.com", + # Name of the image + image_name="ai-api", + # Repository for the image + # image_repo="phidata", # Build images locally # build_images=True, - # Push images after building - # push_images=True, )