Skip to content

Commit

Permalink
Update Python from 3.8 to 3.10 (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer authored May 5, 2023
1 parent f13a11a commit 17e15d4
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/webviz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.10"
cache: pip

- name: 📦 Install poetry and dependencies
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,17 @@ in the Python backend. In order to update the auto-generated code you can either

In both cases the backend needs to already be running (e.g. using `docker-compose`
as stated above).


# Update `poetry.lock` through Docker

If you do not have the correct Python version and/or `poetry` installed on your host
machine, you can update the `poetry.lock` command through `docker`:

```bash
docker build -f backend.Dockerfile -t backend:latest .
CONTAINER_ID=$(docker run --detach --env WEBVIZ_CLIENT_SECRET=0 backend:latest)
docker exec -it $CONTAINER_ID sh -c "poetry lock --no-update"
docker cp $CONTAINER_ID:/home/appuser/backend/poetry.lock ./backend/poetry.lock
docker stop $CONTAINER_ID
```
2 changes: 1 addition & 1 deletion backend.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-slim@sha256:dd13c1d6433ecfa15dcf774d8fcce87cf790f0f85f96d21d2e81b31ad2e42e13
FROM python:3.10-slim@sha256:79aa96a96eeccf6e13a240f24c8630dc1069efd20f8c289c8f90914dcae83c11

# For now we need git since SUMO Python packages are not deployed to PyPI
RUN apt-get update && apt-get install -y git \
Expand Down
47 changes: 3 additions & 44 deletions backend/poetry.lock

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

2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ readme = "README.md"


[tool.poetry.dependencies]
python = "^3.8"
python = "^3.10"
fastapi = "^0.89.1"
uvicorn = "^0.20.0"
msal = "1.20.0" # Lock version until we fix issues introduced by 1.21.0, see https://github.com/equinor/webviz/issues/105
Expand Down

0 comments on commit 17e15d4

Please sign in to comment.