Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from requirements.txt to poetry #929

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
name: Wait for ElasticSearch
command: dockerize -wait tcp://127.0.0.1:9200 -timeout 120s
- restore_cache:
key: py38-{{ checksum "requirements.txt" }}-{{ checksum "tox.ini" }}-20220708
key: py38-{{ checksum "poetry.lock" }}-{{ checksum "tox.ini" }}-20220708
- run:
name: Install tox tox-pyenv
command: |
Expand All @@ -55,7 +55,7 @@ jobs:
. virtualenv/bin/activate
tox
- save_cache:
key: py38-{{ checksum "requirements.txt" }}-{{ checksum "tox.ini" }}-20220708
key: py38-{{ checksum "poetry.lock" }}-{{ checksum "tox.ini" }}-20220708
paths:
- virtualenv
- .tox/py38
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-apiv2-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ jobs:
python3 -m venv virtualenv
source virtualenv/bin/activate
pip install pip --upgrade
pip install -r requirements.txt
pip install poetry
poetry install --no-ansi
# NOTE why is it needed? if missing, spectacular fails because of "no module named custom_view.api_v2"
- name: dummy custom_view
run: |
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ user@hostname:~$ cd airone
user@hostname:~/airone$ python3 -m venv virtualenv
user@hostname:~/airone$ source virtualenv/bin/activate
(virtualenv) user@hostname:~/airone$ pip install pip --upgrade
(virtualenv) user@hostname:~/airone$ pip install -r requirements.txt
# or, during development
(virtualenv) user@hostname:~/airone$ pip install -r requirements-dev.txt
(virtualenv) user@hostname:~/airone$ pip install poetry
(virtualenv) user@hostname:~/airone$ poetry install --only main
# or, during development, install all
(virtualenv) user@hostname:~/airone$ poetry install
```

## Setting-up Backend with docker-compose
Expand Down
2,607 changes: 2,607 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,62 @@ extend-exclude = ["./*/migrations", "manage.py", "./node_modules"]

[tool.ruff.per-file-ignores]
"./airone/tests/test_elasticsearch.py" = ["E501"]

[tool.poetry]
name = "airone"
version = "3.59.0"
description = ""
authors = ["Hiroyasu OHYAMA"]
license = "GPLv2"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.8"
boto3 = "1.26.114"
celery = "5.2.2"
ddtrace = "1.2.1"
django-configurations = "2.3.2"
django-debug-toolbar = "3.2.4"
django-environ = "0.9.0"
django-filter = "2.4.0"
django-import-export = "2.5.0"
django-replicated = "2.7"
django-simple-history = "3.2.0"
django-storages = "1.13.2"
django = "3.2.20"
djangorestframework = "3.11.2"
drf-spectacular = "0.26.4"
elasticsearch = "7.17.6"
flower = "1.2.0"
gunicorn = "20.0.4"
kombu = "5.2.2"
mock = "2.0.0"
mysqlclient = "2.0.3"
natsort = "5.3.3"
python-ldap = "3.4.0"
python3-saml = "1.12.0"
pyyaml = "6.0"
requests = "2.31.0"
six = "1.15.0"
setproctitle = "1.3.2"
social-auth-app-django = "4.0.0"
social-auth-core = "3.3.0"
uritemplate = "3.0.1"
whitenoise = "5.2.0"


[tool.poetry.group.dev.dependencies]
black = "^23.7.0"
coverage = "^7.3.0"
mypy = "^1.5.1"
requests-html = "0.10.0"
types-six = "^1.16.21.9"
types-requests = "^2.31.0.2"
types-pyyaml = "^6.0.12.11"
types-pytz = "^2023.3.0.1"
types-mock = "^5.1.0.1"
ruff = "^0.0.286"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
10 changes: 0 additions & 10 deletions requirements-dev.txt

This file was deleted.

31 changes: 0 additions & 31 deletions requirements.txt

This file was deleted.

7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ skipsdist = TRUE

[testenv:py38]
commands =
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install poetry
poetry install --no-ansi
python manage.py makemigrations
python manage.py migrate
python manage.py collectstatic
Expand All @@ -21,7 +21,8 @@ whitelist_externals = rm

[testenv:staticchecks]
commands =
pip install -r requirements-dev.txt
pip install poetry --only dev
poetry install --no-ansi
black --check .
mypy ./
ruff check .