Skip to content

Conversation

@reedham-aws
Copy link
Contributor

Description of changes

There are 2 changes in this PR that I thought were small enough to be fit in one:

  1. Refactoring the flow of building from a pyproject.toml file.
    a. Previously, we had two separate flows for exporting from uv.lock to a temporary requirements.txt, now we use the one flow after calling uv lock when it doesn't already exist.
  2. Changing it so that requirements.txt is the default manifest that we look for.
    a. This is because of the scenario outlined below and in feat: Python UV workflow #756 (comment). This change should fix that because we will read the requirements.txt no matter what if it exists. It doesn't make a ton of sense to have both but the deps are in pyproject.toml so I'm making the choice that ignore that case.
  1. Customer supplies both pyproject.toml (for project metadata) and requirements.txt, but all dependencies are found in requirements.txt.
  2. If the user opts to use this UV workflow from SAM CLI, it will see that there's a pyproject.toml, and only read that, ignoring the requirements.
  3. The function is built, but the intended deps aren't there because we never read requirements.

Also of note is that I added a python version to the uv export call because in testing I noticed that sometimes it would not be using the same as the runtime of the function

Description of how you validated changes

Ran and updated unit tests to confirm this change did as expected. I also used SAM CLI with a test project that had both requirements.txt and pyproject.toml to confirm that it chose requirements as the manifest to read. This required a change in SAM CLI (pending in aws/aws-sam-cli#8549) that allows manifests to be passed as None. Right now this only applies to UV, which could operate with multiple manifests.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@reedham-aws reedham-aws requested a review from a team as a code owner January 15, 2026 19:53
valerena
valerena previously approved these changes Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants