Skip to content

Commit

Permalink
Upgrade to Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
gjclark committed Sep 17, 2024
1 parent 6f0ad20 commit 9d441be
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.10.15
- run: pip install -r requirements/requirements-docs.txt
- run: mkdocs gh-deploy --force

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.10.15

- uses: TrueBrain/actions-flake8@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.10.15

- name: Install dependencies
run: |
Expand Down
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ DOCKER := docker
# On Linux we need to do a bit of userid finagling so that the output files
# end up being owned by us and not by root. On Mac this works out of the box.
DOCKER_USER_ARG := --user "$(shell id -u):$(shell id -g)"
DOCKER_COMMAND = $(DOCKER) run --rm $(DOCKER_USER_ARG) -v "$$PWD":/var/task $(DOCKER_ARGS)
DOCKER_COMMAND = $(DOCKER) run --rm $(DOCKER_USER_ARG) -v "$$PWD":/var/task $(DOCKER_ARGS) --entrypoint ""

PYTHON := python3
BUILD_VENV := $(DIR)/.venv
Expand All @@ -57,7 +57,6 @@ Makefile.config:
include Makefile.config

ifdef DOCKER_COMMAND
DOCKER_LAMBDA_CI = $(DOCKER_COMMAND) lambci/lambda:build-python3.8
DOCKER_DEPENDENCY_BUILDER = $(DOCKER_COMMAND) tea-dependency-builder
endif

Expand All @@ -71,7 +70,7 @@ all: build ;

# Build everything
.PHONY: build
build: \
build: tea-dependency-builder \
$(DIR)/thin-egress-app-code.zip \
$(DIR)/thin-egress-app-dependencies.zip \
$(DIR)/thin-egress-app.yaml \
Expand Down Expand Up @@ -106,7 +105,7 @@ $(BUILD_VENV): requirements/requirements-make.txt
$(DIR)/thin-egress-app-dependencies.zip: requirements/requirements.txt $(REQUIREMENTS_DEPS)
rm -rf $(DIR)/python
@mkdir -p $(DIR)/python
$(DOCKER_LAMBDA_CI) build/dependency_builder.sh "$(DIR)/thin-egress-app-dependencies.zip" "$(DIR)"
$(DOCKER_DEPENDENCY_BUILDER) build/dependency_builder.sh "$(DIR)/thin-egress-app-dependencies.zip" "$(DIR)"

.SECONDARY: $(DIST_MD_RESOURCES)
$(DIST_MD_RESOURCES): $(DIR)/code/%.html: %.md $(BUILD_VENV)
Expand Down Expand Up @@ -271,8 +270,8 @@ cleandeploy:
###############

.PHONY: tea-dependency-builder
tea-dependency-builder: build/lambda-ci.Dockerfile
$(DOCKER) build -f build/lambda-ci.Dockerfile -t tea-dependency-builder ./build
tea-dependency-builder: build/tea-dependency-builder.Dockerfile
$(DOCKER) build -f build/tea-dependency-builder.Dockerfile -t tea-dependency-builder ./build
@mkdir -p $(EMPTY)
@touch $@

Expand Down
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ releases see the [GitHub Actions README](.github/workflows/README.md).*
In order to build TEA, you will need to have a few tools installed:

- `make` for build automation
- `python3.8` for running tests and creating the CloudFormation template
- `python3.10` for running tests and creating the CloudFormation template
- `docker` for building the dependency layer
- `git` for installing rain-api-core
- `zip` for creating zip files
Expand Down
2 changes: 1 addition & 1 deletion build/dependency_builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mkdir -p $BUILD_DIR/python
cd $BUILD_DIR/python || exit

echo "Installing ${REQUIREMENTS_FILE}"
python3.8 -m pip install \
python3 -m pip install \
--upgrade \
-r "$REQUIREMENTS_FILE" \
--target $BUILD_DIR/python \
Expand Down
3 changes: 0 additions & 3 deletions build/lambda-ci.Dockerfile

This file was deleted.

4 changes: 4 additions & 0 deletions build/tea-dependency-builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM public.ecr.aws/lambda/python:3.10

RUN yum install -y git zip
RUN pip install pip-tools
7 changes: 4 additions & 3 deletions cloudformation/thin-egress-app.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ Resources:
vpcid: !Sub "${PrivateVPC}"
Timeout: !Ref LambdaTimeout
Handler: update_lambda.lambda_handler
Runtime: 'python3.8'
Runtime: 'python3.10'
Layers:
- !Ref EgressLambdaDependencyLayer
#MemorySize: 128
Expand Down Expand Up @@ -561,6 +561,7 @@ Resources:
- python3.6
- python3.7
- python3.8
- python3.10
Content:
S3Bucket: !Ref LambdaCodeS3Bucket
S3Key: !Ref LambdaCodeDependencyArchive
Expand Down Expand Up @@ -630,7 +631,7 @@ Resources:
OTEL_COLLECTOR_URL: !Ref OtCollectorURL
Timeout: !Ref LambdaTimeout
Handler: app.app
Runtime: 'python3.8'
Runtime: 'python3.10'
Layers:
- !Ref EgressLambdaDependencyLayer
- !Sub "arn:aws:lambda:${AWS::Region}:901920570463:layer:aws-otel-python-amd64-ver-1-25-0:1"
Expand Down Expand Up @@ -1110,7 +1111,7 @@ Resources:
BUILD_VERSION: "{{ build_version }}"
MATURITY: !Ref Maturity
Handler: tea_bumper.lambda_handler
Runtime: 'python3.8'
Runtime: 'python3.10'
Layers:
- !Ref EgressLambdaDependencyLayer

Expand Down
10 changes: 4 additions & 6 deletions requirements/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile requirements/requirements-dev.in
Expand Down Expand Up @@ -40,12 +40,10 @@ docker==7.1.0
# via moto
exceptiongroup==1.2.2
# via pytest
idna==3.8
idna==3.10
# via requests
importlib-metadata==7.1.0
# via
# build
# opentelemetry-api
# via opentelemetry-api
iniconfig==2.0.0
# via pytest
jinja2==3.1.4
Expand Down Expand Up @@ -140,7 +138,7 @@ wrapt==1.16.0
# opentelemetry-instrumentation
xmltodict==0.13.0
# via moto
zipp==3.20.1
zipp==3.20.2
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
Expand Down
2 changes: 1 addition & 1 deletion tea-cli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ packages = [{include = "tea_cli"}]
tea = "tea_cli:main.main"

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.10"
boto3 = "^1.26.163"
cryptography = "^41.0.1"

Expand Down
2 changes: 1 addition & 1 deletion tests/test_tea_bumper.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_lambda(client_iam, client_lambda, test_lambda_code_zip):

client_lambda.create_function(
FunctionName="test-lambda",
Runtime="python3.8",
Runtime="python3.10",
Role=role["Arn"],
Code={
"ZipFile": b64encode(test_lambda_code_zip)
Expand Down

0 comments on commit 9d441be

Please sign in to comment.