Bump dependencies (#618)

* Bump dependencies

* Make it work with Python 3.10

* replace psycopg2-binary with psycopg2 in Docker build
This commit is contained in:
Sascha Ißbrücker 2024-01-28 22:50:51 +01:00 committed by GitHub
parent 16ed6ef200
commit d7c1afa2a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 192 additions and 96 deletions

View file

@ -14,7 +14,7 @@
"forwardPorts": [8000],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r requirements.txt && npm install && mkdir -p data && python3 manage.py migrate",
"postCreateCommand": "pip3 install --user -r requirements.txt -r requirements.dev.txt && npm install && mkdir -p data && python3 manage.py migrate",
// Configure tool-specific properties.
"customizations": {

View file

@ -11,7 +11,7 @@
!/manage.py
!/package.json
!/package-lock.json
!/requirements.prod.txt
!/requirements.dev.txt
!/requirements.txt
!/rollup.config.js
!/supervisord.conf

View file

@ -19,7 +19,7 @@ jobs:
- name: Install Node dependencies
run: npm install
- name: Setup Python environment
run: pip install -r requirements.txt
run: pip install -r requirements.txt -r requirements.dev.txt
- name: Run tests
run: python manage.py test bookmarks.tests
e2e_tests:
@ -39,7 +39,7 @@ jobs:
run: npm install
- name: Setup Python environment
run: |
pip install -r requirements.txt
pip install -r requirements.txt -r requirements.dev.txt
playwright install chromium
- name: Run build
run: |

View file

@ -256,7 +256,7 @@ source ~/environments/linkding/bin/activate[.csh|.fish]
```
Within the active environment install the application dependencies from the application folder:
```
pip3 install -Ur requirements.txt
pip3 install -r requirements.txt -r requirements.dev.txt
```
Install frontend dependencies:
```

View file

@ -1,4 +1,5 @@
import operator
import datetime
from django.contrib.auth import get_user_model
from django.db.models import QuerySet
@ -6,7 +7,7 @@ from django.test import TestCase
from django.utils import timezone
from bookmarks import queries
from bookmarks.models import Bookmark, BookmarkSearch, UserProfile
from bookmarks.models import BookmarkSearch, UserProfile
from bookmarks.tests.helpers import BookmarkFactoryMixin, random_sentence
from bookmarks.utils import unique
@ -1195,25 +1196,25 @@ class QueriesTestCase(TestCase, BookmarkFactoryMixin):
bookmarks = [
self.setup_bookmark(
added=timezone.datetime(2020, 1, 1, tzinfo=timezone.utc)
added=timezone.datetime(2020, 1, 1, tzinfo=datetime.timezone.utc)
),
self.setup_bookmark(
added=timezone.datetime(2021, 2, 1, tzinfo=timezone.utc)
added=timezone.datetime(2021, 2, 1, tzinfo=datetime.timezone.utc)
),
self.setup_bookmark(
added=timezone.datetime(2022, 3, 1, tzinfo=timezone.utc)
added=timezone.datetime(2022, 3, 1, tzinfo=datetime.timezone.utc)
),
self.setup_bookmark(
added=timezone.datetime(2023, 4, 1, tzinfo=timezone.utc)
added=timezone.datetime(2023, 4, 1, tzinfo=datetime.timezone.utc)
),
self.setup_bookmark(
added=timezone.datetime(2022, 5, 1, tzinfo=timezone.utc)
added=timezone.datetime(2022, 5, 1, tzinfo=datetime.timezone.utc)
),
self.setup_bookmark(
added=timezone.datetime(2021, 6, 1, tzinfo=timezone.utc)
added=timezone.datetime(2021, 6, 1, tzinfo=datetime.timezone.utc)
),
self.setup_bookmark(
added=timezone.datetime(2020, 7, 1, tzinfo=timezone.utc)
added=timezone.datetime(2020, 7, 1, tzinfo=datetime.timezone.utc)
),
]
sorted_bookmarks = sorted(bookmarks, key=lambda b: b.date_added)
@ -1226,25 +1227,25 @@ class QueriesTestCase(TestCase, BookmarkFactoryMixin):
bookmarks = [
self.setup_bookmark(
added=timezone.datetime(2020, 1, 1, tzinfo=timezone.utc)
added=timezone.datetime(2020, 1, 1, tzinfo=datetime.timezone.utc)
),
self.setup_bookmark(
added=timezone.datetime(2021, 2, 1, tzinfo=timezone.utc)
added=timezone.datetime(2021, 2, 1, tzinfo=datetime.timezone.utc)
),
self.setup_bookmark(
added=timezone.datetime(2022, 3, 1, tzinfo=timezone.utc)
added=timezone.datetime(2022, 3, 1, tzinfo=datetime.timezone.utc)
),
self.setup_bookmark(
added=timezone.datetime(2023, 4, 1, tzinfo=timezone.utc)
added=timezone.datetime(2023, 4, 1, tzinfo=datetime.timezone.utc)
),
self.setup_bookmark(
added=timezone.datetime(2022, 5, 1, tzinfo=timezone.utc)
added=timezone.datetime(2022, 5, 1, tzinfo=datetime.timezone.utc)
),
self.setup_bookmark(
added=timezone.datetime(2021, 6, 1, tzinfo=timezone.utc)
added=timezone.datetime(2021, 6, 1, tzinfo=datetime.timezone.utc)
),
self.setup_bookmark(
added=timezone.datetime(2020, 7, 1, tzinfo=timezone.utc)
added=timezone.datetime(2020, 7, 1, tzinfo=datetime.timezone.utc)
),
]
sorted_bookmarks = sorted(bookmarks, key=lambda b: b.date_added, reverse=True)

View file

@ -17,9 +17,10 @@ WORKDIR /etc/linkding
FROM python-base AS python-build
# install build dependencies
COPY requirements.txt requirements.txt
COPY requirements.dev.txt requirements.dev.txt
# remove playwright from requirements as there is not always a distro and it's not needed for the build
RUN sed -i '/playwright/d' requirements.txt
RUN pip install -U pip && pip install -Ur requirements.txt
RUN sed -i '/playwright/d' requirements.dev.txt
RUN pip install -U pip && pip install -r requirements.txt -r requirements.dev.txt
# copy files needed for Django build
COPY . .
COPY --from=node-build /etc/linkding .
@ -30,11 +31,13 @@ RUN python manage.py compilescss && \
FROM python-base AS prod-deps
COPY requirements.prod.txt ./requirements.txt
COPY requirements.txt ./requirements.txt
# replace psycopg2-binary with psycopg2
RUN sed -i 's/psycopg2-binary/psycopg2/g' requirements.txt
RUN mkdir /opt/venv && \
python -m venv --upgrade-deps --copies /opt/venv && \
/opt/venv/bin/pip install --upgrade pip wheel && \
/opt/venv/bin/pip install -Ur requirements.txt
/opt/venv/bin/pip install -r requirements.txt
FROM python-base AS compile-icu

View file

@ -17,9 +17,10 @@ WORKDIR /etc/linkding
FROM python-base AS python-build
# install build dependencies
COPY requirements.txt requirements.txt
COPY requirements.dev.txt requirements.dev.txt
# remove playwright from requirements as there is not always a distro and it's not needed for the build
RUN sed -i '/playwright/d' requirements.txt
RUN pip install -U pip && pip install -Ur requirements.txt
RUN sed -i '/playwright/d' requirements.dev.txt
RUN pip install -U pip && pip install -r requirements.txt -r requirements.dev.txt
# copy files needed for Django build
COPY . .
COPY --from=node-build /etc/linkding .
@ -30,11 +31,13 @@ RUN python manage.py compilescss && \
FROM python-base AS prod-deps
COPY requirements.prod.txt ./requirements.txt
COPY requirements.txt ./requirements.txt
# replace psycopg2-binary with psycopg2
RUN sed -i 's/psycopg2-binary/psycopg2/g' requirements.txt
RUN mkdir /opt/venv && \
python -m venv --upgrade-deps --copies /opt/venv && \
/opt/venv/bin/pip install --upgrade pip wheel && \
/opt/venv/bin/pip install -Ur requirements.txt
/opt/venv/bin/pip install -r requirements.txt
FROM python-base AS compile-icu

8
requirements.dev.in Normal file
View file

@ -0,0 +1,8 @@
black
coverage
django-compressor
django-debug-toolbar
libsass
playwright
pytest
pytest-django

62
requirements.dev.txt Normal file
View file

@ -0,0 +1,62 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements.dev.in
#
asgiref==3.7.2
# via django
black==24.1.1
# via -r requirements.dev.in
click==8.1.7
# via black
coverage==7.4.1
# via -r requirements.dev.in
django==5.0.1
# via
# django-appconf
# django-debug-toolbar
django-appconf==1.0.6
# via django-compressor
django-compressor==4.4
# via -r requirements.dev.in
django-debug-toolbar==4.2.0
# via -r requirements.dev.in
greenlet==3.0.3
# via playwright
iniconfig==2.0.0
# via pytest
libsass==0.23.0
# via -r requirements.dev.in
mypy-extensions==1.0.0
# via black
packaging==23.2
# via
# black
# pytest
pathspec==0.12.1
# via black
platformdirs==4.1.0
# via black
playwright==1.41.1
# via -r requirements.dev.in
pluggy==1.4.0
# via pytest
pyee==11.0.1
# via playwright
pytest==8.0.0
# via
# -r requirements.dev.in
# pytest-django
pytest-django==4.7.0
# via -r requirements.dev.in
rcssmin==1.1.1
# via django-compressor
rjsmin==1.2.1
# via django-compressor
sqlparse==0.4.4
# via
# django
# django-debug-toolbar
typing-extensions==4.9.0
# via pyee

17
requirements.in Normal file
View file

@ -0,0 +1,17 @@
beautifulsoup4
bleach
bleach-allowlist
Django
django-generate-secret-key
django-registration
django-sass-processor
django-widget-tweaks
django4-background-tasks
djangorestframework
Markdown
psycopg2-binary
python-dateutil
requests
supervisor
uWSGI
waybackpy

View file

@ -1,29 +0,0 @@
asgiref==3.5.2
beautifulsoup4==4.11.1
bleach==6.0.0
bleach-allowlist==1.0.3
certifi==2023.7.22
charset-normalizer==2.1.1
click==8.1.3
confusable-homoglyphs==3.2.0
Django==4.1.13
django-generate-secret-key==1.0.2
django-registration==3.3
django-sass-processor==1.2.1
django-widget-tweaks==1.4.12
django4-background-tasks==1.2.7
djangorestframework==3.13.1
idna==3.3
Markdown==3.4.3
psycopg2==2.9.5
python-dateutil==2.8.2
pytz==2022.2.1
requests==2.31.0
soupsieve==2.3.2.post1
sqlparse==0.4.4
supervisor==4.2.4
typing-extensions==3.10.0.0
urllib3==1.26.18
uWSGI==2.0.22
waybackpy==3.0.6
webencodings==0.5.1

View file

@ -1,47 +1,78 @@
asgiref==3.5.2
beautifulsoup4==4.11.1
black==24.1.0
bleach==6.0.0
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements.in
#
asgiref==3.7.2
# via django
beautifulsoup4==4.12.3
# via -r requirements.in
bleach==6.1.0
# via -r requirements.in
bleach-allowlist==1.0.3
certifi==2023.7.22
charset-normalizer==2.1.1
click==8.1.3
# via -r requirements.in
certifi==2023.11.17
# via requests
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via waybackpy
confusable-homoglyphs==3.2.0
coverage==5.5
Django==4.1.13
django-appconf==1.0.5
django-compressor==4.1
django-debug-toolbar==3.6.0
django-registration==3.3
django-sass-processor==1.2.1
django-widget-tweaks==1.4.12
django4-background-tasks==1.2.7
django_generate_secret_key==1.0.2
djangorestframework==3.13.1
greenlet==3.0.1
idna==3.3
iniconfig==2.0.0
libsass==0.21.0
Markdown==3.4.3
mypy-extensions==1.0.0
packaging==23.2
pathspec==0.12.1
platformdirs==4.1.0
playwright==1.40.0
pluggy==1.4.0
psycopg2-binary==2.9.5
pyee==11.0.1
pytest==7.4.4
pytest-django==4.7.0
# via django-registration
django==5.0.1
# via
# -r requirements.in
# django-generate-secret-key
# django-registration
# djangorestframework
django-generate-secret-key==1.0.2
# via -r requirements.in
django-registration==3.4
# via -r requirements.in
django-sass-processor==1.4
# via -r requirements.in
django-widget-tweaks==1.5.0
# via -r requirements.in
django4-background-tasks==1.2.9
# via -r requirements.in
djangorestframework==3.14.0
# via -r requirements.in
idna==3.6
# via requests
markdown==3.5.2
# via -r requirements.in
psycopg2-binary==2.9.9
# via -r requirements.in
python-dateutil==2.8.2
pytz==2022.2.1
rcssmin==1.1.0
# via -r requirements.in
pytz==2023.3.post1
# via djangorestframework
requests==2.31.0
rjsmin==1.2.0
# via
# -r requirements.in
# waybackpy
six==1.16.0
soupsieve==2.3.2.post1
# via
# bleach
# django4-background-tasks
# python-dateutil
soupsieve==2.5
# via beautifulsoup4
sqlparse==0.4.4
typing-extensions==3.10.0.0
urllib3==1.26.18
# via django
supervisor==4.2.5
# via -r requirements.in
urllib3==2.1.0
# via
# requests
# waybackpy
uwsgi==2.0.23
# via -r requirements.in
waybackpy==3.0.6
# via -r requirements.in
webencodings==0.5.1
# via bleach
# The following packages are considered to be unsafe in a requirements file:
# setuptools