From 8f3ea59a70045bbf2002f69bd3b7782a0941e716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Wed, 13 Nov 2024 10:18:04 +0100 Subject: [PATCH] fix: do not install '--all-extras' by default in the demo env since it may require to compile dependencies for the mariadb backend for instance. --- CONTRIBUTING.rst | 8 ++++++-- demo/Dockerfile-canaille | 2 +- demo/run.sh | 4 +++- pyproject.toml | 2 +- uv.lock | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 5aec86c8..668bcd06 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -21,7 +21,11 @@ The only tool required for local development is `uv`. Make sure to have uv `installed on your computer `_ to be able to hack Canaille. -Initialize your development environment with ``uv sync --all-extras``. +Initialize your development environment with: +- ``uv sync --extra front --extra oidc`` to have a minimal working development environment. This will allow you to run the tests with ``uv pytest --backend memory``. +- ``uv sync --extra front --extra oidc --extra sqlite`` to have a minimal working development environment with SQLite backend support. This will allow you to run the tests with ``uv pytest --backend sql``. +- ``uv sync --extra front --extra oidc --extra ldap`` to have a minimal working development environment with LDAP backend support. This will allow you to run the tests with ``uv pytest --backend ldap``. +- ``uv sync --all-extras`` if you want to have everything at your fingertips. Note that it may compile some Python dependencies that would expect things to be installed on your system; Some dependencies of Canaille might need to be compiled, so you probably want to check that `GCC` and `cargo` are available on your computer. After having launched the demo you have access to several services: @@ -178,7 +182,7 @@ The generated documentation is located at ``build/sphinx/html``. Publish a new release --------------------- -1. Check that dependencies are up to date with ``uv sync --upgrade`` and update dependencies accordingly in separated commits; +1. Check that dependencies are up to date with ``uv sync --all-extras --upgrade`` and update dependencies accordingly in separated commits; 2. Check that tests are still green for every supported python version, and that coverage is still at 100%, by running ``uv run tox``; 3. Check that the demo environments are still working, both the local and the Docker one; 4. Check that the :ref:`development/changelog:Release notes` section is correctly filled up; diff --git a/demo/Dockerfile-canaille b/demo/Dockerfile-canaille index e098ad3a..2b75ff3d 100644 --- a/demo/Dockerfile-canaille +++ b/demo/Dockerfile-canaille @@ -22,6 +22,6 @@ COPY uv.lock pyproject.toml hatch_build.py LICENSE.rst README.md demo/demoapp.py COPY canaille /opt/canaille/canaille RUN pip install uv WORKDIR /opt/canaille -RUN uv sync --group demo --all-extras +RUN uv sync --group demo --extra front --extra oidc --extra ldap --extra sqlite ENTRYPOINT ["uv", "run", "flask", "run", "--host=0.0.0.0", "--extra-files", "/opt/canaille/conf/canaille-memory.toml", "--extra-files", "/opt/canaille/conf/canaille-ldap.toml", "--extra-files", "/opt/canaille/conf/canaille-sql.toml"] diff --git a/demo/run.sh b/demo/run.sh index 1f898bf6..fc7278c1 100755 --- a/demo/run.sh +++ b/demo/run.sh @@ -26,14 +26,15 @@ pushd "$DIR" > /dev/null 2>&1 || exit # https://github.com/fief-dev/zxcvbn-rs-py/issues/2 export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 -uv sync --group demo --all-extras if [ "$BACKEND" = "memory" ]; then + uv sync --group demo --extra front --extra oidc uv run honcho --env ../.env --procfile Procfile-memory start elif [ "$BACKEND" = "sql" ]; then + uv sync --group demo --extra front --extra oidc --extra sqlite uv run honcho --env ../.env --procfile Procfile-sql start elif [ "$BACKEND" = "ldap" ]; then @@ -44,6 +45,7 @@ elif [ "$BACKEND" = "ldap" ]; then exit 1 fi + uv sync --group demo --extra front --extra oidc --extra ldap uv run honcho --env ../.env --procfile Procfile-ldap start else diff --git a/pyproject.toml b/pyproject.toml index 16739f50..7945c694 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -220,7 +220,7 @@ env_list = [ set_env = {PYO3_USE_ABI3_FORWARD_COMPATIBILITY = "1"} runner = "uv-venv-lock-runner" dependency_groups = ["dev"] -uv_sync_flags = ["--all-extras"] +uv_sync_flags = ["--extra", "front", "--extra", "oidc", "--extra", "sqlite", "--extra", "ldap"] commands = [ ["pytest", "--showlocals", "--full-trace", "{posargs}"], ] diff --git a/uv.lock b/uv.lock index 4c8cff55..03eafa2c 100644 --- a/uv.lock +++ b/uv.lock @@ -121,7 +121,7 @@ wheels = [ [[package]] name = "canaille" -version = "0.0.55" +version = "0.0.56" source = { editable = "." } dependencies = [ { name = "flask" },