Skip to content

Commit

Permalink
Bump dependencies (#618)
Browse files Browse the repository at this point in the history
* Bump dependencies

* Make it work with Python 3.10

* replace psycopg2-binary with psycopg2 in Docker build
  • Loading branch information
sissbruecker authored Jan 28, 2024
1 parent 16ed6ef commit d7c1afa
Show file tree
Hide file tree
Showing 12 changed files with 192 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
!/manage.py
!/package.json
!/package-lock.json
!/requirements.prod.txt
!/requirements.dev.txt
!/requirements.txt
!/rollup.config.js
!/supervisord.conf
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
```
Expand Down
31 changes: 16 additions & 15 deletions bookmarks/tests/test_queries.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import operator
import datetime

from django.contrib.auth import get_user_model
from django.db.models import QuerySet
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

Expand Down Expand Up @@ -1195,25 +1196,25 @@ def test_sorty_by_date_added_asc(self):

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)
Expand All @@ -1226,25 +1227,25 @@ def test_sorty_by_date_added_desc(self):

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)
Expand Down
11 changes: 7 additions & 4 deletions docker/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand All @@ -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
Expand Down
11 changes: 7 additions & 4 deletions docker/default.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions requirements.dev.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
black
coverage
django-compressor
django-debug-toolbar
libsass
playwright
pytest
pytest-django
62 changes: 62 additions & 0 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -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 changes: 17 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -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
29 changes: 0 additions & 29 deletions requirements.prod.txt

This file was deleted.

Loading

0 comments on commit d7c1afa

Please sign in to comment.