Skip to content

Commit 280b28f

Browse files
authored
upgrade python>=3.12 (#608)
1 parent 68b5d5b commit 280b28f

3 files changed

Lines changed: 44 additions & 46 deletions

File tree

README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The backend is written using FastAPI and SQLAlchemy.
2525

2626
Using Poetry, install AcidWatch's backend using the following command:
2727

28-
``` sh
28+
```sh
2929
poetry -C backend install
3030
```
3131

@@ -36,7 +36,7 @@ poetry -C backend install
3636
3737
Then, run the backend in development mode using the following command:
3838

39-
``` sh
39+
```sh
4040
poetry -C backend run acidwatch-api
4141
```
4242

@@ -49,6 +49,7 @@ Dockerfile](./backend/Dockerfile).
4949
Explore the auto-generated REST API at http://localhost:8001/docs
5050

5151
#### SQLite
52+
5253
By default, AcidWatch uses an in-memory SQLite database. It requires no
5354
additional installation or setup, but will reset whenever the backend is
5455
restarted.
@@ -57,7 +58,7 @@ To enable a persistent SQLite database, set `ACIDWATCH_DATABASE` in
5758
`backend/.env` file. For example, adding the following will create a `test.db`
5859
file in the directory from which `acidwatch-api` is ran:
5960

60-
``` sh
61+
```sh
6162
ACIDWATCH_DATABASE=sqlite:///test.db
6263
```
6364

@@ -66,26 +67,27 @@ ACIDWATCH_DATABASE=sqlite:///test.db
6667
> occur, delete your database file and restart.
6768
6869
#### PostgreSQL
69-
AcidWatch uses a PostgreSQL database in production. Once you have access
70+
71+
AcidWatch uses a PostgreSQL database in production. Once you have access
7072

7173
First, ensure that the backend is installed with the `pg` (PostgreSQL) optional
7274
dependency group. This installs the recommended SQLAlchemy driver:
7375

74-
``` sh
76+
```sh
7577
poetry -C backend install -E pg
7678
```
7779

7880
Then, set the `ACIDWATCH_DATABASE` as described in the [SQLite section](#SQLite) to the following:
7981

80-
``` sh
82+
```sh
8183
# Over TCP/IP
82-
ACIDWATCH_DATABASE=postgres://[username]:[password]@[hostname]:[port]/[database]
84+
ACIDWATCH_DATABASE=postgresql://[username]:[password]@[hostname]:[port]/[database]
8385

8486
# Over UNIX sockets
85-
ACIDWATCH_DATABASE=postgres:///[database]?host=[path]
87+
ACIDWATCH_DATABASE=postgresql:///[database]?host=[path]
8688

8789
# For example:
88-
ACIDWATCH_DATABASE=postgres://postgres:password@localhost:5432/acidwatch
90+
ACIDWATCH_DATABASE=postgresql://postgres:password@localhost:5432/acidwatch
8991
```
9092

9193
AcidWatch uses SQLAlchemy's Alembic to handle migrations. Run `poetry -C backend
@@ -100,8 +102,7 @@ For other databases, refer to SQLAlchemy documentation on how to create
100102
The frontend uses Vite and React. Components are provided by the official
101103
[Equinor Design System](https://eds.equinor.com) React library.
102104

103-
104-
``` sh
105+
```sh
105106
# Copy the .env file
106107
cp frontend/.env.example frontend/.env
107108

@@ -111,7 +112,7 @@ npm -C frontend install
111112

112113
To run, ensure that the backend is running on port 8001 and then:
113114

114-
``` sh
115+
```sh
115116
npm -C run dev
116117
```
117118

@@ -133,20 +134,20 @@ Deployment to test and prod environment are for now done manually in Radix conso
133134

134135
### GitHub Codespaces
135136

136-
If someone fancies using codespaces and wants to break out of the tedious local setup then following steps can be followed.
137+
If someone fancies using codespaces and wants to break out of the tedious local setup then following steps can be followed.
137138

138-
#### 1. Setup frontend
139+
#### 1. Setup frontend
139140

140-
Open a terminal and write following commands to run frontend.
141+
Open a terminal and write following commands to run frontend.
141142

142143
```sh
143144
cd /frontend
144145
npm run dev
145146
```
146147

147-
#### 2. Setup backend
148+
#### 2. Setup backend
148149

149-
Open another terminal and write following commands to enable virtual environment and then to run backend.
150+
Open another terminal and write following commands to enable virtual environment and then to run backend.
150151

151152
```sh
152153
source venv/bin/activate .
@@ -155,8 +156,8 @@ python3 backend/src/acidwatch_api/__main__.py
155156

156157
#### 3. Toggle port visibility
157158

158-
Kudos! Now frontend is running on port 5173, and backend is on 8001. Toggle the port for backend only to be public so its accessible by frontend.
159+
Kudos! Now frontend is running on port 5173, and backend is on 8001. Toggle the port for backend only to be public so its accessible by frontend.
159160

160161
#### 4. Point to a different deployment environment
161162

162-
Now open source models can be run and tested. To point to a different instance of deployment (dev, prod or local) install-dependencies.sh can be updated.
163+
Now open source models can be run and tested. To point to a different instance of deployment (dev, prod or local) install-dependencies.sh can be updated.

backend/poetry.lock

Lines changed: 23 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "acidwatch-api"
33
version = "0.1.0"
44
description = "A backend service for AcidWatch"
55
authors = [{ name = "CCS Data & Digital", email = "fg_CCS_Data_Digital@equinor.com" }]
6-
requires-python = ">=3.11, <3.14"
6+
requires-python = ">=3.12, <3.14"
77
dependencies = [
88
"fastapi",
99
"uvicorn",

0 commit comments

Comments
 (0)