Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use poetry for dependency management given lambda deployment #39

Merged
merged 4 commits into from
Aug 30, 2024

Conversation

zacdezgeo
Copy link
Collaborator

@zacdezgeo zacdezgeo commented Aug 29, 2024

What I Changed

  • Migrate pyproject.toml to poetry syntax
  • Add poetry.lock file

How to Test it

  • Create a fresh environment (poetry install)
  • or deploy with cdk deploy --> live here

Other Notes

I tried implementing groups to keep mangum outside of the core dependencies, but I wasn't able to get the CDK deployment to pick up on the group dependencies under [tool.poetry.group.lambda.dependencies]. I also tried this approach in the pyproject.toml with the same result:

[tool.poetry.extras]
lambda = ["mangum"]

I'm unsure if we should keep mangum in the core dependencies and keep the simplicity of the current CDK deployment or refactor something in the deployment.

@zacdezgeo zacdezgeo added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 29, 2024
@zacdezgeo zacdezgeo self-assigned this Aug 29, 2024
@zacdezgeo
Copy link
Collaborator Author

Updated tests, but just wanted to flag that running CI workflow locally with act no longer works for me @vincentsarago. Getting these errors with some of the unittests - I get the same errors on the python-packaging branch. Not the end of the world, but I usually enjoy running the workflows locally to confirm results 🤷

Command: act -W .github/workflows/ci.yml

Result:

[...]
| ERROR tests/test_api.py::test_read_root - pytest_postgresql.exceptions.ExecutableMissingException: Could not found /usr/lib/postgresql/14/bin/pg_ctl. Is PostgreSQL server installed? Alternatively pg_config installed might be from different version that postgresql-server.
| ERROR tests/test_api.py::test_get_summary - pytest_postgresql.exceptions.ExecutableMissingException: Could not found /usr/lib/postgresql/14/bin/pg_ctl. Is PostgreSQL server installed? Alternatively pg_config installed might be from different version that postgresql-server.
| ERROR tests/test_api.py::test_get_summary_with_geometry_polygon - pytest_postgresql.exceptions.ExecutableMissingException: Could not found /usr/lib/postgresql/14/bin/pg_ctl. Is PostgreSQL server installed? Alternatively pg_config installed might be from different version that postgresql-server.
| ERROR tests/test_api.py::test_get_summary_with_geometry_point - pytest_postgresql.exceptions.ExecutableMissingException: Could not found /usr/lib/postgresql/14/bin/pg_ctl. Is PostgreSQL server installed? Alternatively pg_config installed might be from different version that postgresql-server.
| ERROR tests/test_api.py::test_get_fields - pytest_postgresql.exceptions.ExecutableMissingException: Could not found /usr/lib/postgresql/14/bin/pg_ctl. Is PostgreSQL server installed? Alternatively pg_config installed might be from different version that postgresql-server.
| ========================= 7 passed, 5 errors in 1.35s ==========================

@vincentsarago vincentsarago self-requested a review August 30, 2024 12:31
Copy link
Collaborator

@vincentsarago vincentsarago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

I think it's fine for now but I might propose a larger refactor of the directory arch later

@vincentsarago vincentsarago merged commit 64e0fc7 into refactor/python-packaging Aug 30, 2024
2 checks passed
@zacdezgeo zacdezgeo deleted the lambda-poetry branch August 30, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants