Skip to content

Commit 193b21f

Browse files
authoredNov 21, 2024
Merge from aws/aws-sam-cli/develop
2 parents 91956e9 + 909e5be commit 193b21f

31 files changed

+681
-663
lines changed
 

‎.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ jobs:
154154
ruby-version: "3.3"
155155
- uses: actions/setup-node@v4
156156
with:
157-
node-version: 20
157+
node-version: 22
158158
- uses: actions/setup-java@v4
159159
with:
160160
distribution: 'corretto'

‎DEVELOPMENT_GUIDE.md

+16-15
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Gitpod is free for 50 hours per month - make sure to stop your workspace when yo
2020
## Environment Setup
2121
### 1. Prerequisites (Python Virtual Environment)
2222

23-
AWS SAM CLI is mainly written in Python 3 and we support Python 3.7 and 3.8.
24-
So having a Python environment with aforementioned versions is required.
23+
AWS SAM CLI is mainly written in Python 3 and we support Python 3.8 and above.
24+
So, having a Python environment with this version is required.
2525

2626
Having a dedicated Python virtual environment ensures it won't "pollute" or get "polluted"
2727
by other python packages. Here we introduce two ways of setting up a Python virtual environment:
@@ -163,26 +163,27 @@ contribute to the repository, there are a few more things to consider.
163163

164164
### Make Sure AWS SAM CLI Work in Multiple Python Versions
165165

166-
We support 3.7 and 3.8 versions. Our CI/CD pipeline is setup to run
166+
We support version 3.8 and above. Our CI/CD pipeline is setup to run
167167
unit tests against all Python versions. So make sure you test it
168168
with all versions before sending a Pull Request.
169-
See [Unit testing with multiple Python versions](#unit-testing-with-multiple-python-versions-optional).
169+
See [Unit testing with multiple Python versions](#unit-testing-with-multiple-python-versions-optional).
170+
This is most important if you are developing in a Python version greater than the minimum supported version (currently 3.8), as any new features released in 3.9+ will not work.
170171

171172
If you chose to use `pyenv` in the previous session, setting up a
172173
different Python version should be easy:
173174

174-
(assuming you are in virtual environment `samcli38`)
175+
(assuming you are in virtual environment named `samcli39` with Python version 3.9.x)
175176

176177
```sh
177-
# Your shell now should looks like "(samcli38) $"
178-
pyenv deactivate samcli38 # "(samcli38)" will disappear
179-
pyenv install 3.7.10 # one time setup
180-
pyenv virtualenv 3.7.10 samcli37 # one time setup
181-
pyenv activate samcli37
182-
# Your shell now should looks like "(samcli37) $"
178+
# Your shell now should look like "(samcli39) $"
179+
pyenv deactivate samcli39 # "(samcli39)" will disappear
180+
pyenv install 3.8.9 # one time setup
181+
pyenv virtualenv 3.8.9 samcli38 # one time setup
182+
pyenv activate samcli38
183+
# Your shell now should look like "(samcli38) $"
183184

184185
# You can verify the version of Python
185-
python --version # Python 3.7.10
186+
python --version # Python 3.8.9
186187

187188
make init # one time setup, this will put a file `samdev` available in $PATH
188189
```
@@ -255,9 +256,9 @@ We also suggest to run `make pr` or `./Make -pr` in all Python versions.
255256
#### Unit Testing with Multiple Python Versions (Optional)
256257

257258
Currently, SAM CLI only supports Python3 versions (see setup.py for exact versions). For the most
258-
part, code that works in Python3.7 will work in Python3.8. You only run into problems if you are
259-
trying to use features released in a higher version (for example features introduced into Python3.8
260-
will not work in Python3.7). If you want to test in many versions, you can create a virtualenv for
259+
part, code that works in Python3.8 will work in Python3.9. You only run into problems if you are
260+
trying to use features released in a higher version (for example features introduced into Python3.9
261+
will not work in Python3.8). If you want to test in many versions, you can create a virtualenv for
261262
each version and flip between them (sourcing the activate script). Typically, we run all tests in
262263
one python version locally and then have our ci (appveyor) run all supported versions.
263264

‎appveyor-windows-al2023.yml

+2-14
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,8 @@ install:
5454
# Make sure the temp directory exists for Python to use.
5555
- ps: "mkdir -Force C:\\tmp"
5656
- "python --version"
57-
# Temporarily install python3.13 from the embedded zip file. Once AppVeyor installs it in the image, the below code can be removed.
58-
- ps: 'Invoke-WebRequest -Uri https://www.python.org/ftp/python/3.13.0/python-3.13.0-embed-amd64.zip -OutFile python313.zip'
59-
- ps: "Expand-Archive -Path python313.zip -DestinationPath C:\\Python313-x64"
60-
- 'set PATH=%PYTHON_HOME%;C:\Ruby33-x64\bin;C:\Ruby32-x64\bin;%PATH%;C:\Python39-x64;C:\Python310-x64;C:\Python311-x64;C:\Python312-x64;C:\Python313-x64;C:\Python313-x64\Scripts;'
61-
- ps: |
62-
$pth_file = "C:\Python313-x64\python313._pth"
63-
(Get-Content -Path $pth_file) -replace '#import site', 'import site' | Set-Content -Path $pth_file
64-
- ps: |
65-
if (!(Test-Path -Path "C:\Python313-x64\Scripts\pip.exe")) {
66-
Invoke-WebRequest -Uri https://bootstrap.pypa.io/get-pip.py -OutFile get-pip.py
67-
& "C:\Python313-x64\python.exe" get-pip.py
68-
}
69-
- "python --version"
70-
- ps: pip --version
57+
- 'set PATH=%PYTHON_HOME%;C:\Ruby33-x64\bin;C:\Ruby32-x64\bin;%PATH%;C:\Python39-x64;C:\Python310-x64;C:\Python311-x64;C:\Python312-x64;C:\Python313-x64'
58+
- "node --version"
7159
- "echo %PYTHON_HOME%"
7260
- "echo %PATH%"
7361
- "python --version"

‎requirements/base.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ jmespath~=1.0.1
66
ruamel_yaml~=0.18.6
77
PyYAML~=6.0
88
cookiecutter~=2.6.0
9-
aws-sam-translator==1.92.0
9+
aws-sam-translator==1.93.0
1010
#docker minor version updates can include breaking changes. Auto update micro version only.
1111
docker~=7.1.0
1212
dateparser~=1.2
1313
requests~=2.32.3
14-
aws_lambda_builders==1.51.0
14+
aws_lambda_builders==1.52.0
1515
tomlkit==0.13.2
1616
# NOTE: For supporting watchdog in Python3.8, version is pinned to 4.0.2 as
1717
# version 5.0.2 introduced some breaking changes for versions > Python3.8
@@ -34,4 +34,4 @@ tzlocal==5.2
3434
cfn-lint~=1.19.0
3535

3636
# Type checking boto3 objects
37-
boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.35.56
37+
boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]==1.35.63

‎requirements/dev.txt

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
-r pre-dev.txt
22

3-
coverage==7.6.4; python_version>="3.9"
3+
coverage==7.6.7; python_version>="3.9"
44
coverage==7.6.1; python_version<"3.9"
5-
pytest-cov==5.0.0
5+
pytest-cov==6.0.0; python_version>="3.9"
6+
pytest-cov==5.0.0; python_version<"3.9"
67

78

89
# type checking and related stubs
910
# mypy adds new rules in new minor versions, which could cause our PR check to fail
1011
# here we fix its version and upgrade it manually in the future
11-
mypy==1.11.2
12+
mypy==1.13.0
1213
types-pywin32==308.0.0.20241029
1314
types-PyYAML==6.0.12.20240917
1415
types-chevron==0.14.2.20240310
1516
types-psutil==6.1.0.20241102
16-
types-setuptools==75.3.0.20241107
17+
types-setuptools==75.5.0.20241116
1718
types-Pygments==2.18.0.20240506
1819
types-colorama==0.4.15.20240311
1920
types-dateparser==1.2.0.20240420

‎requirements/pre-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ruff==0.7.2
1+
ruff==0.7.4

‎requirements/pyinstaller-build.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Executable binary builder requirements
22
setuptools==75.3.0
3-
pyinstaller==6.11.0
3+
pyinstaller==6.11.1

0 commit comments

Comments
 (0)
Failed to load comments.