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

feat(python): python 3.10 upgrade #47

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:9.6
image: postgres:13
env:
POSTGRES_USER: metadata_user
POSTGRES_PASSWORD: metadata_pass
Expand All @@ -18,10 +18,10 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.10.2
- uses: actions/cache@preview
with:
path: ~/.cache/pypoetry/virtualenvs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Set up Python 3.7
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.10.2
- uses: actions/cache@preview
with:
path: ~/.cache/pypoetry/virtualenvs
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ celerybeat-schedule

# virtualenv
.venv
.venv*/
venv/
ENV/

Expand Down
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM quay.io/cdis/python:3.7-alpine as base
FROM quay.io/cdis/python:python3.10-buster-pybase3-3.0.2 as base

FROM base as builder
RUN apk add --no-cache --virtual .build-deps gcc musl-dev libffi-dev openssl-dev make postgresql-dev git curl rust cargo
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
RUN pip install --upgrade pip poetry
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential gcc make musl-dev libffi-dev libssl-dev git curl
COPY . /src/
WORKDIR /src
RUN python -m venv /env && . /env/bin/activate && $HOME/.poetry/bin/poetry install --no-interaction
RUN python -m venv /env && . /env/bin/activate && poetry install -vv --no-interaction

FROM base
RUN apk add --no-cache postgresql-libs curl
COPY --from=builder /root/.poetry /root/.poetry
RUN apt-get install curl
COPY --from=builder /env /env
COPY --from=builder /src /src
ENV PATH="/env/bin/:${PATH}"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ The aggregate cache is built using Elasticsearch. See the `docker-compose.yaml`

Install required software:

* [PostgreSQL](PostgreSQL) 9.6 or above
* [Python](https://www.python.org/downloads/) 3.7 or above
* [PostgreSQL](PostgreSQL) 13 or above
* [Python](https://www.python.org/downloads/) 3.10 or above
* [Poetry](https://poetry.eustace.io/docs/#installation)

Then use `poetry install` to install the dependencies. Before that,
Expand Down
Loading