Skip to content

Commit 63052d6

Browse files
committed
Merge branch 'main' into integration/2024-evolution
2 parents b8eb618 + 5d70f91 commit 63052d6

25 files changed

+1111
-1027
lines changed

.github/workflows/flightpath.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v3
16-
- name: Set up Python 3.11
16+
- name: Set up Python
1717
uses: actions/setup-python@v4
1818
with:
19-
python-version: '3.11'
19+
python-version: '3.13'
2020
- name: Install dependencies
2121
run: |
2222
python -m pip install --upgrade pip

.github/workflows/flightpath_status_check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v3
18-
- name: Set up Python 3.11
18+
- name: Set up Python
1919
uses: actions/setup-python@v4
2020
with:
21-
python-version: '3.11'
21+
python-version: '3.13'
2222
- name: Install dependencies
2323
run: |
2424
python -m pip install --upgrade pip

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Set up Python
3737
uses: actions/setup-python@v4
3838
with:
39-
python-version: 3.11
39+
python-version: '3.13'
4040
cache: 'pip'
4141

4242
- name: Install dependencies

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12-
- name: Set up Python 3.11
12+
- name: Set up Python
1313
uses: actions/setup-python@v5
1414
with:
15-
python-version: 3.11
15+
python-version: '3.13'
1616
- uses: actions/setup-node@v4
1717
with:
1818
node-version-file: '.nvmrc'
@@ -92,7 +92,7 @@ jobs:
9292
- name: Set up Python
9393
uses: actions/setup-python@v5
9494
with:
95-
python-version: 3.11
95+
python-version: '3.13'
9696
cache: 'poetry'
9797
- uses: actions/download-artifact@v4
9898
with:

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
default_language_version:
22
node: system
3-
python: python3.11
3+
python: python3.13
44
repos:
55
- repo: https://github.com/psf/black-pre-commit-mirror
66
rev: 24.10.0
77
hooks:
88
- id: black
9-
language_version: python3.11
9+
language_version: python3.13
1010
exclude: .+/migrations
1111
- repo: https://github.com/PyCQA/isort
1212
rev: 5.13.2

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20 as frontend
1+
FROM node:20 AS frontend
22

33
# Make build & post-install scripts behave as if we were in a CI environment (e.g. for logging verbosity purposes).
44
ARG CI=true
@@ -16,7 +16,7 @@ RUN npm run build:prod
1616
# ones becase they use a different C compiler. Debian images also come with
1717
# all useful packages required for image manipulation out of the box. They
1818
# however weight a lot, approx. up to 1.5GiB per built image.
19-
FROM python:3.11 as production
19+
FROM python:3.13 as production
2020

2121
ARG POETRY_INSTALL_ARGS="--no-dev"
2222

@@ -71,7 +71,7 @@ USER tbx
7171
# Install your app's Python requirements.
7272
RUN python -m venv $VIRTUAL_ENV
7373
COPY --chown=tbx pyproject.toml poetry.lock ./
74-
RUN pip install --no-cache --upgrade pip && poetry install ${POETRY_INSTALL_ARGS} --no-root --extras gunicorn && rm -rf $HOME/.cache
74+
RUN pip install --no-cache --upgrade pip && poetry install ${POETRY_INSTALL_ARGS} --no-root && rm -rf $HOME/.cache
7575

7676
COPY --chown=tbx --from=frontend ./tbx/static_compiled ./tbx/static_compiled
7777

@@ -91,10 +91,10 @@ COPY ./docker/bashrc.sh /home/tbx/.bashrc
9191

9292
# Run the WSGI server. It reads GUNICORN_CMD_ARGS, PORT and WEB_CONCURRENCY
9393
# environment variable hence we don't specify a lot options below.
94-
CMD gunicorn tbx.wsgi:application
94+
CMD ["gunicorn", "tbx.wsgi:application"]
9595

9696
# These steps won't be run on production
97-
FROM production as dev
97+
FROM production AS dev
9898

9999
# Swap user, so the following tasks can be run as root
100100
USER root
@@ -117,4 +117,4 @@ RUN curl https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh
117117
COPY --chown=tbx --from=frontend ./node_modules ./node_modules
118118

119119
# do nothing forever - exec commands elsewhere
120-
CMD tail -f /dev/null
120+
CMD ["tail", "-f", "/dev/null"]

docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3.7'
21
services:
32
web:
43
build:

docker/docker-compose-frontend.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# A custom compose file for $FRONTEND=docker, which also binds frontend ports
22

3-
version: '3.7' # NB synchronise with /docker-compose.yml
43
services:
54
web:
65
ports:

fabfile.py

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Process .env file
1010
if os.path.exists(".env"):
11-
with open(".env", "r") as f:
11+
with open(".env") as f:
1212
for line in f.readlines():
1313
if not line or line.startswith("#") or "=" not in line:
1414
continue
@@ -36,9 +36,7 @@
3636

3737

3838
def dexec(cmd, service="web"):
39-
return local(
40-
"docker-compose exec -T {} bash -c {}".format(quote(service), quote(cmd))
41-
)
39+
return local(f"docker compose exec -T {quote(service)} bash -c {quote(cmd)}")
4240

4341

4442
@task
@@ -51,11 +49,11 @@ def build(c):
5149

5250
group = subprocess.check_output(["id", "-gn"], encoding="utf-8").strip()
5351
local("mkdir -p " + directories_arg)
54-
local("chown -R $USER:{} {}".format(group, directories_arg))
52+
local(f"chown -R $USER:{group} {directories_arg}")
5553
local("chmod -R 775 " + directories_arg)
5654

57-
local("docker-compose pull")
58-
local("docker-compose build")
55+
local("docker compose pull", pty=True)
56+
local("docker compose build", pty=True)
5957

6058

6159
@task
@@ -64,10 +62,11 @@ def start(c):
6462
Start the development environment
6563
"""
6664
if FRONTEND == "local":
67-
local("docker-compose up -d")
65+
local("docker compose up --detach", pty=True)
6866
else:
6967
local(
70-
"docker-compose -f docker-compose.yml -f docker/docker-compose-frontend.yml up -d"
68+
"docker compose -f docker-compose.yml -f docker/docker-compose-frontend.yml up -d",
69+
pty=True,
7170
)
7271

7372

@@ -76,7 +75,7 @@ def stop(c):
7675
"""
7776
Stop the development environment
7877
"""
79-
local("docker-compose stop")
78+
local("docker compose stop", pty=True)
8079

8180

8281
@task
@@ -93,23 +92,23 @@ def destroy(c):
9392
"""
9493
Destroy development environment containers (database will lost!)
9594
"""
96-
local("docker-compose down")
95+
local("docker compose down --volumes", pty=True)
9796

9897

9998
@task
10099
def sh(c, service="web"):
101100
"""
102101
Run bash in a local container
103102
"""
104-
subprocess.run(["docker-compose", "exec", service, "bash"])
103+
subprocess.run(["docker", "compose", "exec", service, "bash"])
105104

106105

107106
@task
108107
def sh_root(c, service="web"):
109108
"""
110109
Run bash as root in the local web container.
111110
"""
112-
subprocess.run(["docker-compose", "exec", "--user=root", "web", "bash"])
111+
subprocess.run(["docker", "compose", "exec", "--user=root", "web", "bash"])
113112

114113

115114
@task
@@ -118,7 +117,8 @@ def psql(c, command=None):
118117
Connect to the local postgres DB using psql
119118
"""
120119
cmd_list = [
121-
"docker-compose",
120+
"docker",
121+
"compose",
122122
"exec",
123123
"db",
124124
"psql",
@@ -265,9 +265,7 @@ def dev_shell(c):
265265

266266

267267
def delete_local_database(c, local_database_name=LOCAL_DATABASE_NAME):
268-
local(
269-
"dropdb --if-exists {database_name}".format(database_name=LOCAL_DATABASE_NAME)
270-
)
268+
local(f"dropdb --if-exists {LOCAL_DATABASE_NAME}")
271269

272270

273271
####
@@ -389,7 +387,7 @@ def open_heroku_shell(c, app_instance, shell_command="bash"):
389387

390388

391389
def make_bold(msg):
392-
return "\033[1m{}\033[0m".format(msg)
390+
return f"\033[1m{msg}\033[0m"
393391

394392

395393
@task
@@ -439,16 +437,14 @@ def dellar_list(c):
439437
def dellar_remove(c, filename):
440438
"""Remove database snapshots"""
441439
dexec(
442-
"rm {filename}.psql".format(filename=filename),
440+
f"rm {filename}.psql",
443441
service="db",
444442
),
445443
print(f"Snapshot {filename} removed")
446444

447445

448446
def get_heroku_variable(c, app_instance, variable):
449-
return local(
450-
"heroku config:get {var} --app {app}".format(app=app_instance, var=variable)
451-
).stdout.strip()
447+
return local(f"heroku config:get {variable} --app {app_instance}").stdout.strip()
452448

453449

454450
@task
@@ -458,7 +454,8 @@ def run_test(c):
458454
"""
459455
subprocess.call(
460456
[
461-
"docker-compose",
457+
"docker",
458+
"compose",
462459
"exec",
463460
"web",
464461
"python",
@@ -475,4 +472,6 @@ def migrate(c):
475472
"""
476473
Run database migrations
477474
"""
478-
subprocess.run(["docker-compose", "run", "--rm", "web", "./manage.py", "migrate"])
475+
subprocess.run(
476+
["docker", "compose", "run", "--rm", "web", "./manage.py", "migrate"]
477+
)

0 commit comments

Comments
 (0)