Skip to content
Snippets Groups Projects
Commit a40eab27 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Use Poetry

parent 46c85abf
No related branches found
No related tags found
No related merge requests found
[settings]
profile = black
default_section = THIRDPARTY
known_first_party = django
...@@ -39,69 +39,47 @@ COMPOSE_FILE=docker-compose.yml:docker-compose.steering.yml ...@@ -39,69 +39,47 @@ COMPOSE_FILE=docker-compose.yml:docker-compose.steering.yml
If you want to run the test suite, you can run `pytest` in the container: If you want to run the test suite, you can run `pytest` in the container:
```shell ```shell
$ docker compose run steering pytest $ docker compose run steering poetry run pytest
``` ```
## `venv` ## Installation and execution with Poetry
**Warning:** This is not the recommended way: it uses SQLite instead of If you really don't want to use Docker, you can install and run `steering`
Postgres and will be deprecated soon using [Poetry](https://python-poetry.org/) using SQLite.
If you really don't want to use Docker, you can install `steering` using a Refer to the [documentation](https://python-poetry.org/docs/#installation) on
virtual environment. how to install Poetry.
Create and activate a virtual environment: First, install all the dependencies for the project:
```shell ```shell
$ python3.9 -m venv venv $ poetry install --no-root
$ source venv/bin/activate
```
Install the required dependencies:
```shell
(venv) $ pip install --upgrade pip
(venv) $ pip install -r requirements.txt
``` ```
Then, you can set up the database: Then, you can set up the database:
```shell ```shell
(venv) $ ./manage.py migrate $ poetry run ./manage.py migrate
```
And load the fixtures:
```shell
(venv) $ ./manage.py loaddata fixtures/*/*.json
```
Or, if you prefer, you can just create a superuser after setting up the
database:
```shell
(venv) $ ./manage.py createsuperuser
``` ```
The only required fixtures are the recurrence rules, these are needed to create And, load the fixtures:
schedules:
```shell ```shell
(venv) $ ./manage.py loaddata fixtures/program/rrule.json $ poetry run ./manage.py loaddata fixtures/*/*.json
``` ```
Then, you can create a RSA Key and the clients for `dashboard` and `tank`: Then, you can create an RSA Key and the clients for `dashboard` and `tank`:
```shell ```shell
(venv) $ ./manage.py creatersakey $ poetry run ./manage.py creatersakey
(venv) $ ./manage.py create_oidc_client dashboard public -r "id_token token" -u http://localhost:8080/oidc_callback.html -u http://localhost:8080/oidc_callback_silentRenew.html -p http://localhost:8080/ $ poetry run ./manage.py create_oidc_client dashboard public -r "id_token token" -u http://localhost:8080/oidc_callback.html -u http://localhost:8080/oidc_callback_silentRenew.html -p http://localhost:8080/
(venv) $ ./manage.py create_oidc_client tank confidential -r "code" -u http://localhost:8040/auth/oidc/callback $ poetry run ./manage.py create_oidc_client tank confidential -r "code" -u http://localhost:8040/auth/oidc/callback
``` ```
Finally, you can start the development server: Finally, you can start the development server:
```shell ```shell
(venv) $ ./manage.py runserver $ poetry run ./manage.py runserver
``` ```
## Data Model ## Data Model
...@@ -113,5 +91,5 @@ Extensions](https://django-extensions.readthedocs.io/en/latest/graph_models.html ...@@ -113,5 +91,5 @@ Extensions](https://django-extensions.readthedocs.io/en/latest/graph_models.html
The following command will generate an image out of the models: The following command will generate an image out of the models:
```shell ```shell
(venv) $ docker compose steering run ./manage.py graph_models --pydot -g -o steering_data_model.png program profile docker compose steering run poetry run ./manage.py graph_models --pydot -g -o steering_data_model.png program profile
``` ```
poetry.lock 0 → 100644
This diff is collapsed.
[tool.poetry]
name = "steering"
version = "1.0.0a0"
description = "AURA Program Scheduler"
license = "AGPL-3.0-or-later"
authors = [
"Ernesto Rico Schmidt <ernesto@helsinki.at>",
"Ingo Leindecker <ingo.leindecker@fro.at>"
]
maintainers = [
"Ernesto Rico Schmidt <ernesto@helsinki.at>"
]
readme = "README.md"
repository = "https://gitlab.servus.at/aura/steering"
[tool.poetry.dependencies]
python = "^3.10"
Django = "^3.2.15"
django-cors-headers = "^3.13.0"
django-extensions = "^3.2.1"
django-filter = "^22.1"
django-oidc-provider = "^0.7.0"
djangorestframework = "^3.14.0"
django-versatileimagefield = "^2.2"
drf-nested-routers = "^0.93.4"
drf-spectacular = "^0.24.2"
gunicorn = "^20.1.0"
Pillow = "^9.2.0"
psycopg2-binary = "^2.9.3"
pydot = "^1.4.2"
python-dateutil = "^2.8.2"
pytz = "^2022.2.1"
requests = "^2.28.1"
[tool.poetry.group.dev.dependencies]
black = "^22.8.0"
flake8 = "^5.0.4"
isort = "^5.10.1"
pre-commit = "^2.20.0"
[tool.poetry.group.test.dependencies]
pytest = "^7.1.3"
pytest-django = "^4.5.2"
[tool.black]
line-length = 99
target-version = ["py310"]
[tool.isort]
default_section = "THIRDPARTY"
known_first_party = "django"
profile = "black"
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]
asgiref==3.5.2
attrs==22.1.0
certifi==2022.9.14
charset-normalizer==2.1.1
Django==3.2.15
django-cors-headers==3.13.0
django-extensions==3.2.1
django-filter==22.1
django-oidc-provider==0.7.0
django-versatileimagefield==2.2
djangorestframework==3.14.0
drf-spectacular==0.24.1
drf-nested-routers==0.93.4
future==0.18.2
gunicorn==20.1.0
idna==3.4
inflection==0.5.1
iniconfig==1.1.1
isort==5.10.1
olefile==0.46
packaging==21.3
Pillow==9.2.0
pluggy==1.0.0
pre-commit==2.20.0
psycopg2-binary==2.9.3
py==1.11.0
pycryptodomex==3.15.0
pydotplus==2.0.2
pyjwkest==1.4.2
pyparsing==3.0.9
pytest==7.1.3
pytest-django==4.5.2
python-dateutil==2.8.2
python-magic==0.4.27
pytz==2022.2.1
requests==2.28.1
six==1.16.0
sqlparse==0.4.2
text-unidecode==1.3
toml==0.10.2
urllib3==1.26.12
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment