Skip to content
Snippets Groups Projects
Commit b5fca7c1 authored by Georg Krause's avatar Georg Krause
Browse files

Update PyLD to version 2.0

parent 539ff45b
Branches
No related tags found
No related merge requests found
...@@ -17,6 +17,8 @@ RUN \ ...@@ -17,6 +17,8 @@ RUN \
openldap-dev \ openldap-dev \
openssl-dev \ openssl-dev \
cargo \ cargo \
libxml2-dev \
libxslt-dev \
&& \ && \
\ \
ln -s /usr/bin/python3 /usr/bin/python ln -s /usr/bin/python3 /usr/bin/python
...@@ -57,6 +59,8 @@ RUN apk add --no-cache \ ...@@ -57,6 +59,8 @@ RUN apk add --no-cache \
jpeg-dev \ jpeg-dev \
ffmpeg \ ffmpeg \
libpq \ libpq \
libxml2 \
libxslt \
&& \ && \
\ \
ln -s /usr/bin/python3 /usr/bin/python ln -s /usr/bin/python3 /usr/bin/python
......
...@@ -46,6 +46,17 @@ def expand(doc, options=None, default_contexts=["AS", "FW", "SEC"]): ...@@ -46,6 +46,17 @@ def expand(doc, options=None, default_contexts=["AS", "FW", "SEC"]):
# probably an already expanded document # probably an already expanded document
pass pass
# XXX This is a hotfix for a bug in pyld. The JSON-LD allows empty dicts or lists as part of the
# context, but this makes pyld failing to parse the context the right way. So we remove all
# empty items from the contexts
try:
for active_ctx in doc["@context"]:
if len(active_ctx) == 0:
doc["@context"].remove(active_ctx)
except KeyError:
# Nothing to do here if no context is available at all
pass
result = pyld.jsonld.expand(doc, options=options) result = pyld.jsonld.expand(doc, options=options)
try: try:
# jsonld.expand returns a list, which is useless for us # jsonld.expand returns a list, which is useless for us
......
...@@ -54,7 +54,7 @@ python-ldap~=3.3.0 ...@@ -54,7 +54,7 @@ python-ldap~=3.3.0
django-auth-ldap~=2.4.0 django-auth-ldap~=2.4.0
pydub~=0.25.1 pydub~=0.25.1
pyld~=1.0.0 pyld~=2.0.3
aiohttp~=3.7.4 aiohttp~=3.7.4
django-oauth-toolkit~=1.3.0 django-oauth-toolkit~=1.3.0
......
...@@ -37,7 +37,7 @@ On Debian-like systems, you can install them using: ...@@ -37,7 +37,7 @@ On Debian-like systems, you can install them using:
sudo apt-get update sudo apt-get update
# Install system dependencies # Install system dependencies
sudo apt-get install curl python3-pip python3-venv git unzip libldap2-dev libsasl2-dev gettext-base zlib1g-dev libffi-dev libssl-dev sudo apt-get install curl python3-pip python3-venv git unzip libldap2-dev libsasl2-dev gettext-base zlib1g-dev libffi-dev libssl-dev libxml2-dev libxslti1-dev
# Funkwhale dependencies # Funkwhale dependencies
sudo apt install build-essential ffmpeg libjpeg-dev libmagic-dev libpq-dev postgresql-client python3-dev make sudo apt install build-essential ffmpeg libjpeg-dev libmagic-dev libpq-dev postgresql-client python3-dev make
...@@ -389,7 +389,7 @@ And start the services: ...@@ -389,7 +389,7 @@ And start the services:
To ensure all Funkwhale processes are started automatically after a reboot, run: To ensure all Funkwhale processes are started automatically after a reboot, run:
.. code-block:: shell .. code-block:: shell
sudo systemctl enable funkwhale-server sudo systemctl enable funkwhale-server
sudo systemctl enable funkwhale-worker sudo systemctl enable funkwhale-worker
sudo systemctl enable funkwhale-beat sudo systemctl enable funkwhale-beat
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment