Skip to content

Commit e454f2e

Browse files
committed
Drop python3.7 support for SAM-T
1 parent 4ff61a5 commit e454f2e

27 files changed

+39
-76
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
os:
2121
- ubuntu-latest
2222
python:
23-
- "3.7"
2423
- "3.8"
2524
- "3.9"
2625
- "3.10"

DEVELOPMENT_GUIDE.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Environment setup
2626
-----------------
2727
### 1. Install Python versions
2828

29-
Our officially supported Python versions are 3.7, 3.8, 3.9 and 3.10.
29+
Our officially supported Python versions are 3.8, 3.9 and 3.10.
3030
Our CI/CD pipeline is setup to run unit tests against Python 3 versions. Make sure you test it before sending a Pull Request.
3131
See [Unit testing with multiple Python versions](#unit-testing-with-multiple-python-versions).
3232

@@ -40,12 +40,11 @@ easily setup multiple Python versions. For
4040
1. Install PyEnv -
4141
`curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash`
4242
1. Restart shell so the path changes take effect - `exec $SHELL`
43-
1. `pyenv install 3.7.16`
4443
1. `pyenv install 3.8.16`
4544
1. `pyenv install 3.9.16`
4645
1. `pyenv install 3.10.9`
4746
3. Make Python versions available in the project:
48-
`pyenv local 3.7.16 3.8.16 3.9.16 3.10.9`
47+
`pyenv local 3.8.16 3.9.16 3.10.9`
4948

5049
Note: also make sure the following lines were written into your `.bashrc` (or `.zshrc`, depending on which shell you are using):
5150
```
@@ -66,7 +65,7 @@ can be found [here](https://black.readthedocs.io/en/stable/editor_integration.ht
6665
Since black is installed in virtualenv, when you follow [this instruction](https://black.readthedocs.io/en/stable/editor_integration.html), `which black` might give you this
6766

6867
```bash
69-
(sam37) $ where black
68+
(sam38) $ where black
7069
/Users/<username>/.pyenv/shims/black
7170
```
7271

@@ -77,11 +76,11 @@ and this will happen:
7776
pyenv: black: command not found
7877
7978
The `black' command exists in these Python versions:
80-
3.7.9/envs/sam37
81-
sam37
79+
3.8.16/envs/sam38
80+
sam38
8281
```
8382

84-
A simple workaround is to use `/Users/<username>/.pyenv/versions/sam37/bin/black`
83+
A simple workaround is to use `/Users/<username>/.pyenv/versions/sam38/bin/black`
8584
instead of `/Users/<username>/.pyenv/shims/black`.
8685

8786
#### Pre-commit
@@ -99,15 +98,15 @@ handy plugin that can create virtualenv.
9998
Depending on the python version, the following commands would change to
10099
be the appropriate python version.
101100

102-
1. Create Virtualenv `sam37` for Python3.7: `pyenv virtualenv 3.7.9 sam37`
103-
1. Activate Virtualenv: `pyenv activate sam37`
101+
1. Create Virtualenv `sam38` for Python3.8: `pyenv virtualenv 3.8.16 sam38`
102+
1. Activate Virtualenv: `pyenv activate sam38`
104103

105104
### 4. Install dev version of SAM transform
106105

107106
We will install a development version of SAM transform from source into the
108107
virtualenv.
109108

110-
1. Activate Virtualenv: `pyenv activate sam37`
109+
1. Activate Virtualenv: `pyenv activate sam38`
111110
1. Install dev version of SAM transform: `make init`
112111

113112
Running tests
@@ -121,8 +120,8 @@ Run `make test` or `make test-fast`. Once all tests pass make sure to run
121120

122121
### Unit testing with multiple Python versions
123122

124-
Currently, our officially supported Python versions are 3.7, 3.8, 3.9 and 3.10. For the most
125-
part, code that works in Python3.7 will work in Pythons 3.8, 3.9 and 3.10. You only run into problems if you are
123+
Currently, our officially supported Python versions are 3.8, 3.9 and 3.10. For the most
124+
part, code that works in Python3.8 will work in Pythons 3.9 and 3.10. You only run into problems if you are
126125
trying to use features released in a higher version (for example features introduced into Python3.10
127126
will not work in Python3.9). If you want to test in many versions, you can create a virtualenv for
128127
each version and flip between them (sourcing the activate script). Typically, we run all tests in

HOWTO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Check out the [latest specification](versions/2016-10-31.md) for details on how
2121
You could also use the [aws-sam-cli](https://github.com/awslabs/aws-sam-cli) to get started
2222

2323
```shell
24-
$ sam init --runtime python3.7
24+
$ sam init --runtime python3.8
2525
```
2626
## Packing Artifacts
2727
Before you can deploy a SAM template, you should first upload your Lambda

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ For a more thorough introduction, see the [this tutorial](https://docs.aws.amazo
8585
8686
### Setting up development environment
8787
88-
You'll need to have Python 3.7+ installed.
88+
You'll need to have Python 3.8+ installed.
8989
9090
Create a [virtual environment](https://docs.python.org/3/library/venv.html):
9191

bin/transform-test-error-json-format.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
import sys
99
from pathlib import Path
1010

11-
from typing_extensions import Final
12-
1311
# To allow this script to be executed from other directories
1412
sys.path.insert(0, str(Path(__file__).absolute().parent.parent))
1513

1614
import json
17-
from typing import Type
15+
from typing import Final, Type
1816

1917
from bin._file_formatter import FileFormatter
2018

integration/helpers/deployer/utils/colors.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
Wrapper to generated colored messages for printing in Terminal
33
This was ported over from the sam-cli repo
44
"""
5-
from typing import Dict
6-
7-
from typing_extensions import Literal
5+
from typing import Dict, Literal
86

97
SupportedColor = Literal["red", "green", "yellow"]
108

integration/ruff.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ select = [
1515
"UP", # pyupgrade
1616
]
1717

18-
# Mininal python version we support is 3.7
19-
target-version = "py37"
18+
# Mininal python version we support is 3.8
19+
target-version = "py38"
2020

2121
[per-file-ignores]
2222

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.black]
22
line-length = 120
3-
target_version = ['py37', 'py38', 'py39', 'py310']
3+
target_version = ['py38', 'py39', 'py310']
44
exclude = '''
55
66
(

pytest.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ filterwarnings =
1414
# From our own tests
1515
ignore:__init__ is deprecated and will be removed in a future release:DeprecationWarning
1616
ignore:deprecated_function is deprecated and will be removed in a future release, please use replacement_function:DeprecationWarning
17-
# Python 3.7 deprecation
18-
ignore::boto3.exceptions.PythonDeprecationWarning
1917
# https://github.com/pytest-dev/pytest-xdist/issues/825#issuecomment-1292450429
2018
ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning
2119
# Pytest warnings

requirements/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
boto3>=1.19.5,==1.*
22
jsonschema<5,>=3.2 # TODO: evaluate risk of removing jsonschema 3.x support
3-
typing_extensions>=4.4,<5 # 3.7 doesn't have Literal
3+
typing_extensions>=4.4 # 3.8 doesn't have Required, TypeGuard and ParamSpec
44

55
# resource validation & schema generation
66
pydantic>=1.8,<3

0 commit comments

Comments
 (0)