Skip to content

Commit

Permalink
Drop support for Python 3.7
Browse files Browse the repository at this point in the history
Following the policy outlined in:

https://aws.amazon.com/blogs/developer/python-support-policy-updates-for-aws-sdks-and-tools/

The PSF dropped support for Python 3.7 June 2023, and the AWS SDKs
dropped support for Python 3.7 December 2023.  You can also no longer
create or update Lambda functions on Python 3.7.
  • Loading branch information
jamesls committed Feb 21, 2024
1 parent 670130e commit 3b5ab21
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 33 deletions.
22 changes: 1 addition & 21 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,11 @@ jobs:
make install-dev-deps
- name: Run PRCheck
run: make prcheck
testsonly:
runs-on: ${{ matrix.os }}
env:
HYPOTHESIS_PROFILE: ci
CHALICE_TEST_EXTENDED_PACKAGING: true
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Set up Python ${{ matrix.python-version }}
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements-test.txt --upgrade --upgrade-strategy eager -e .
- name: Run Tests
run: make coverage
cdktests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', 3.11]
python-version: [3.8, 3.9, '3.10', 3.11]
cdk-version: [cdk, cdkv2]
steps:
- uses: actions/checkout@v2
Expand Down
20 changes: 11 additions & 9 deletions chalice/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,18 @@ def lambda_python_version(self) -> str:
# we attempt to match your python version to the closest version
# supported by lambda.
major, minor = sys.version_info[0], sys.version_info[1]
if major == 2:
return 'python2.7'
# Python 3 for backwards compatibility needs to select python3.6
# for python versions 3.0-3.6. 3.7-3.10 will use their version.
# 3.11 and higher will use 3.11
elif (major, minor) <= (3, 6):
return 'python3.6'
elif (major, minor) <= (3, 10):
# We default to the minimum version supported by Lambda if you're
# using an version no longer supported by Lambda.
if (major, minor) < (3, 8):
return 'python3.8'
elif (major, minor) <= (3, 12):
# Otherwise we use your current version of python if Lambda
# supports it.
return 'python%s.%s' % (major, minor)
return 'python3.11'
else:
# Otherwise if you're using a new version than what's supported
# by Lambda we default to the latest version Lambda supports.
return 'python3.11'

@property
def log_retention_in_days(self) -> int:
Expand Down
3 changes: 0 additions & 3 deletions chalice/deploy/packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ class BaseLambdaDeploymentPackager(object):
_VENDOR_DIR = 'vendor'

_RUNTIME_TO_ABI = {
'python2.7': 'cp27mu',
'python3.6': 'cp36m',
'python3.7': 'cp37m',
'python3.8': 'cp38',
'python3.9': 'cp39',
'python3.10': 'cp310',
Expand Down

0 comments on commit 3b5ab21

Please sign in to comment.