Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy on python 3.12 #101

Merged
merged 14 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
version: 2.1
orbs:
codecov: codecov/codecov@4.0.1
aws-cli: circleci/aws-cli@4.1.3
codecov: codecov/codecov@4.1.0
aws-cli: circleci/aws-cli@4.2.3

jobs:
install_and_update_dependencies:
docker:
- image: cimg/python:3.10-browsers
- image: cimg/python:3.12-browsers
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "Pipfile.lock" }}
- run: &install-pipenv pip install -U pipenv pip --quiet --no-input
- run: pipenv install --dev
- run: pipenv sync --dev
- run: pipenv run pipenv check # before save_cache so an insecure cache is never saved
- run: pipenv requirements > postcode_lookup/requirements.txt
- persist_to_workspace:
Expand All @@ -29,10 +29,9 @@ jobs:

test:
docker:
- image: cimg/python:3.10
- image: cimg/python:3.12
environment:
CIRCLECI: true
PGHOST: 127.0.0.1
working_directory: ~/repo

steps:
Expand All @@ -42,15 +41,13 @@ jobs:
keys:
- v2-dependencies-{{ checksum "Pipfile.lock" }}
- run: *install-pipenv
- run: pipenv run ruff
- run: pipenv run ruff-format
- run: pipenv run ruff check .
- run: pipenv run ruff format . --check
- run:
name: Install Playwright-deps
command: |
sudo `pipenv --venv`/bin/playwright install-deps
- run: pipenv run playwright install
- run: pipenv run ruff
- run: pipenv run ruff-format
- run: pipenv run pytest --cov-report= --cov=postcode_lookup --junitxml=test-reports/junit.xml
- codecov/upload:
file: /home/circleci/repo/test-reports/junit.xml
Expand All @@ -62,22 +59,21 @@ jobs:

sam_build:
docker:
- image: public.ecr.aws/sam/build-python3.10:latest
- image: public.ecr.aws/sam/build-python3.12:latest
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: ~/repo/
# - run: pip install --upgrade pip
# - run: pip install -r postcode_lookup/requirements.txt
- run: pip install setuptools wheel
- run: sam build ${DASH_DASH_DEBUG} --template-file template.yaml
- persist_to_workspace:
root: ~/repo/
paths: [ .aws-sam/build/ ]

sam_deploy:
docker:
- image: cimg/python:3.10
- image: cimg/python:3.12
working_directory: ~/repo/
parameters:
dc-environment:
Expand Down Expand Up @@ -116,7 +112,7 @@ jobs:

static_deploy:
docker:
- image: cimg/python:3.10
- image: cimg/python:3.12
working_directory: ~/repo/
parameters:
dc-environment:
Expand Down Expand Up @@ -153,7 +149,7 @@ jobs:

smoke_test:
docker:
- image: cimg/python:3.10
- image: cimg/python:3.12
working_directory: ~/repo/
parameters:
dc-environment:
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10
3.12
6 changes: 2 additions & 4 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ pytest-asyncio = "*"
pytest-playwright = "*"
pre-commit = "*"
freezegun = "*"
playwright = "==1.45.1"

[requires]
python_version = "3.10"
python_version = "3.12"

[scripts]
pytest = "pytest"
ruff = "ruff check"
ruff-format = "ruff format ."
build_templates = "python lib/template_generator/generate_base_template.py"
20 changes: 10 additions & 10 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Installation

Python >= 3.10 required.
Python >= 3.12 required.

Make a new virtualenv.

```shell
$ pip install -U pip
$ pip install pipenv
$ pipenv install --dev
$ pipenv sync --dev
$ playwright install
```

Run tests:
Expand Down
1 change: 0 additions & 1 deletion postcode_lookup/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
endpoint=design_system_view,
name="design_system_view",
),

# Route(
# "/mock/polling-stations/{postcode}/{uprn}",
# endpoint=sandbox_uprn_view,
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ exclude_lines = [
"if __name__ == .__main__.:",
"@abstractmethod"
]

[tool.pytest.ini_options]
pythonpath = ["postcode_lookup"]
3 changes: 0 additions & 3 deletions pytest.ini

This file was deleted.

2 changes: 1 addition & 1 deletion template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Resources:
Timeout: 60
CodeUri: postcode_lookup
Handler: app.handler
Runtime: python3.10
Runtime: python3.12
MemorySize: 512
Environment:
Variables:
Expand Down
Loading