Skip to main content

Description

CLI tool to run the sam build on a poetry-based project.

AWS's SAM made use of a requirements.txt file for third party dependency management. This method is limiting in comparison to other tools such as Poetry that manage sub-dependencies' versions through a lock file. This poetry plugin deploys a serverless app through SAM with dependencies being managed through Poetry.

Created by Pinnacle Solutions Group, www.pinnsg.com.

Set up

This plugin is dependent on having aws-sam-cli locally. AWS has a doc page an aws-sam-cli with the installation instructions at this url: aws-sam-cli installation

To install in the same environment as the poetry on your system:

pip install poetry
poetry self add poetry-aws-sam

This will add sam as a command in poetry. If you run poetry list, you will see sam as an option amongst the commands. You can then call poetry sam --help for options in running sam in your poetry project.

The plugin replaces the sam build command.

Sam deployment steps

sam build
sam package
sam deploy

Deployment steps using poetry-aws-sam:

poetry sam --without-hashes
sam package
sam deploy

History

The plugin was created while Pinnacle Solutions Group was working with one of its clients on a projects built on aws serverless resources. The client used SAM for its serverless management. The company ended a vendor's contract, which led to the team not having a repository for its package whl's. The team shifted to using poetry and installing its packages from a github url. With the change to poetry, the team needed to update how it interacted with SAM. This plugin was created by Pinnacle Solutions Group to meet that need.

Working on poetry-aws-sam

Common Actions - justfile

There is a justfile for just commands. It is like make with improvements. You can read about installation and usage here: just - github

  • show all the commands by running only just: just
  • set up git hooks through the pre-commit project: just pre-commit-setup
  • run the unit tests: just tests

Install locally to test iteratively

python -m venv .venv
source .venv/bin/activate
pip install -e .
just sam # same as: .venv/bin/poetry sam

This will set up a virtual env and have the sam ready as a plugin

pypi deployment

The master.yml workflow will deploy to pypi. This means that the project version in pyproject.toml will need to be increased when merging into the master branch.

A good dev flow:

  • create new branch
  • update version number of project
    • can use poetry version minor to increase the minor version
  • with code update, create pull request to merge into master
  • approve pull request and then merge into master
  • the workflow will then deploy to pypi

Metadata

Release files for poetry-aws-sam 1.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for poetry-aws-sam 1.4.3
File Size Uploaded Provenance Actions
poetry_aws_sam-1.4.3.tar.gz 6.5 kB With provenance Details for poetry_aws_sam-1.4.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for poetry-aws-sam 1.4.3
File Interpreter ABI Platform Actions
poetry_aws_sam-1.4.3-py3-none-any.whl Python 3 none any Details for poetry_aws_sam-1.4.3-py3-none-any.whl

Total release size: 14.4 kB

Release files / poetry_aws_sam-1.4.3.tar.gz

Download URL poetry_aws_sam-1.4.3.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cd316052705a9d97e638e7b36a36270ba3e382dd6cf72f64819515cbc37e8d59
BLAKE2b-256 checksum
How to use checksums
0d69bfa00495f6f7ea7d99e2ebcdbef30e9618a661c5d90b3e2cbd08589e5f52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2024.

Transparency log

Release files / poetry_aws_sam-1.4.3-py3-none-any.whl

Download URL poetry_aws_sam-1.4.3-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e30547bc601f4e36ad38eeb7caf7769ae148aab22d053f1d0cd5e32c28cd2ff2
BLAKE2b-256 checksum
How to use checksums
36005dd5e50503bf69e57ced161ff40fac489c22f348953b08619f6b27efd48c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2024.

Transparency log

Security for poetry-aws-sam 1.4.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for poetry_aws_sam-1.4.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2024.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page