From 45b30a78bfe254fcd6af66e03b66aca54035b1f5 Mon Sep 17 00:00:00 2001 From: mbsantiago Date: Wed, 9 Oct 2024 22:11:45 +0100 Subject: [PATCH 1/4] =?UTF-8?q?Bump=20version:=200.6.4=20=E2=86=92=200.7.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- back/pyproject.toml | 2 +- back/src/whombat/__init__.py | 2 +- front/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 5e6a8584..cb7d7eda 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.6.4 +current_version = 0.7.0 commit = True tag = True diff --git a/back/pyproject.toml b/back/pyproject.toml index d424d5c9..e67e2ec2 100644 --- a/back/pyproject.toml +++ b/back/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "Whombat" -version = "0.6.4" +version = "0.7.0" description = "Audio Annotation Tool" authors = [{ name = "Santiago Martinez", email = "santiago.mbal@gmail.com" }] dependencies = [ diff --git a/back/src/whombat/__init__.py b/back/src/whombat/__init__.py index 3618bef0..525f4a07 100644 --- a/back/src/whombat/__init__.py +++ b/back/src/whombat/__init__.py @@ -2,4 +2,4 @@ __author__ = """Santiago Martinez Balvanera""" __email__ = "santiago.balvanera.20@ucl.ac.uk" -__version__ = "0.6.4" +__version__ = "0.7.0" diff --git a/front/package.json b/front/package.json index f64317ce..66ab6012 100644 --- a/front/package.json +++ b/front/package.json @@ -1,6 +1,6 @@ { "name": "whombat-front", - "version": "0.6.4", + "version": "0.7.0", "private": true, "scripts": { "dev": "next dev", From 4929adba7f8d745864814043c01d64f1d9a442d7 Mon Sep 17 00:00:00 2001 From: Johan Ravn Date: Sun, 20 Oct 2024 13:32:46 +0200 Subject: [PATCH 2/4] build(Dockerfile): Add libexpat.so.1 as a system dependency Add libexpat.so.1 as a system dependency as it is required by rasterio --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index c3c69351..3d5358f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,6 +69,11 @@ RUN --mount=type=cache,target=/root/.cache/uv \ # Then, use a final image without uv FROM python:3.12-slim-bookworm +# Install system dependencies, including libexpat1 and clean up the cache +RUN apt-get update && apt-get install -y --no-install-recommends \ + libexpat1 \ + && rm -rf /var/lib/apt/lists/* + # Copy the application from the builder COPY --from=builder --chown=app:app /app /app From f62c25499a0f80d4d1ee82d1a0b6ccfac78a58d2 Mon Sep 17 00:00:00 2001 From: Johan Ravn Date: Sun, 20 Oct 2024 14:25:45 +0200 Subject: [PATCH 3/4] refactor: Use environment variables for backend endpoint Instead of hardcoding in backend endpoints in the front-end use environemnt variables setup suggest by next.js. Makes it easier to switch endpoints on-the-fly in dev, test prod --- .nvmrc | 1 + front/.env.development | 1 + front/.env.production | 1 + front/package-lock.json | 4 ++-- front/src/app/api.ts | 2 +- front/src/lib/api/common.ts | 3 ++- front/src/lib/api/index.ts | 2 +- 7 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 .nvmrc create mode 100644 front/.env.development create mode 100644 front/.env.production diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..620c5e1e --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v22.9.0 diff --git a/front/.env.development b/front/.env.development new file mode 100644 index 00000000..cfc9f71e --- /dev/null +++ b/front/.env.development @@ -0,0 +1 @@ +NEXT_PUBLIC_BACKEND_HOST=http://localhost:5000 \ No newline at end of file diff --git a/front/.env.production b/front/.env.production new file mode 100644 index 00000000..cfc9f71e --- /dev/null +++ b/front/.env.production @@ -0,0 +1 @@ +NEXT_PUBLIC_BACKEND_HOST=http://localhost:5000 \ No newline at end of file diff --git a/front/package-lock.json b/front/package-lock.json index ea0b4b58..33a69aab 100644 --- a/front/package-lock.json +++ b/front/package-lock.json @@ -1,12 +1,12 @@ { "name": "whombat-front", - "version": "0.6.1", + "version": "0.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "whombat-front", - "version": "0.6.1", + "version": "0.7.0", "dependencies": { "@headlessui-float/react": "^0.13.3", "@headlessui/react": "^1.7.19", diff --git a/front/src/app/api.ts b/front/src/app/api.ts index a81e60ee..c4d680bf 100644 --- a/front/src/app/api.ts +++ b/front/src/app/api.ts @@ -1,7 +1,7 @@ import createAPI from "@/lib/api"; const api = createAPI({ - baseURL: "http://localhost:5000", + baseURL: `${process.env.NEXT_PUBLIC_BACKEND_HOST}`, withCredentials: true, }); diff --git a/front/src/lib/api/common.ts b/front/src/lib/api/common.ts index 0a3e9475..b0cb775c 100644 --- a/front/src/lib/api/common.ts +++ b/front/src/lib/api/common.ts @@ -4,9 +4,10 @@ import { z } from "zod"; import { GetManySchema } from "@/lib/schemas"; -export const HOST = "http://localhost:5000"; +export const HOST = `${process.env.NEXT_PUBLIC_BACKEND_HOST}`; export const BASE_ROUTE = `/api/v1`; + export const instance = axios.create({ withCredentials: true, baseURL: HOST, diff --git a/front/src/lib/api/index.ts b/front/src/lib/api/index.ts index 12740cfa..e3e27e4f 100644 --- a/front/src/lib/api/index.ts +++ b/front/src/lib/api/index.ts @@ -36,7 +36,7 @@ type APIConfig = { }; const DEFAULT_CONFIG: APIConfig = { - baseURL: "http://localhost:5000", + baseURL: `${process.env.NEXT_PUBLIC_BACKEND_HOST}`, withCredentials: true, }; From 571dcf6e7d5a5d1a9bfb494f79eb68f96a42fc65 Mon Sep 17 00:00:00 2001 From: Johan Ravn Date: Sun, 20 Oct 2024 16:13:50 +0200 Subject: [PATCH 4/4] style(common.ts): Linting --- front/{.env.development => .env} | 0 front/.env.production | 1 - front/src/lib/api/common.ts | 1 - 3 files changed, 2 deletions(-) rename front/{.env.development => .env} (100%) delete mode 100644 front/.env.production diff --git a/front/.env.development b/front/.env similarity index 100% rename from front/.env.development rename to front/.env diff --git a/front/.env.production b/front/.env.production deleted file mode 100644 index cfc9f71e..00000000 --- a/front/.env.production +++ /dev/null @@ -1 +0,0 @@ -NEXT_PUBLIC_BACKEND_HOST=http://localhost:5000 \ No newline at end of file diff --git a/front/src/lib/api/common.ts b/front/src/lib/api/common.ts index b0cb775c..b7b578b5 100644 --- a/front/src/lib/api/common.ts +++ b/front/src/lib/api/common.ts @@ -7,7 +7,6 @@ import { GetManySchema } from "@/lib/schemas"; export const HOST = `${process.env.NEXT_PUBLIC_BACKEND_HOST}`; export const BASE_ROUTE = `/api/v1`; - export const instance = axios.create({ withCredentials: true, baseURL: HOST,