update poetry to v2.1.1

This commit is contained in:
Aarni Halinen
2025-03-26 20:10:23 +02:00
parent 1331eeb1d7
commit 41fd3043d0
6 changed files with 310 additions and 259 deletions
+32 -12
View File
@@ -30,24 +30,34 @@ For depedencies and virtual environment, we use [poetry](https://python-poetry.o
First install [python](https://wiki.python.org/moin/BeginnersGuide/Download). Then install poetry:
```bash
python -m pip install poetry==2.0.1
python -m pip install poetry==2.1.1
```
The easiest integration with VSCode is to have poetry install virtual environment in project folder, configured with CMD
Install dependencies with
```bash
python -m poetry config virtualenvs.in-project true
poetry install
```
Poetry is configured to install dependencies in a virtual environment, so you should see `.venv` folder in repo root.
Activate virtual environment in shell
```bash
eval $(poetry env activate)
```
### Node
We use Node.js for few development tasks, like linting. Easiest way to install Node is [nvm](https://github.com/nvm-sh/nvm). After installing install dependencies:
We use Node.js for few development tasks, like linting.
Easiest way to install Node is [nvm](https://github.com/nvm-sh/nvm).
After installing install dependencies:
```bash
npm install
```
TODO: List scripts
See [Linting](#linting) for more info
### Database
@@ -61,18 +71,28 @@ docker run --name sik.web.db -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postg
## Development
Activate virtual environment in shell
```bash
eval $(python -m poetry env activate)
```
Install dependencies
Install dependencies with
```bash
poetry install
```
and make sure you are using Python from your virutal environment.
Virtual environment can be activated with
```bash
eval $(poetry env activate)
```
and you verify correct Python executable with
```bash
which python
# should return path similar to {your-system path}/web2.0-backend/.venv/bin/python
```
### Initializing data
Run the following `manage.py` commands to initialize a new database. Do not run these in production without thinking!