This Python package provides the repository system for 4TU.ResearchData.
To create a development environment, use the following snippet:
python -m venv djehuty-env
. djehuty-env/bin/activate
cd /path/to/the/repository/checkout/root
pip install -r requirements.txt
Note: On Windows Powershell, replace . djehuty-env/bin/activate
with
djehuty-env\Scripts\Activate.ps1
.
To get an interactive development environment, use:
sed -e 's/@VERSION@/0.0.1/g' pyproject.toml.in > pyproject.toml
pip install --editable .
cp etc/djehuty/djehuty-example-config.xml djehuty.xml
djehuty web --config-file djehuty.xml
Note: On Windows, instead of the sed
command, copy pyproject.toml.in
to pyproject.toml
and change the version from @VERSION@
to 0.0.1
.
To update packages in the virtual environment, use the following command inside an activated virtual environment:
pip freeze | grep -v "djehuty.git" | cut -d= -f1 | xargs -n1 pip install -U
Djehuty needs a SPARQL 1.1 endpoint such as Virtuoso OSE or Jena Fuseki to store its state.
Upon first run, djehuty
needs to initialize the database with categories,
licences and accounts. To do so, pass the --initialize
option to the
djehuty web
command:
djehuty web --initialize --config djehuty.xml
Create a portable executable with:
pip install pyinstaller
pyinstaller --onefile \
--hidden-import=_cffi_backend \
--add-data "src/djehuty/web/resources:djehuty/web/resources" \
--name djehuty \
main.py
On Windows, use:
pip install pyinstaller
pyinstaller --onefile \
--hidden-import=_cffi_backend \
--add-data="src/djehuty/web/resources;djehuty/web/resources" \
--icon="src/djehuty/web/resources/static/images/favicon.ico" \
--name=djehuty \
main.py
While no support can be provided for this, the following notes may help.
Alledgedly, using Python 3.8.6 works well. Activating the virtual
environment works best from a cmd.exe
, which can be started using:
wine cmd
pip install nuitka
nuitka3 --standalone \
--include-module=rdflib.plugins \
--include-module=_cffi_backend \
--include-package-data=djehuty \
--onefile \
--linux-onefile-icon="src/djehuty/web/resources/static/images/favicon.png" \
main.py \
-o djehuty.appimage
Building RPMs can be done via the Autotools scripts:
autoreconf -vif
./configure
make dist-rpm
The RPMs will be available under rpmbuild/RPMS/noarch
.
djehuty web --config-file=djehuty.xml
An example of a configuration file can be found in etc/djehuty/djehuty-example-config.xml.
Use the maximum-workers
configuration option to use forking rather than threading.
On EL7, install uwsgi
and uwsgi-plugin-python36
.
uwsgi --plugins-dir /usr/lib64/uwsgi --need-plugin python36,http --http :8080 --wsgi-file src/djehuty/web/ui.py -H <path-to-your-virtualenv-root> --env DJEHUTY_CONFIG_FILE=djehuty.xml --master --processes 4 --threads 2