Skip to main content

The 4TU.ResearchData repository system

Project description

djehuty

This Python package provides the repository system for 4TU.ResearchData.

Develop

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.

Interactive development

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.

Keeping your development environment up-to-date

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

Setting up the database

Djehuty needs a SPARQL 1.1 endpoint such as Virtuoso OSE or Jena Fuseki to store its state.

First run

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

Deploy

PyInstaller

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

Tricks when building using WINE

While no support can be provided for this, the following notes may help. Allegedly, using Python 3.8.6 works well. Activating the virtual environment works best from a cmd.exe, which can be started using:

wine cmd

Build an AppImage with Nuitka

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

Build RPMs

Building RPMs can be done via the Autotools scripts:

autoreconf -vif
./configure
make dist-rpm

The RPMs will be available under rpmbuild/RPMS/noarch.

Run

Using the built-in web server

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.

Using uwsgi:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djehuty-24.10.1.tar.gz (3.8 MB view details)

Uploaded Source

Built Distribution

djehuty-24.10.1-py3-none-any.whl (3.7 MB view details)

Uploaded Python 3

File details

Details for the file djehuty-24.10.1.tar.gz.

File metadata

  • Download URL: djehuty-24.10.1.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for djehuty-24.10.1.tar.gz
Algorithm Hash digest
SHA256 514b1c8cf9e6f67448192fa1d38940a7e666c194a65f3183c71451aefebc05a0
MD5 35e3f12e5317c0c3f707acf37d5505f7
BLAKE2b-256 994fe3f731522435b77e67a514d7ddb6e42ac948ec2ceae9d35b4b9353cca34f

See more details on using hashes here.

File details

Details for the file djehuty-24.10.1-py3-none-any.whl.

File metadata

  • Download URL: djehuty-24.10.1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for djehuty-24.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e40eb56faa95c92877b8da6392f32a99be0fe144af48c1f310283ceb417983e7
MD5 9c8bdd7a3a9419fcdab3d6442912d500
BLAKE2b-256 6daf8602d3b1358b28ad014cbf6ef55c76ef1ccfebebea5eacef7d4abcf66cf6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page