Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# 2026-02-09 migrate from pylint to uv, move code to src/, format with ruff
ae0f0a6d10ff593f444e4ee7cb7441e454accf8d
f89c0968cf80bd97129ddb95b102bea2e15b650a
4264c48f4581a1348188ee90cfd89c1f61ebd5a3
df8978e2fe69bad3cb826b5f15818860075ec8e1
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "daily"
2 changes: 1 addition & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ changelog:
- "[C] bug"
- title: Other Changes
labels:
- "*"
- "*"
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
languages: ${{ matrix.language }} # TODO unknown reference?

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v6
- name: Install poetry
run: |
pipx install "poetry<2.0"
pipx inject poetry "poetry-dynamic-versioning[plugin]"
- name: Setup python and uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
- name: Build wheel
run: poetry build
run: uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
16 changes: 4 additions & 12 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,12 @@ jobs:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install poetry
run: pipx install "poetry<2.0"
- uses: actions/setup-python@v6
- name: Setup python and uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.10"
cache: 'poetry'
- name: Install poetry-dynamic-versioning
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: Install dependencies
run: |
poetry run pip install -U pip
poetry install
python-version: 3.14
- name: build
run: poetry build
run: uv build
- uses: actions/upload-artifact@v6
with:
name: ephios-dev-wheel
Expand Down
49 changes: 18 additions & 31 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,23 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.11" ]
python-version: [ "3.14" ]
steps:
- uses: actions/checkout@v6
- name: Install poetry
run: pipx install "poetry<2.0"
- uses: actions/setup-python@v6
- name: Setup python and uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: |
poetry run pip install -U pip
poetry install --with=dev
- name: check format with black
uv sync --dev --inexact --all-extras
- name: lint and format check with ruff
run: |
poetry run black --version
poetry run black --check .
- name: check import order with isort
run: |
poetry run isort --version
poetry run isort -c .
- name: Lint with pylint
run: |
poetry run pylint --version
poetry run pylint ephios
uv run ruff format --check
uv run ruff check
uv run pylint src/ephios # ruff does not have feature parity with pylint yet
- name: Run djhtml
run: poetry run djhtml -c ephios/
run: uv run djhtml -c src/ephios/
- name: Make sure we always use trimmed translation strings
run: "! git grep ' blocktranslate ' | grep -v trimmed"
- name: No use of the trans tag
Expand All @@ -51,7 +41,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.11", "3.12" ]
python-version: ["3.11", "3.12", "3.13", "3.14"]
database: [ sqlite, mysql, postgres ]
include:
- database: sqlite
Expand All @@ -63,22 +53,19 @@ jobs:

steps:
- uses: actions/checkout@v6
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v6
- name: Setup python and uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: |
sudo apt-get install gettext
poetry run pip install -U pip
poetry install --all-extras --with=dev
poetry run pip install git+https://github.com/ephios-dev/ephios-testplugin
uv sync --dev --inexact --all-extras
uv run pip install git+https://github.com/ephios-dev/ephios-testplugin
- name: Prepare files for test run
run: |
cp .env.example .env
poetry run python manage.py build
uv run manage.py build

- name: Setup postgres # postgres 14 on ubuntu 22.04
run: |
Expand All @@ -94,14 +81,14 @@ jobs:
if: matrix.database == 'mysql'

- name: Make sure all migrations are up to date # apps specified explicitly to avoid checking migrations in dependencies
run: poetry run python manage.py makemigrations --check core extra api complexsignup eventautoqualification federation files guests pages qualification_management simpleresource
run: uv run manage.py makemigrations --check core extra api complexsignup eventautoqualification federation files guests pages qualification_management simpleresource questionnaires

- name: Test apps
env:
DATABASE_URL: ${{ matrix.database_url }}
run: poetry run coverage run --source=ephios -m pytest tests/
run: uv run coverage run -m pytest tests/
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: poetry run coveralls --service=github
run: uv run coveralls --service=github
if: matrix.python-version == '3.11' && matrix.database == 'sqlite'
23 changes: 7 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
default_language_version:
python: python3
repos:
- repo: https://github.com/myint/autoflake
rev: v2.3.1
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: v6.0.0
hooks:
- id: autoflake
args:
- --in-place
- --recursive
- --remove-all-unused-imports
- --ignore-init-module-imports
- --expand-star-imports
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
- id: check-added-large-files
- repo: 'https://github.com/astral-sh/ruff-pre-commit'
rev: v0.15.0
hooks:
- id: isort
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.1.0
hooks:
- id: black
- id: ruff-check
- id: ruff-format
- repo: https://github.com/rtts/djhtml
rev: 3.0.6
hooks:
Expand Down
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# syntax=docker/dockerfile:1
FROM python:3.11-bookworm
FROM ghcr.io/astral-sh/uv:0.10.0-python3.14-trixie-slim

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV POETRY_VIRTUALENVS_CREATE=false
ENV POETRY_VERSION=1.6.1
ENV UV_NO_DEV=1

WORKDIR /usr/src/ephios

Expand All @@ -20,15 +19,15 @@ RUN dpkg-reconfigure locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8

RUN pip install "poetry==$POETRY_VERSION" gunicorn
RUN poetry self add "poetry-dynamic-versioning[plugin]"
ENV PATH=/root/.local/bin:$PATH
RUN uv tool install gunicorn

RUN mkdir -p /var/ephios/data/ && \
mkdir -p /var/log/supervisord/ && \
mkdir -p /var/run/supervisord/

COPY . /usr/src/ephios
RUN poetry install --all-extras --without=dev
RUN uv sync --locked --all-extras

COPY deployment/docker/entrypoint.sh /usr/local/bin/ephios
RUN chmod +x /usr/local/bin/ephios
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ Contributions to ephios are very welcome! Feel free to ask us for what can be do
Report bugs [on github](https://github.com/ephios-dev/ephios/issues/new?template=bug-report.md). Fork the project and create a pull request to contribute code.
You can find information about the **development setup** in [the documentation](https://docs.ephios.de/en/latest/development/contributing.html)
We are using Weblate for translations, you can also contribute [there](https://hosted.weblate.org/engage/ephios/).
Please follow our [code of conduct](https://github.com/ephios-dev/ephios/blob/main/CODE_OF_CONDUCT.md).
Please follow our [code of conduct](https://github.com/ephios-dev/ephios/blob/main/CODE_OF_CONDUCT.md).
4 changes: 2 additions & 2 deletions deployment/docker/cron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

while [ true ]; do
echo "Running cron job"
/usr/local/bin/python3 -m ephios run_periodic
uv run python -m ephios run_periodic
sleep 60
done
done
6 changes: 3 additions & 3 deletions deployment/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
set -e

if [ "$1" == "run" ]; then
python manage.py migrate
python manage.py build
uv run manage.py migrate
uv run manage.py build
exec supervisord -n -c /etc/supervisord.conf
fi

exec python manage.py "$@"
exec uv run manage.py "$@"
2 changes: 1 addition & 1 deletion docs/admin/deployment/docker/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ only possible by changing it the compose file:

The first line enables debug mode and therefore disables a redirect from http to https.
The second line disables trusting the X-Forwarded-Proto header set to https by the nginx
container, which is required for djangos CSRF protection to not kick in on http requests.
container, which is required for djangos CSRF protection to not kick in on http requests.
2 changes: 1 addition & 1 deletion docs/admin/deployment/manual/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,4 @@ After installing plugins or updating, restart the gunicorn service:

.. code-block:: console

# systemctl restart ephios-gunicorn
# systemctl restart ephios-gunicorn
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import os
from pathlib import Path

import django
import environ
from django.core import management

# -- Path setup --------------------------------------------------------------

Expand All @@ -23,7 +25,7 @@


project = "ephios"
copyright = f"{datetime.datetime.now().strftime("%Y")}, ephios-dev"
copyright = f"{datetime.datetime.now().strftime('%Y')}, ephios-dev"
author = "ephios-dev"


Expand Down Expand Up @@ -75,11 +77,9 @@
os.environ["DEBUG"] = "False"
environ.Env.read_env(env_file=str(Path(__file__).parent.parent.absolute() / ".env.example"))

import django

django.setup()

from django.core import management

management.call_command(
"spectacular", ["--color", "--file", "api/ephios-open-api-schema.yml", "--api-version", "api"]
Expand Down
28 changes: 14 additions & 14 deletions docs/development/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ To set up a development version on your local machine, you need to execute the f
* ``gettext`` (to compile translations, might also be named ``msgfmt``)

#. Check out the `repository <https://github.com/ephios-dev/ephios>`_ and cd to it
#. Set up a virtualenv for the project activate it
#. Install poetry (if not already installed): `Installation guide <https://python-poetry.org/docs/#installation>`_
#. Install dependencies with ``poetry install``
#. Install uv (if not already installed): `Installation guide <https://docs.astral.sh/uv/getting-started/installation/>`_
#. Install dependencies with ``uv sync --dev`` (this might create a virtual environment for you)
#. Create env file with ``cp .env.example .env``
#. Migrate the database with ``python manage.py migrate``
#. Prepare files for the installation with ``python manage.py build``
#. Load data for testing with ``python manage.py devdata``
#. Start the development server with ``python manage.py runserver``
#. Migrate the database with ``uv run manage.py migrate``
#. Prepare files for the installation with ``uv run manage.py build``
#. Load data for testing with ``uv run manage.py devdata``
#. Start the development server with ``uv run manage.py runserver``
#. Open your web browser, visit ``http://localhost:8000`` and log in with the default credentials (user ``admin@localhost`` and password ``admin``)

If those steps did not work for you, please contact us or open an issue in the GitHub repository.
Feel free to adjust how your shell and uv handle virtual environments to your liking.

.. warning::
The default development server is not suitable for production use. It is not secure and not performant.
Expand All @@ -45,21 +45,21 @@ Tests

We are using `pytest <https://docs.pytest.org/en/stable/>`_ along with `django-webtest <https://github.com/django-webtest/django-webtest>`_.
Please write tests for new features or fixed bugs. You can use your IDE integration to run the tests or execute the
whole test suite with ``pytest``.
whole test suite with ``uv run pytest``.

Code style
----------

We are enforcing a good code style for every pull request. To ensure that you only commit appropriate code, we recommend
installing a pre-commit hook with ``pre-commit install``. You can have a look at ``.pre-commit-config.yaml`` to check
installing a pre-commit hook with ``prek install``. You can have a look at ``.pre-commit-config.yaml`` to check
how this works. In short it executes the following steps before every commit:

* run ``autoflake`` with a couple of flags to remove unused imports,
* run ``isort .`` to sort imports,
* run ``black .`` to format the code.
* runs ``ruff`` to check for linting and formatting issues and fix them if possible,
* formats HTML templates with ``djhtml``,
* does some whitespace checks

If you want to do that manually, run ``pre-commit run --all-files``.
Next to that, we also run ``pylint ephios`` to check for semantic issues in the code.
If you want to do that manually, run ``prek run --all-files``.
Next to that, we also run ``uv run pylint src/ephios`` to check for semantic issues in the code.

Translations
------------
Expand Down
2 changes: 1 addition & 1 deletion docs/development/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ This section shows how to contribute to ephios and how to develop plugins.
:maxdepth: 3

contributing
plugins/index
plugins/index
Loading
Loading