Skip to content

Commit 2d423df

Browse files
authored
Merge pull request #2138 from jonathan343/3.8-removal
Drop support for Python 3.8
2 parents d3d4f08 + 70e3bd6 commit 2d423df

File tree

17 files changed

+43
-71
lines changed

17 files changed

+43
-71
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "feature",
3+
"category": "Python",
4+
"description": "Drop support for Python 3.8 (#2138)"
5+
}

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: [ubuntu-latest, macos-latest]
20-
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]
20+
python-version: [3.9, '3.10', 3.11, 3.12]
2121
steps:
2222
- uses: actions/checkout@v2
2323
- uses: actions/setup-python@v2
@@ -33,7 +33,7 @@ jobs:
3333
runs-on: ubuntu-latest
3434
strategy:
3535
matrix:
36-
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]
36+
python-version: [3.9, '3.10', 3.11, 3.12]
3737
steps:
3838
- uses: actions/checkout@v2
3939
- uses: actions/setup-node@v2

CONTRIBUTING.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ First, create a virtual environment for chalice::
6666
$ virtualenv venv
6767
$ source venv/bin/activate
6868

69-
Keep in mind that chalice is designed to work with AWS Lambda,
70-
so you should ensure your virtual environment is created with
71-
python2.7, python3.6, or python3.7, which are the versions of python currently supported by
72-
AWS Lambda.
69+
Keep in mind that chalice is designed to work with AWS Lambda.
70+
Make sure to create your virtual environment using Python 3.9 to 3.12,
71+
as these are versions currently supported by both AWS Lambda and chalice.
7372

7473
Next, you'll need to install chalice. The easiest way to configure this
7574
is to use::

README.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,17 @@ Quickstart
109109
.. quick-start-begin
110110
111111
In this tutorial, you'll use the ``chalice`` command line utility
112-
to create and deploy a basic REST API. This quickstart uses Python 3.7,
112+
to create and deploy a basic REST API. This quickstart uses Python 3.9,
113113
but AWS Chalice supports all versions of python supported by AWS Lambda,
114-
which includes Python 3.7 through python 3.12.
114+
which includes Python 3.9 through python 3.12.
115115

116116
To install Chalice, we'll first create and activate a virtual environment
117-
in python3.7::
117+
in python3.9::
118118

119119
$ python3 --version
120-
Python 3.7.3
121-
$ python3 -m venv venv37
122-
$ . venv37/bin/activate
120+
Python 3.9.22
121+
$ python3 -m venv venv39
122+
$ . venv39/bin/activate
123123

124124
Next we'll install Chalice using ``pip``::
125125

chalice/awsclient.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@
5050
from botocore.vendored.requests.exceptions import (
5151
ReadTimeout as RequestsReadTimeout,
5252
)
53-
try:
54-
from typing import TypedDict
55-
except ImportError:
56-
from typing_extensions import TypedDict
53+
from typing import TypedDict
5754

5855
from chalice.constants import DEFAULT_STAGE_NAME
5956
from chalice.constants import MAX_LAMBDA_DEPLOYMENT_SIZE

chalice/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ def lambda_python_version(self) -> str:
148148
# we attempt to match your python version to the closest version
149149
# supported by lambda.
150150
major, minor = sys.version_info[0], sys.version_info[1]
151-
if (major, minor) < (3, 8):
152-
return 'python3.8'
151+
if (major, minor) < (3, 9):
152+
return 'python3.9'
153153
elif (major, minor) <= (3, 11):
154154
# Otherwise we use your current version of python if Lambda
155155
# supports it.
156-
return 'python%s.%s' % (major, minor)
156+
return f'python{major}.{minor}'
157157
return 'python3.12'
158158

159159
@property

chalice/deploy/packager.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ class BaseLambdaDeploymentPackager(object):
7676
_VENDOR_DIR = 'vendor'
7777

7878
_RUNTIME_TO_ABI = {
79-
'python3.8': 'cp38',
8079
'python3.9': 'cp39',
8180
'python3.10': 'cp310',
8281
'python3.11': 'cp311',

chalice/pipeline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ def __init__(self, app_name, lambda_python_version,
9090
chalice_version_range=None, pipeline_version='v1'):
9191
# type: (str, str, Optional[str], str, Optional[str], str) -> None
9292
self.app_name = app_name
93-
# lambda_python_version is what matches lambda, e.g. 'python3.7'.
93+
# lambda_python_version is what matches lambda, e.g. 'python3.9'.
9494
self.lambda_python_version = lambda_python_version
95-
# py_major_minor is just the version string, e.g. '3.7'
95+
# py_major_minor is just the version string, e.g. '3.9'
9696
self.py_major_minor = self._extract_version(lambda_python_version)
9797
self.codebuild_image = codebuild_image
9898
self.code_source = code_source
@@ -162,7 +162,7 @@ def _validate_python_version(self, python_version):
162162
major, minor = [
163163
int(v) for v in python_version.split('.')
164164
]
165-
if (major, minor) < (3, 7):
165+
if (major, minor) < (3, 9):
166166
raise InvalidCodeBuildPythonVersion(
167167
python_version,
168168
'This CodeBuild image does not support python version: %s' % (

docs/source/tutorials/customdomain.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ If you haven't already setup and configured Chalice, see the
1313
to create a basic Chalice app::
1414

1515
$ python3 --version
16-
Python 3.7.3
17-
$ python3 -m venv venv37
18-
$ . venv37/bin/activate
16+
Python 3.9.22
17+
$ python3 -m venv venv39
18+
$ . venv39/bin/activate
1919
$ python3 -m pip install chalice
2020
$ chalice new-project customdomain
2121
$ cd customdomain

docs/source/tutorials/events.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ If you haven't already setup and configured Chalice, see the
1616
basic Chalice app created with::
1717

1818
$ python3 --version
19-
Python 3.7.3
20-
$ python3 -m venv venv37
21-
$ . venv37/bin/activate
19+
Python 3.9.22
20+
$ python3 -m venv venv39
21+
$ . venv39/bin/activate
2222
$ python3 -m pip install chalice
2323
$ chalice new-project chalice-sns-demo
2424
$ cd chalice-sns-demo

0 commit comments

Comments
 (0)