Skip to content

Commit

Permalink
Use Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiefMaster committed Nov 15, 2023
1 parent e1b6a5e commit 62ac132
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']

services:
postgres:
Expand Down Expand Up @@ -59,5 +59,5 @@ jobs:
make test
- name: Lint
if: matrix.python-version == 3.11
if: matrix.python-version == 3.12
run: make lint
4 changes: 2 additions & 2 deletions .github/workflows/migration-sql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
python-version: '3.12'

- name: Get list of created migrations
id: get-changed-files
Expand All @@ -32,7 +32,7 @@ jobs:
if: steps.migrations-changed.outputs.changed == 'true'
run: |
make config
PYTHON=python3.11 make env
PYTHON=python3.12 make env
pip install -q -e '.[dev]'
- name: Activate virtualenv for later steps
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# builder image
FROM python:3.11 AS builder
FROM python:3.12 AS builder

ADD . /build/
WORKDIR /build
Expand All @@ -11,7 +11,7 @@ RUN make build


# production image
FROM python:3.11
FROM python:3.12

# create an unprivileged user to run as
RUN set -ex && \
Expand All @@ -24,7 +24,7 @@ RUN pip install uwsgi

COPY --from=builder /build/dist/newdle*.whl /tmp/
RUN pip install $(echo /tmp/newdle*.whl)[exchange,cern]
RUN find /usr/local/lib/python3.11/site-packages/newdle/client/build/ -type f -exec gzip -k {} +
RUN find /usr/local/lib/python3.12/site-packages/newdle/client/build/ -type f -exec gzip -k {} +
ADD docker/run.sh docker/uwsgi.ini /

# install some useful tools for debugging etc.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ decided (still work in progress!).

## Development

We chose Python 3.11 as the backend language, so make sure you have it installed (3.9 or 3.10 should work as well). To prepare the development environment it is enough to run `make` which takes care of installing all required dependencies inside a new virtualenv. Typically that will be the `.venv` directory unless you override the environment variable `VENV` *e.g.* `VENV=.virtualenv make`. Activate your virtualenv using ``source .venv/bin/activate`` since this is required to run the various `flask` comments that come later.
We chose Python 3.12 as the backend language, so make sure you have it installed (3.9-3.11 should work as well). To prepare the development environment it is enough to run `make` which takes care of installing all required dependencies inside a new virtualenv. Typically that will be the `.venv` directory unless you override the environment variable `VENV` *e.g.* `VENV=.virtualenv make`. Activate your virtualenv using ``source .venv/bin/activate`` since this is required to run the various `flask` comments that come later.

Make sure you have the `python` binary in your PATH. You can also use the `PYTHON` environment variable to override the location of the
`python` binary. *e.g.:*
```bash
$ PYTHON=/usr/bin/python3.11 make
$ PYTHON=/usr/bin/python3.12 make
```

## Database schema
Expand Down
2 changes: 1 addition & 1 deletion docker/uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ evil-reload-on-rss = 8192

offload-threads = 4

set-placeholder = newdle-client-dir=/usr/local/lib/python3.11/site-packages/newdle/client/build
set-placeholder = newdle-client-dir=/usr/local/lib/python3.12/site-packages/newdle/client/build

# pass urls handled by the backend to the app
route-uri = ^/(api|login|logout)/ last:
Expand Down

0 comments on commit 62ac132

Please sign in to comment.