diff --git a/.github/workflows/namerank-python-unit-tests.yml b/.github/workflows/namerank-python-unit-tests.yml index 0b649f2a..9bdd496b 100644 --- a/.github/workflows/namerank-python-unit-tests.yml +++ b/.github/workflows/namerank-python-unit-tests.yml @@ -37,7 +37,7 @@ jobs: - name: Install dependencies working-directory: ./apps/api.namerank.io - run: poetry install + run: poetry install --extras "lambda" - name: Run tests working-directory: ./apps/api.namerank.io diff --git a/apps/api.namerank.io/Dockerfile b/apps/api.namerank.io/Dockerfile index ae18949d..7f4f4940 100644 --- a/apps/api.namerank.io/Dockerfile +++ b/apps/api.namerank.io/Dockerfile @@ -3,5 +3,5 @@ WORKDIR /app RUN yum install gcc -y COPY pyproject.toml poetry.lock LICENSE README.md ./ COPY namerank ./namerank/ -RUN pip install --no-cache-dir .[namerank] +RUN pip install --no-cache-dir .[lambda] CMD [ "namerank.root_api.handler" ] \ No newline at end of file diff --git a/apps/api.namerank.io/pyproject.toml b/apps/api.namerank.io/pyproject.toml index 5055342f..0ed8ff2c 100644 --- a/apps/api.namerank.io/pyproject.toml +++ b/apps/api.namerank.io/pyproject.toml @@ -29,7 +29,6 @@ lambda = ["mangum"] [tool.poetry.group.dev.dependencies] pytest = "^7.4.0" - uvicorn = { extras = ["standard"], version = "^0.23.2" } pytest-asyncio = "^0.21.1" pytest-cov = "^4.1.0" diff --git a/apps/api.namerank.io/tests/test_api.py b/apps/api.namerank.io/tests/test_api.py index 3420e310..0ef08767 100644 --- a/apps/api.namerank.io/tests/test_api.py +++ b/apps/api.namerank.io/tests/test_api.py @@ -6,6 +6,13 @@ from nameguard.utils import MAX_INSPECTED_NAME_CHARACTERS +# if mangum is not installed, do not run the api tests +try: + import mangum # noqa: F401 +except ImportError: + pytest.skip('mangum is not installed, skipping api tests', allow_module_level=True) + + @pytest.fixture(scope='module') def test_client(): with mock_static_property():