-
Notifications
You must be signed in to change notification settings - Fork 0
IN-1542 - Overhaul of lambda template to uv and updated devops conventions #60
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d1b0f89
Overhaul of lambda template to uv and updated devops conventions
ghukill d43f51e
Set pre-commit python version and fix PHONY in Makefile
ghukill ab2fce2
SAM: normalize to 'MyFunction' and comment on HTTP invocation
ghukill 19def26
Add default arm64 architecture
ghukill 5a8c828
Add permissions property to ci.yml
ghukill fb1d654
Align python versions
ghukill 9c7d283
Revert PR template, update gitignore, and typos
ghukill ef374d0
Make SENTRY_DSN an optional env var
ghukill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
| linux/arm64 |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,7 +1,11 @@ | ||
| name: CI | ||
| on: push | ||
| permissions: read-all | ||
| on: | ||
| pull_request: | ||
| paths-ignore: | ||
| - '.github/**' | ||
| jobs: | ||
| test: | ||
| uses: mitlibraries/.github/.github/workflows/python-shared-test.yml@main | ||
| uses: mitlibraries/.github/.github/workflows/python-uv-shared-test.yml@main | ||
| lint: | ||
| uses: mitlibraries/.github/.github/workflows/python-shared-lint.yml@main | ||
| uses: mitlibraries/.github/.github/workflows/python-uv-shared-lint.yml@main |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -136,4 +136,8 @@ dmypy.json | |
| .vscode/ | ||
|
|
||
| # jetbrains | ||
| .idea/ | ||
| .idea/ | ||
|
|
||
| .arch_tag | ||
| .aws-sam/ | ||
| tests/sam/env.json | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,29 +1,28 @@ | ||
| default_language_version: | ||
| python: python3.12 # set for project python version | ||
| python: python3.13 | ||
| default_stages: | ||
| - pre-push | ||
| repos: | ||
| - repo: local | ||
| hooks: | ||
| - id: black-apply | ||
| name: black-apply | ||
| entry: pipenv run black | ||
| - id: ruff-format | ||
| name: ruff-format | ||
| entry: uv run ruff format --diff | ||
| language: system | ||
| pass_filenames: true | ||
| types: ["python"] | ||
| types: [ "python" ] | ||
|
|
||
| - id: mypy | ||
| name: mypy | ||
| entry: pipenv run mypy | ||
| entry: uv run mypy | ||
| language: system | ||
| pass_filenames: true | ||
| types: ["python"] | ||
| exclude: "tests/" | ||
| - id: ruff-apply | ||
| name: ruff-apply | ||
| entry: pipenv run ruff check --fix | ||
| types: [ "python" ] | ||
| exclude: "(tests/|output/|migrations/)" | ||
|
|
||
| - id: ruff-check | ||
| name: ruff-check | ||
| entry: uv run ruff check | ||
| language: system | ||
| pass_filenames: true | ||
| types: ["python"] | ||
| - id: pip-audit | ||
| name: pip-audit | ||
| entry: pipenv run pip-audit | ||
| language: system | ||
| pass_filenames: false | ||
| types: [ "python" ] |
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| 3.12 | ||
| 3.13 |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,12 +1,18 @@ | ||
| FROM public.ecr.aws/lambda/python:3.12 | ||
| FROM public.ecr.aws/lambda/python:3.13 | ||
|
|
||
| # Copy function code | ||
| COPY . ${LAMBDA_TASK_ROOT}/ | ||
| # Install uv | ||
| COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
|
|
||
| # Copy project metadata | ||
| COPY pyproject.toml uv.lock* ./ | ||
|
|
||
| # Install dependencies | ||
| RUN pip3 install pipenv | ||
| RUN pipenv requirements > requirements.txt | ||
| RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" | ||
| RUN cd ${LAMBDA_TASK_ROOT} && \ | ||
| uv export --format requirements-txt --no-hashes --no-dev > requirements.txt && \ | ||
| uv pip install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" --system | ||
|
|
||
| # Copy project files | ||
| COPY . ${LAMBDA_TASK_ROOT}/ | ||
|
|
||
| # Default handler. See README for how to override to a different handler. | ||
| CMD [ "lambdas.my_function.lambda_handler" ] |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.