Skip to content

Commit a7d56c2

Browse files
committed
deps: improve requirements
- update setuptools and wheel in Dockerfile - add hashes to requirements - move ipython to main requirements for getting a better production shell - move production requirements to main requirements - add pip-tools to development requirements - use psycopg2 instead of psycop2-binary Refs: PT-1952
1 parent ebaf6de commit a7d56c2

8 files changed

Lines changed: 1216 additions & 170 deletions

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ RUN mkdir /entrypoint
1414
# see .dockerignore for info on what is not copied here:
1515
COPY --chown=root:root --chmod=755 . /app/
1616

17-
RUN yum update -y && yum install -y \
18-
nc \
19-
&& pip install -U pip \
17+
RUN dnf update -y \
18+
&& dnf install -y nmap-ncat \
19+
&& pip install --upgrade pip setuptools wheel \
2020
&& pip install --no-cache-dir -r /app/requirements.txt \
21-
&& pip install --no-cache-dir -r /app/requirements-prod.txt \
2221
&& uwsgi --build-plugin https://github.com/City-of-Helsinki/uwsgi-sentry \
23-
&& yum clean all
22+
&& dnf clean all
2423

2524
COPY --chown=root:root --chmod=755 docker-entrypoint.sh /entrypoint/docker-entrypoint.sh
2625
ENTRYPOINT ["/entrypoint/docker-entrypoint.sh"]

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ extend-select = [
1818
"W", # Enable pycodestyle warning (W) rules
1919
]
2020

21+
[tool.pip-tools.compile]
22+
allow-unsafe = true
23+
generate-hashes = true
24+
strip-extras = true
25+
2126
[tool.ruff.lint.isort]
2227
# isort options for ruff:
2328
# https://docs.astral.sh/ruff/settings/#lintisort

requirements-dev.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
-c requirements.txt
22
cryptography
33
freezegun
4-
ipython
54
parameterized
65
pre-commit
6+
pip-tools
77
pytest
88
pytest-cov
99
pytest-django

requirements-dev.txt

Lines changed: 482 additions & 72 deletions
Large diffs are not rendered by default.

requirements-prod.in

Lines changed: 0 additions & 3 deletions
This file was deleted.

requirements-prod.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

requirements.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ graphene-django
2121
graphene-file-upload
2222
helsinki-profile-gdpr-api
2323
importlib_metadata
24-
psycopg2-binary
24+
ipython
25+
psycopg2
2526
requests
2627
sentry-sdk
2728
social-auth-app-django
2829
urllib3
29-
django-auditlog-extra@git+https://github.com/City-of-Helsinki/django-auditlog-extra.git@bff5fa3921d6821bebdd6be6c9fd20db39d32d54#egg=django-auditlog-extra
30+
django-auditlog-extra@https://github.com/City-of-Helsinki/django-auditlog-extra/archive/bff5fa3921d6821bebdd6be6c9fd20db39d32d54.zip
31+
uwsgi
32+
uwsgitop

requirements.txt

Lines changed: 719 additions & 77 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)