aws-lambda-builders 1.69.0__tar.gz → 1.71.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. {aws_lambda_builders-1.69.0/aws_lambda_builders.egg-info → aws_lambda_builders-1.71.0}/PKG-INFO +4 -2
  2. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/__init__.py +1 -1
  3. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/utils.py +4 -1
  4. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_uv/DESIGN.md +149 -27
  5. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_uv/actions.py +2 -2
  6. aws_lambda_builders-1.71.0/aws_lambda_builders/workflows/python_uv/packager.py +734 -0
  7. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_uv/utils.py +91 -21
  8. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_uv/workflow.py +107 -3
  9. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0/aws_lambda_builders.egg-info}/PKG-INFO +4 -2
  10. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders.egg-info/requires.txt +7 -1
  11. aws_lambda_builders-1.71.0/requirements/base.txt +1 -0
  12. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/requirements/dev.txt +2 -1
  13. aws_lambda_builders-1.69.0/aws_lambda_builders/workflows/python_uv/packager.py +0 -424
  14. aws_lambda_builders-1.69.0/requirements/base.txt +0 -1
  15. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/LICENSE +0 -0
  16. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/MANIFEST.in +0 -0
  17. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/NOTICE +0 -0
  18. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/README.md +0 -0
  19. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/__main__.py +0 -0
  20. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/actions.py +0 -0
  21. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/architecture.py +0 -0
  22. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/binary_path.py +0 -0
  23. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/builder.py +0 -0
  24. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/exceptions.py +0 -0
  25. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/path_resolver.py +0 -0
  26. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/registry.py +0 -0
  27. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/supported_runtimes.py +0 -0
  28. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/validator.py +0 -0
  29. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflow.py +0 -0
  30. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/__init__.py +0 -0
  31. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/custom_make/DESIGN.md +0 -0
  32. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/custom_make/__init__.py +0 -0
  33. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/custom_make/actions.py +0 -0
  34. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/custom_make/exceptions.py +0 -0
  35. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/custom_make/make.py +0 -0
  36. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/custom_make/utils.py +0 -0
  37. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/custom_make/validator.py +0 -0
  38. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/custom_make/workflow.py +0 -0
  39. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/dotnet_clipackage/DESIGN.md +0 -0
  40. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/dotnet_clipackage/__init__.py +0 -0
  41. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/dotnet_clipackage/actions.py +0 -0
  42. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/dotnet_clipackage/dotnetcli.py +0 -0
  43. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/dotnet_clipackage/dotnetcli_resolver.py +0 -0
  44. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/dotnet_clipackage/utils.py +0 -0
  45. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/dotnet_clipackage/workflow.py +0 -0
  46. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/go_modules/DESIGN.md +0 -0
  47. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/go_modules/__init__.py +0 -0
  48. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/go_modules/actions.py +0 -0
  49. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/go_modules/builder.py +0 -0
  50. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/go_modules/utils.py +0 -0
  51. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/go_modules/validator.py +0 -0
  52. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/go_modules/workflow.py +0 -0
  53. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java/__init__.py +0 -0
  54. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java/actions.py +0 -0
  55. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java/utils.py +0 -0
  56. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_gradle/DESIGN.md +0 -0
  57. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_gradle/__init__.py +0 -0
  58. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_gradle/actions.py +0 -0
  59. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_gradle/gradle.py +0 -0
  60. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_gradle/gradle_resolver.py +0 -0
  61. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_gradle/gradle_validator.py +0 -0
  62. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_gradle/resources/lambda-build-init.gradle +0 -0
  63. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_gradle/workflow.py +0 -0
  64. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_maven/DESIGN.md +0 -0
  65. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_maven/__init__.py +0 -0
  66. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_maven/actions.py +0 -0
  67. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_maven/maven.py +0 -0
  68. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_maven/maven_resolver.py +0 -0
  69. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_maven/maven_validator.py +0 -0
  70. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/java_maven/workflow.py +0 -0
  71. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/nodejs_npm/DESIGN.md +0 -0
  72. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/nodejs_npm/__init__.py +0 -0
  73. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/nodejs_npm/actions.py +0 -0
  74. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/nodejs_npm/exceptions.py +0 -0
  75. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/nodejs_npm/lockfile_closure.py +0 -0
  76. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/nodejs_npm/npm.py +0 -0
  77. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/nodejs_npm/utils.py +0 -0
  78. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/nodejs_npm/workflow.py +0 -0
  79. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/nodejs_npm_esbuild/DESIGN.md +0 -0
  80. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/nodejs_npm_esbuild/__init__.py +0 -0
  81. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/nodejs_npm_esbuild/actions.py +0 -0
  82. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/nodejs_npm_esbuild/esbuild.py +0 -0
  83. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/nodejs_npm_esbuild/exceptions.py +0 -0
  84. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/nodejs_npm_esbuild/workflow.py +0 -0
  85. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_pip/DESIGN.md +0 -0
  86. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_pip/__init__.py +0 -0
  87. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_pip/actions.py +0 -0
  88. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_pip/compat.py +0 -0
  89. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_pip/exceptions.py +0 -0
  90. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_pip/packager.py +0 -0
  91. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_pip/utils.py +0 -0
  92. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_pip/validator.py +0 -0
  93. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_pip/workflow.py +0 -0
  94. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_uv/__init__.py +0 -0
  95. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/python_uv/exceptions.py +0 -0
  96. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/ruby_bundler/DESIGN.md +0 -0
  97. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/ruby_bundler/__init__.py +0 -0
  98. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/ruby_bundler/actions.py +0 -0
  99. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/ruby_bundler/bundler.py +0 -0
  100. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/ruby_bundler/utils.py +0 -0
  101. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/ruby_bundler/workflow.py +0 -0
  102. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/rust_cargo/DESIGN.md +0 -0
  103. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/rust_cargo/__init__.py +0 -0
  104. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/rust_cargo/actions.py +0 -0
  105. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/rust_cargo/cargo_lambda.py +0 -0
  106. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/rust_cargo/exceptions.py +0 -0
  107. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/rust_cargo/utils.py +0 -0
  108. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders/workflows/rust_cargo/workflow.py +0 -0
  109. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders.egg-info/SOURCES.txt +0 -0
  110. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders.egg-info/dependency_links.txt +0 -0
  111. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders.egg-info/entry_points.txt +0 -0
  112. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/aws_lambda_builders.egg-info/top_level.txt +0 -0
  113. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/pyproject.toml +0 -0
  114. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/requirements/python_pip.txt +0 -0
  115. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/setup.cfg +0 -0
  116. {aws_lambda_builders-1.69.0 → aws_lambda_builders-1.71.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aws_lambda_builders
3
- Version: 1.69.0
3
+ Version: 1.71.0
4
4
  Summary: Python library to compile, build & package AWS Lambda functions for several runtimes & frameworks.
5
5
  Home-page: https://github.com/awslabs/aws-lambda-builders
6
6
  Author: Amazon Web Services
@@ -27,16 +27,18 @@ Classifier: Topic :: Utilities
27
27
  Requires-Python: >=3.10
28
28
  License-File: LICENSE
29
29
  License-File: NOTICE
30
+ Requires-Dist: tomli>=1.1.0; python_version < "3.11"
30
31
  Requires-Dist: setuptools
31
32
  Requires-Dist: wheel
32
33
  Provides-Extra: dev
33
34
  Requires-Dist: coverage==7.15.1; extra == "dev"
34
35
  Requires-Dist: flake8==3.8.4; extra == "dev"
35
36
  Requires-Dist: pytest-cov==6.3.0; extra == "dev"
37
+ Requires-Dist: tomli>=1.1.0; python_version < "3.11" and extra == "dev"
36
38
  Requires-Dist: pytest>=9.1.1; extra == "dev"
37
39
  Requires-Dist: parameterized==0.9.0; extra == "dev"
38
40
  Requires-Dist: pyelftools~=0.33; extra == "dev"
39
- Requires-Dist: black==26.5.1; extra == "dev"
41
+ Requires-Dist: black==26.10.1; extra == "dev"
40
42
  Requires-Dist: ruff==0.16.5; extra == "dev"
41
43
  Dynamic: author
42
44
  Dynamic: author-email
@@ -5,5 +5,5 @@ AWS Lambda Builder Library
5
5
  # Changing version will trigger a new release!
6
6
  # Please make the version change as the last step of your development.
7
7
 
8
- __version__ = "1.69.0"
8
+ __version__ = "1.71.0"
9
9
  RPC_PROTOCOL_VERSION = "0.3"
@@ -279,7 +279,10 @@ def extract_tarfile(tarfile_path: Union[str, os.PathLike], unpack_dir: Union[str
279
279
  if not _is_within_directory(unpack_dir, member_path):
280
280
  raise tarfile.ExtractError("Attempted Path Traversal in Tar File")
281
281
 
282
- tar.extractall(unpack_dir)
282
+ if hasattr(tarfile, "data_filter"):
283
+ tar.extractall(unpack_dir, filter="data")
284
+ else:
285
+ tar.extractall(unpack_dir)
283
286
 
284
287
 
285
288
  def _locale_encoding() -> str:
@@ -15,7 +15,7 @@ UV offers several advantages over pip:
15
15
 
16
16
  Similar to the Python PIP workflow, Python packaging for AWS Lambda presents unique challenges:
17
17
 
18
- 1. **Platform compatibility**: Python packages often contain platform-specific code or compiled extensions that must be compatible with the AWS Lambda runtime environment (Amazon Linux 2)
18
+ 1. **Platform compatibility**: Python packages often contain platform-specific code or compiled extensions that must be compatible with the AWS Lambda runtime environment (Amazon Linux 2 for Python 3.8-3.11, Amazon Linux 2023 for Python 3.12+)
19
19
 
20
20
  2. **Architecture compatibility**: Packages must be compatible with the target Lambda architecture (x86_64 or arm64)
21
21
 
@@ -64,7 +64,8 @@ def build_dependencies(artifacts_dir_path,
64
64
 
65
65
  :type runtime: str
66
66
  :param runtime: Python version to build dependencies for. This can
67
- be python3.8, python3.9, python3.10, python3.11, python3.12, or python3.13.
67
+ be python3.8, python3.9, python3.10, python3.11, python3.12, python3.13,
68
+ python3.14, or python3.15.
68
69
  These are currently the only supported values.
69
70
  Note: This parameter is passed to the PythonUvDependencyBuilder constructor.
70
71
 
@@ -104,37 +105,51 @@ builder.build_dependencies(
104
105
 
105
106
  The general algorithm for preparing a python package using UV for use on AWS Lambda follows a streamlined approach that leverages UV's advanced capabilities:
106
107
 
107
- #### Step 1: Smart manifest detection and dispatch
108
+ #### Step 1: Pick the manifest
108
109
 
109
- The workflow uses a smart dispatch system that recognizes actual manifest files:
110
+ An explicit manifest path is used as given. Without one, the workflow picks a manifest in the
111
+ order listed under [Smart Manifest Detection and Dispatch](#smart-manifest-detection-and-dispatch).
110
112
 
111
- **Supported Manifests:**
112
- - `pyproject.toml` - Modern Python project manifest
113
- - `requirements.txt` - Traditional pip requirements file
114
- - `requirements-*.txt` - Environment-specific variants (dev, prod, test, etc.)
115
-
116
- **Smart Lock File Detection:**
117
- - Look for requirements.txt first
118
- - When `pyproject.toml` is the manifest, automatically checks for `uv.lock` in the same directory
119
- - If `uv.lock` exists alongside `pyproject.toml`, uses lock-based build for precise dependencies
120
- - If no `uv.lock`, uses standard pyproject.toml build with UV's lock and export workflow
121
-
122
- **Important:** `uv.lock` is NOT a standalone manifest - it's a lock file that enhances `pyproject.toml` builds when present.
113
+ When the manifest is `pyproject.toml`, the workflow resolves the workspace root (the project
114
+ directory for a standalone project; see
115
+ [Workspace Resolution Failure Policy](#workspace-resolution-failure-policy)) and uses a
116
+ `uv.lock` found there. `uv.lock` is never a manifest on its own.
123
117
 
124
118
  #### Step 2: Build dependencies based on manifest type
125
119
 
126
120
  **For pyproject.toml with uv.lock present:**
127
121
  - Use `uv export` to convert lock file to requirements.txt format
122
+ - Export with `--locked`, reusing the lock's resolution mode, prerelease mode, fork strategy, and `exclude-newer`
123
+ cutoff so export validates rather than rewrites the existing lock. Stale locks fail the build;
124
+ run `uv lock` explicitly after dependency changes.
125
+ - For relative cutoffs, replay `exclude-newer-span` instead of the lock's placeholder `exclude-newer` date.
126
+ Python 3.10 uses the runtime dependency `tomli` to read lock options; Python 3.11+ uses `tomllib`.
127
+ - Replay each `options.exclude-newer-package` entry with `--exclude-newer-package`, preferring its `span`
128
+ over the placeholder `timestamp` for relative per-package cutoffs.
128
129
  - Install using `uv pip install` with platform targeting (--python-platform)
129
130
  - Provides reproducible builds with locked dependency versions AND cross-platform support
130
131
 
131
132
  **For pyproject.toml without uv.lock:**
132
- - Use `uv lock` to create temporary lock file with resolved dependencies
133
+ - Run `uv lock` from the project directory. uv writes `uv.lock` there, or at the workspace root
134
+ for a workspace member, and the file stays in the source tree after the build
133
135
  - Use `uv export` to convert lock file to requirements.txt format
134
136
  - Install dependencies using `uv pip install` with platform targeting
135
137
 
138
+ **Stale locks:** both pyproject.toml paths run `uv export --locked`, so a `uv.lock` that no longer
139
+ matches `pyproject.toml` fails the build instead of being rewritten. A project without
140
+ `requires-python` that was locked on one Python version can be stale on another runtime; set
141
+ `requires-python` or run `uv lock` again.
142
+
143
+ **Hashes:** the export keeps the lock's hashes, so a project that sets `require-hashes` in
144
+ `[tool.uv.pip]` builds.
145
+
136
146
  **For requirements.txt files:**
137
147
  - Use `uv pip install` directly with Lambda-compatible settings
148
+ - uv runs from the manifest's directory, so local paths in the file (such as `./libs/foo` or
149
+ `-e ../shared`) resolve from there
150
+
151
+ **Local paths in lock builds:** exported local paths are relative to the workspace root, so
152
+ `uv pip install` runs from the workspace root (the project directory for a standalone project).
138
153
 
139
154
  **Why export + pip install instead of uv sync?**
140
155
  `uv sync` doesn't support cross-platform builds (no --python-platform flag). Since Lambda
@@ -145,7 +160,9 @@ the `--python-platform` flag for cross-platform wheel selection.
145
160
  #### Step 3: Configure Lambda-compatible installation
146
161
 
147
162
  UV is configured with Lambda-specific settings:
148
- - Target platform: `linux` (Amazon Linux 2)
163
+ - Target platform: explicit manylinux targets, independent of the build host's glibc.
164
+ Python 3.8-3.11 use `manylinux_2_17` (the AL2-compatible download target used by the pip workflow);
165
+ Python 3.12+ use `manylinux_2_34` for Amazon Linux 2023.
149
166
  - Target architecture: `x86_64` or `aarch64`
150
167
  - Python version matching Lambda runtime
151
168
  - Prefer wheels over source distributions for faster builds
@@ -205,12 +222,70 @@ config = {
205
222
  "no_cache": False, # Disable caching
206
223
  "prerelease": "disallow", # Handle pre-release versions
207
224
  "resolution": "highest", # Resolution strategy
208
- "compile_bytecode": True, # Compile .pyc files
225
+ "compile_bytecode": False, # Opt in to unchecked-hash .pyc compiled with the target Python
209
226
  "exclude_newer": None, # Exclude packages newer than date
210
227
  "generate_hashes": False, # Generate package hashes
211
228
  }
212
229
  ```
213
230
 
231
+ ### Build options
232
+
233
+ `PythonUvWorkflow` reads these keys from the workflow `options` and passes them to `uv export`.
234
+ SAM CLI maps them from `Metadata.BuildProperties`.
235
+
236
+ | Option | SAM CLI property | Type | `uv export` effect |
237
+ |---|---|---|---|
238
+ | `uv_groups` | `UvGroups` | list of str | `--group <name>` per entry |
239
+ | `uv_extras` | `UvExtras` | list of str | `--extra <name>` per entry |
240
+ | `uv_all_extras` | `UvAllExtras` | bool | `--all-extras` |
241
+ | `uv_prune` | `UvPrune` | list of str | `--prune <name>` per entry: drops the package and any dependency only it needs |
242
+ | `uv_compile_bytecode` | `UvCompileBytecode` | bool | none; after install, runs `compileall --invalidation-mode unchecked-hash` with the target Python (also for `requirements.txt` builds) |
243
+
244
+ Default groups stay excluded (`--no-default-groups`); `uv_groups` adds groups on top of that.
245
+ `uv_prune` is meant for packages the Lambda runtime already ships, such as `boto3`. The function then
246
+ uses the runtime's version, which AWS picks, not the version in `uv.lock`.
247
+ The build fails with a clear message, instead of ignoring the option, when:
248
+ - a value has the wrong type, or an unknown `uv_*` key is given;
249
+ - `uv_extras` and `uv_all_extras` are combined;
250
+ - an option other than `uv_compile_bytecode` is set on a `requirements.txt` build (they apply only to
251
+ pyproject.toml / uv.lock projects);
252
+ - a `uv_prune` name is not a package in `uv.lock`, which `uv export --prune` would otherwise ignore.
253
+
254
+ ### Bytecode
255
+
256
+ uv writes timestamp-based `.pyc` files, which the Lambda runtime rejects once SAM normalizes file
257
+ timestamps in the deployment package. So the workflow always passes `--no-compile-bytecode` to
258
+ `uv pip install`, removes `UV_COMPILE_BYTECODE` from that command's environment (uv refuses the flag and
259
+ the variable together), and, when bytecode is enabled, runs the target Python
260
+ (`uv python find --no-project --no-python-downloads <version>`) as
261
+ `python -m compileall -f -q --invalidation-mode unchecked-hash` over the install directory.
262
+
263
+ Bytecode is enabled by `uv_compile_bytecode: true`. When that option isn't given, a truthy
264
+ `UV_COMPILE_BYTECODE` in the build environment enables it too, and the build logs that at INFO. Values are
265
+ read the way uv reads them, case-insensitively: `1`, `true`, `t`, `yes`, `y`, `on` enable it; `0`, `false`,
266
+ `f`, `no`, `n`, `off` leave it off; any other value logs a warning and leaves it off. An explicit
267
+ `uv_compile_bytecode: false` always wins over the variable. If the target Python isn't installed, or the
268
+ runtime gives no version, the build logs a warning and ships no bytecode instead of failing.
269
+
270
+ ### Settings from pyproject.toml
271
+
272
+ The workflow runs `uv export` and `uv pip install` from the project, so uv reads its own settings there.
273
+ Build-control settings in `[tool.uv]` (`no-build`, `no-build-package`, `no-binary`, `no-binary-package`) apply
274
+ to both steps; `[tool.uv.pip]` settings (`no-build`, `no-binary`, `only-binary`) apply to the install. `UV_*`
275
+ environment variables apply to every uv call, except `UV_COMPILE_BYTECODE` (see Bytecode). The workflow's own flags always win: the target platform and
276
+ Python version come from the function's architecture and runtime, default groups are excluded, and nothing
277
+ is installed editable. In a uv workspace only the workspace root's `pyproject.toml` settings are used; a
278
+ member's `[tool.uv]` and `[tool.uv.pip]` tables are ignored. An unknown key in either table makes uv ignore
279
+ every setting in that file. The build log shows uv's warning about it (the workflow logs every `warning:`
280
+ that uv prints, once per build), so check the key names against uv's settings reference.
281
+
282
+ ### uv warnings
283
+
284
+ Every `warning:` block uv prints is logged at WARNING, once per build. Some are harmless, such as
285
+ "Failed to hardlink files; falling back to full copy" when the cache and the target are on
286
+ different file systems. The one to act on is an unknown key in `[tool.uv]` (or `[tool.uv.pip]`):
287
+ uv then ignores every setting in that file.
288
+
214
289
  ### Caching
215
290
 
216
291
  The workflow does not pass `--cache-dir` unless a caller supplies one, so UV uses its own
@@ -224,6 +299,11 @@ and across successive builds. Pointing UV at the build's scratch directory inste
224
299
  discard the cache every time, because that directory is deleted when the build finishes — every
225
300
  function would then re-download its entire dependency set on every build.
226
301
 
302
+ The one exception is a default cache location that can't be created, such as `/.cache/uv` for a
303
+ container build run as a host uid with no home directory (`sam build --use-container
304
+ --mount-with WRITE`). Then the build uses `uv-cache` under the scratch directory and logs a
305
+ warning. Nothing is lost there, because such a container starts with an empty cache anyway.
306
+
227
307
  ### Compatibility with Existing Workflows
228
308
 
229
309
  The UV workflow is designed to be a drop-in replacement for the pip workflow:
@@ -244,7 +324,7 @@ The UV workflow consists of several key components that mirror the PIP workflow
244
324
  2. **PythonUvBuildAction**: Action class that handles dependency resolution
245
325
  3. **UvRunner**: Wrapper around UV command execution
246
326
  4. **SubprocessUv**: Low-level UV subprocess interface
247
- 6. **PythonUvDependencyBuilder**: High-level dependency builder orchestrator
327
+ 5. **PythonUvDependencyBuilder**: High-level dependency builder orchestrator
248
328
 
249
329
  #### File Structure
250
330
  ```
@@ -271,13 +351,17 @@ CAPABILITY = Capability(
271
351
 
272
352
  The workflow uses intelligent manifest detection:
273
353
 
274
- **Supported Manifests (in order of preference):**
275
- 1. `requirements.txt` - Standard pip format
276
- 2. `requirements-*.txt` - Environment-specific variants (dev, test, prod, etc.)
277
- 3. `pyproject.toml` - Modern Python project manifest
354
+ **Auto-detection (when no manifest path is given), in order of preference:**
355
+ 1. `pyproject.toml`, when it is the uv project: a `uv.lock` sits beside it, or its `[project]` table declares a non-empty `dependencies` list
356
+ 2. `requirements.txt`, then `requirements-prod.txt`
357
+ 3. `pyproject.toml` otherwise (metadata or tool settings only, empty `dependencies`, or `dynamic` dependencies)
358
+
359
+ `requirements-dev.txt` and `requirements-test.txt` are never auto-detected: development and test dependencies do not belong in a Lambda package. They can still be passed as an explicit manifest path.
360
+
361
+ On Python 3.10 without `tomli`, declared dependencies cannot be read, so only a `uv.lock` makes `pyproject.toml` win over a requirements file.
278
362
 
279
363
  **Smart Lock File Enhancement:**
280
- - When `pyproject.toml` is used, automatically detects `uv.lock` in the same directory
364
+ - When `pyproject.toml` is used, automatically detects `uv.lock` at the resolved workspace or project root
281
365
  - If `uv.lock` exists, uses lock-based build for reproducible dependencies
282
366
  - If no `uv.lock`, uses standard pyproject.toml workflow with UV's lock and export
283
367
 
@@ -291,12 +375,16 @@ The workflow follows Python ecosystem standards for requirements files:
291
375
  - `requirements-prod.txt` - Production dependencies
292
376
  - `requirements-staging.txt` - Staging dependencies
293
377
 
378
+ Only `requirements.txt` and `requirements-prod.txt` are auto-detected. The others are used only
379
+ when passed as the manifest path.
380
+
294
381
  Note: `requirements.in` (pip-tools format) is not supported to keep the implementation simple and focused.
295
382
 
296
383
  #### UV Binary Requirements
297
384
  - UV must be available on the system PATH
298
385
  - Minimum UV version: 0.1.0 (to be determined based on feature requirements)
299
- - Fallback: Attempt to install UV using pip if not found (optional behavior)
386
+ - Workspace discovery needs UV 0.9.9 or newer; older versions build from the project directory
387
+ - A missing UV raises `MissingUvError`; the workflow does not install UV
300
388
 
301
389
  #### Error Handling Strategy
302
390
  - **MissingUvError**: UV binary not found on PATH (includes path information)
@@ -304,6 +392,39 @@ Note: `requirements.in` (pip-tools format) is not supported to keep the implemen
304
392
  - **UvBuildError**: Package build failures
305
393
  - **LockFileError**: Lock file parsing or validation errors
306
394
 
395
+ #### Workspace Resolution Failure Policy
396
+
397
+ Workspace discovery runs before the lock-file lookup for every `pyproject.toml` build.
398
+ The compatibility fallback to the project directory is deliberately limited to two cases:
399
+
400
+ - A plain `X.Y.Z` UV version is numerically below `0.9.9`; the workspace command is not invoked.
401
+ - The workspace command exits unsuccessfully and stderr contains `unrecognized subcommand 'workspace'`.
402
+
403
+ Both cases log at DEBUG. They additionally emit a WARNING only if a `pyproject.toml`
404
+ in the project directory or an ancestor contains a `tool.uv.workspace` table. This is
405
+ only a diagnostic hint: `members` and `exclude` are not evaluated, so the warning does
406
+ not assert membership or change the chosen root or build path. Unreadable or invalid
407
+ TOML is logged at DEBUG and skipped. The helper lazily imports `tomllib`, or optional
408
+ `tomli` on Python 3.10. If neither is available, it logs at DEBUG and skips configuration
409
+ inspection; no TOML parser is required to build dependencies.
410
+ This preserves the previous behavior for standalone projects
411
+ using unsupported UV versions; it does not provide workspace support for those versions.
412
+ Unknown or prerelease version strings are tested by invoking the workspace command rather
413
+ than assuming support or lack of support.
414
+
415
+ All other command failures raise `UvBuildError` with the diagnostic, and a successful exit
416
+ with empty or whitespace-only output also raises because it supplies no root directory.
417
+ These outcomes do not establish that the project is outside a workspace. Falling back could
418
+ miss an existing workspace-root lock, trigger lock generation, or resolve local dependencies
419
+ from the wrong directory.
420
+
421
+ This intentionally favors stopping on uncertain workspace discovery over continuing a
422
+ potentially incorrect build. Consequently, a standalone project that previously built may
423
+ now stop if workspace discovery fails for an unknown reason. That compatibility limitation
424
+ is accepted rather than treating permission, configuration, or process-start failures as
425
+ evidence that the workspace command is unsupported. The original diagnostic is surfaced
426
+ instead of recommending an upgrade for an unknown cause.
427
+
307
428
  #### Platform Compatibility Matrix
308
429
  | Python Version | x86_64 | arm64 | Status |
309
430
  |---------------|--------|-------|---------|
@@ -313,7 +434,8 @@ Note: `requirements.in` (pip-tools format) is not supported to keep the implemen
313
434
  | python3.11 | ✓ | ✓ | Supported |
314
435
  | python3.12 | ✓ | ✓ | Supported |
315
436
  | python3.13 | ✓ | ✓ | Supported |
316
- | python3.13 | ✓ | ✓ | Supported |
437
+ | python3.14 | ✓ | ✓ | Supported |
438
+ | python3.15 | ✓ | ✓ | Supported |
317
439
 
318
440
  #### Integration with Lambda Builders
319
441
  - Registers with the workflow registry automatically
@@ -8,7 +8,7 @@ from typing import Optional
8
8
  from aws_lambda_builders.actions import ActionFailedError, BaseAction, Purpose
9
9
  from aws_lambda_builders.architecture import X86_64
10
10
 
11
- from .exceptions import MissingUvError, UvBuildError, UvInstallationError
11
+ from .exceptions import LockFileError, MissingUvError, UvBuildError, UvInstallationError
12
12
  from .packager import PythonUvDependencyBuilder, SubprocessUv, UvRunner
13
13
  from .utils import OSUtils, UvConfig
14
14
 
@@ -72,5 +72,5 @@ class PythonUvBuildAction(BaseAction):
72
72
  architecture=self.architecture,
73
73
  config=self.config,
74
74
  )
75
- except (MissingUvError, UvInstallationError, UvBuildError) as ex:
75
+ except (LockFileError, MissingUvError, UvInstallationError, UvBuildError) as ex:
76
76
  raise ActionFailedError(str(ex))