Skip to content
Draft
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
  •  
  •  
  •  
9 changes: 7 additions & 2 deletions .docker/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
FROM python:3.13-trixie

ENV PYTHONUNBUFFERED=1
# Install the workspace into the system environment (instead of a .venv inside
# the bind-mounted /code) so `uv run` is fast and doesn't pollute the host tree.
ENV UV_PROJECT_ENVIRONMENT=/usr/local

# uv ships as a standalone binary in this image
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

COPY entrypoint.sh /

WORKDIR /code

RUN apt update && \
apt install -y postgresql-client-17 && \
python -m pip install pipenv
apt install -y postgresql-client-17

ENTRYPOINT ["/entrypoint.sh"]
16 changes: 8 additions & 8 deletions .docker/web/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source .env

# Install or update dependencies on every start in case something changed
pipenv install --dev
uv sync

# Some users prefer to develop on their host rather than containers and have adjusted .env
if [ $POSTGRES_HOST == "localhost" ]; then
Expand All @@ -17,22 +17,22 @@ until pg_isready -h "$POSTGRES_HOST" -U "$POSTGRES_USER" &> /dev/null; do
done

# Apply pending migrations on every start
pipenv run python -m serveradmin migrate --no-input
uv run python -m serveradmin migrate --no-input

# Requires Django >= 3.x
# pipenv run python -m serveradmin createsuper --no-input
pipenv run python -m serveradmin createdefaultuser
# uv run python -m serveradmin createsuper --no-input
uv run python -m serveradmin createdefaultuser

# Create default application
pipenv run python -m serveradmin createapp --non-interactive
uv run python -m serveradmin createapp --non-interactive

echo -e "
********************************************************************************

\e[32m[TIPS]\e[39m
- Run 'docker compose exec web /bin/bash' to access web service
- Run 'pipenv run python -m serveradmin -h' in web service to access django commands
- Run 'pipenv run python -m adminapi example.com' in web service to make adminapi queries
- Run 'uv run python -m serveradmin -h' in web service to access django commands
- Run 'uv run python -m adminapi example.com' in web service to make adminapi queries

\e[33mAccess serveradmin from your browser via:\e[39m
- URL: http://127.0.0.1:8000
Expand All @@ -43,4 +43,4 @@ echo -e "
"

# Start development server reachable for host machine
pipenv run python -m serveradmin runserver 0.0.0.0:8000
uv run python -m serveradmin runserver 0.0.0.0:8000
29 changes: 12 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
strategy:
matrix:
python:
- "3.9"
- "3.13"
- "3.11" # Debian Bookworm
- "3.13" # Debian Trixie

services:
db:
Expand All @@ -33,18 +33,13 @@ jobs:
--health-retries 5

steps:
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Prepare
run: |
pip install --upgrade pip
pip install pipenv
pipenv lock --python ${{ matrix.python }}
pipenv install --dev --python ${{ matrix.python }}
uv sync --python ${{ matrix.python }}
echo "DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
Expand All @@ -61,14 +56,14 @@ jobs:
}
SECRET_KEY = 'TEST'
TIME_ZONE = 'Europe/Berlin'
LOGGING = {}" > serveradmin/local_settings.py
cat serveradmin/local_settings.py
pipenv run python -m serveradmin migrate
LOGGING = {}" > packages/serveradmin/serveradmin/local_settings.py
cat packages/serveradmin/serveradmin/local_settings.py
uv run python -m serveradmin migrate
- name: Tests
run: |
# This will use Python's standard unit test discovery feature.
pipenv run python -m unittest discover adminapi -v
pipenv run python -Wall -m serveradmin test --noinput --parallel=1
uv run python -m unittest discover -t packages/adminapi -s packages/adminapi/adminapi -v
uv run python -Wall -m serveradmin test serveradmin --noinput --parallel=1
# Build sphinx docs, error on warning
cd docs
SPHINXBUILD='pipenv run sphinx-build' SPHINXOPTS='-W' make html
SPHINXBUILD='uv run --group docs sphinx-build' SPHINXOPTS='-W' make html
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ __pycache__/

# Virtual Environment
/venv/
/.venv/
/.env

# Pipenv
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
19 changes: 6 additions & 13 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,13 @@

version: 2

# Set the version of Python and other tools you might need
# Build the docs with uv so the same workspace + docs dependency group used
# everywhere else also drives the Read the Docs build.
build:
os: ubuntu-24.04
tools:
python: "3.12"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
commands:
- python -m pip install uv
- uv sync --group docs
- uv run sphinx-build -W -b html docs/source $READTHEDOCS_OUTPUT/html
50 changes: 0 additions & 50 deletions Pipfile

This file was deleted.

Loading
Loading