django-strata 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- django_strata-0.2.0/.gitignore +29 -0
- django_strata-0.2.0/.gitlab-ci.yml +86 -0
- django_strata-0.2.0/.pre-commit-config.yaml +45 -0
- django_strata-0.2.0/CHANGELOG.md +26 -0
- django_strata-0.2.0/GLOSSARY.md +86 -0
- django_strata-0.2.0/LICENSE +201 -0
- django_strata-0.2.0/Makefile +33 -0
- django_strata-0.2.0/PKG-INFO +543 -0
- django_strata-0.2.0/README.md +518 -0
- django_strata-0.2.0/docs/assets/favicon.ico +0 -0
- django_strata-0.2.0/docs/assets/logo.png +0 -0
- django_strata-0.2.0/pyproject.toml +294 -0
- django_strata-0.2.0/strata/__init__.py +20 -0
- django_strata-0.2.0/strata/apps.py +19 -0
- django_strata-0.2.0/strata/checks.py +472 -0
- django_strata-0.2.0/strata/context.py +141 -0
- django_strata-0.2.0/strata/finders.py +34 -0
- django_strata-0.2.0/strata/forms.py +356 -0
- django_strata-0.2.0/strata/loaders.py +120 -0
- django_strata-0.2.0/strata/middleware.py +140 -0
- django_strata-0.2.0/strata/py.typed +0 -0
- django_strata-0.2.0/strata/registry.py +317 -0
- django_strata-0.2.0/strata/templatetags/__init__.py +0 -0
- django_strata-0.2.0/strata/templatetags/strata_tags.py +104 -0
- django_strata-0.2.0/strata/tests/__init__.py +0 -0
- django_strata-0.2.0/strata/tests/baseapp/__init__.py +0 -0
- django_strata-0.2.0/strata/tests/baseapp/apps.py +11 -0
- django_strata-0.2.0/strata/tests/conftest.py +64 -0
- django_strata-0.2.0/strata/tests/settings.py +119 -0
- django_strata-0.2.0/strata/tests/static/alt_static/altapp/css/theme.css +1 -0
- django_strata-0.2.0/strata/tests/static/base_static/testbase/css/base.css +1 -0
- django_strata-0.2.0/strata/tests/static/base_static/testbase/docs/readme.md +1 -0
- django_strata-0.2.0/strata/tests/static/testapp_static/testapp/css/theme.css +1 -0
- django_strata-0.2.0/strata/tests/templates/test-admin/base.html +16 -0
- django_strata-0.2.0/strata/tests/templates/test-admin/partials/app-footer.html +1 -0
- django_strata-0.2.0/strata/tests/templates/test-admin/partials/app-header.html +1 -0
- django_strata-0.2.0/strata/tests/templates/test-admin/partials/app-sidebar.html +1 -0
- django_strata-0.2.0/strata/tests/templates/testapp/fragments/page.html +3 -0
- django_strata-0.2.0/strata/tests/templates/testapp/full-page.html +2 -0
- django_strata-0.2.0/strata/tests/templates/testapp/htmx-response.html +3 -0
- django_strata-0.2.0/strata/tests/templates/testapp/partials/app-sidebar.html +1 -0
- django_strata-0.2.0/strata/tests/templates-alt/alt-admin/base.html +16 -0
- django_strata-0.2.0/strata/tests/templates-alt/alt-admin/partials/app-footer.html +1 -0
- django_strata-0.2.0/strata/tests/templates-alt/alt-admin/partials/app-header.html +1 -0
- django_strata-0.2.0/strata/tests/templates-alt/alt-admin/partials/app-sidebar.html +1 -0
- django_strata-0.2.0/strata/tests/templates-alt/altapp/fragments/page.html +3 -0
- django_strata-0.2.0/strata/tests/templates-alt/altapp/full-page.html +2 -0
- django_strata-0.2.0/strata/tests/templates-alt/altapp/htmx-response.html +3 -0
- django_strata-0.2.0/strata/tests/test_autodiscover.py +145 -0
- django_strata-0.2.0/strata/tests/test_build.py +137 -0
- django_strata-0.2.0/strata/tests/test_checks.py +589 -0
- django_strata-0.2.0/strata/tests/test_context.py +166 -0
- django_strata-0.2.0/strata/tests/test_finders.py +84 -0
- django_strata-0.2.0/strata/tests/test_forms.py +581 -0
- django_strata-0.2.0/strata/tests/test_integration.py +220 -0
- django_strata-0.2.0/strata/tests/test_loaders.py +309 -0
- django_strata-0.2.0/strata/tests/test_registration_order.py +46 -0
- django_strata-0.2.0/strata/tests/test_registry.py +289 -0
- django_strata-0.2.0/strata/tests/test_scaffold.py +19 -0
- django_strata-0.2.0/strata/tests/test_templatetags.py +73 -0
- django_strata-0.2.0/strata/tests/test_theme_static.py +226 -0
- django_strata-0.2.0/strata/tests/test_themed_page.py +561 -0
- django_strata-0.2.0/strata/tests/testapp/__init__.py +0 -0
- django_strata-0.2.0/strata/tests/testapp/alt_page_strategy.py +43 -0
- django_strata-0.2.0/strata/tests/testapp/apps.py +25 -0
- django_strata-0.2.0/strata/tests/testapp/layers.py +49 -0
- django_strata-0.2.0/strata/tests/testapp/page_strategy.py +72 -0
- django_strata-0.2.0/strata/tests/testapp/urls.py +19 -0
- django_strata-0.2.0/strata/tests/testapp/views.py +17 -0
- django_strata-0.2.0/strata/tests/urls.py +25 -0
- django_strata-0.2.0/uv.lock +1195 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
.venv/
|
|
8
|
+
|
|
9
|
+
# Tooling caches
|
|
10
|
+
.pytest_cache/
|
|
11
|
+
.ruff_cache/
|
|
12
|
+
.mypy_cache/
|
|
13
|
+
.coverage
|
|
14
|
+
htmlcov/
|
|
15
|
+
|
|
16
|
+
# Release artifacts
|
|
17
|
+
CHANGELOG.md.sha256
|
|
18
|
+
requirements-sbom.txt
|
|
19
|
+
sbom.json
|
|
20
|
+
|
|
21
|
+
# Editors / OS
|
|
22
|
+
.idea/
|
|
23
|
+
.vscode/
|
|
24
|
+
.DS_Store
|
|
25
|
+
*~
|
|
26
|
+
|
|
27
|
+
# AI
|
|
28
|
+
AGENTS.md
|
|
29
|
+
.opencode
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Minimal CI: lint, typecheck, test. Mirrors the local Makefile targets.
|
|
2
|
+
# The publish stage uploads to PyPI on release tags (v*) — releases are
|
|
3
|
+
# version bumps + git tags via semantic-release.
|
|
4
|
+
|
|
5
|
+
stages:
|
|
6
|
+
- quality
|
|
7
|
+
- publish
|
|
8
|
+
|
|
9
|
+
default:
|
|
10
|
+
image: ghcr.io/astral-sh/uv:python3.12-bookworm
|
|
11
|
+
cache:
|
|
12
|
+
key:
|
|
13
|
+
files:
|
|
14
|
+
- uv.lock
|
|
15
|
+
paths:
|
|
16
|
+
- .venv/
|
|
17
|
+
before_script:
|
|
18
|
+
- uv sync --frozen
|
|
19
|
+
|
|
20
|
+
ruff:
|
|
21
|
+
stage: quality
|
|
22
|
+
script:
|
|
23
|
+
- uv run ruff check strata
|
|
24
|
+
- uv run ruff format --check strata
|
|
25
|
+
|
|
26
|
+
mypy:
|
|
27
|
+
stage: quality
|
|
28
|
+
script:
|
|
29
|
+
- uv run mypy strata
|
|
30
|
+
|
|
31
|
+
pytest:
|
|
32
|
+
stage: quality
|
|
33
|
+
script:
|
|
34
|
+
- uv run pytest -q
|
|
35
|
+
|
|
36
|
+
example-smoke:
|
|
37
|
+
# The example/ project is runnable documentation: `manage.py check`
|
|
38
|
+
# exercises its settings import, the roots-before-ready() ordering
|
|
39
|
+
# contract, the TEMPLATES wiring (both engines) and every strata check
|
|
40
|
+
# against a real (example) deployment — it keeps the example honest
|
|
41
|
+
# when the package API moves. `uv sync` installs the dev group by
|
|
42
|
+
# default, so django-jinja (the example's Jinja2 backend) is present.
|
|
43
|
+
stage: quality
|
|
44
|
+
script:
|
|
45
|
+
- uv run python example/manage.py check
|
|
46
|
+
|
|
47
|
+
pytest-django-5.2:
|
|
48
|
+
# The declared floor (django>=5.2) is actually tested: override the
|
|
49
|
+
# locked django with 5.2 in the CI venv, then run the suite without
|
|
50
|
+
# letting uv re-sync it back.
|
|
51
|
+
stage: quality
|
|
52
|
+
script:
|
|
53
|
+
- uv sync --frozen
|
|
54
|
+
- uv pip install "django>=5.2,<5.3"
|
|
55
|
+
- uv run --no-sync pytest -q
|
|
56
|
+
|
|
57
|
+
pytest-django-6.0:
|
|
58
|
+
# The 6.x classifiers declare support — each series is tested, same
|
|
59
|
+
# override pattern as the 5.2 floor job above.
|
|
60
|
+
stage: quality
|
|
61
|
+
script:
|
|
62
|
+
- uv sync --frozen
|
|
63
|
+
- uv pip install "django>=6.0,<6.1"
|
|
64
|
+
- uv run --no-sync pytest -q
|
|
65
|
+
|
|
66
|
+
pytest-django-6.1:
|
|
67
|
+
stage: quality
|
|
68
|
+
script:
|
|
69
|
+
- uv sync --frozen
|
|
70
|
+
- uv pip install "django>=6.1,<6.2"
|
|
71
|
+
- uv run --no-sync pytest -q
|
|
72
|
+
|
|
73
|
+
publish-pypi:
|
|
74
|
+
# PyPI upload on release tags (semantic-release's v{version} format):
|
|
75
|
+
# build the wheel/sdist, publish with the group's PYPI_TOKEN. The token
|
|
76
|
+
# is a protected variable — protected variables only reach protected
|
|
77
|
+
# refs, so the v* tag wildcard is protected (see project settings).
|
|
78
|
+
# Tagged co-plus-plus: the publish runs on the group's own runner.
|
|
79
|
+
stage: publish
|
|
80
|
+
tags:
|
|
81
|
+
- co-plus-plus
|
|
82
|
+
rules:
|
|
83
|
+
- if: $CI_COMMIT_TAG =~ /^v/
|
|
84
|
+
script:
|
|
85
|
+
- uv build
|
|
86
|
+
- uv publish --token "$PYPI_TOKEN"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
exclude: '/migrations/|.*/static/'
|
|
2
|
+
default_stages: [commit]
|
|
3
|
+
|
|
4
|
+
default_language_version:
|
|
5
|
+
python: python3.12
|
|
6
|
+
|
|
7
|
+
repos:
|
|
8
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
9
|
+
rev: v4.5.0
|
|
10
|
+
hooks:
|
|
11
|
+
- id: trailing-whitespace
|
|
12
|
+
- id: end-of-file-fixer
|
|
13
|
+
- id: check-json
|
|
14
|
+
- id: check-toml
|
|
15
|
+
- id: check-yaml
|
|
16
|
+
- id: debug-statements
|
|
17
|
+
- id: check-builtin-literals
|
|
18
|
+
- id: check-case-conflict
|
|
19
|
+
- id: check-docstring-first
|
|
20
|
+
- id: detect-private-key
|
|
21
|
+
|
|
22
|
+
- repo: https://github.com/adamchainz/django-upgrade
|
|
23
|
+
rev: '1.16.0'
|
|
24
|
+
hooks:
|
|
25
|
+
- id: django-upgrade
|
|
26
|
+
args: ['--target-version', '5.2']
|
|
27
|
+
|
|
28
|
+
# Run the Ruff linter and formatter. The lint surface mirrors
|
|
29
|
+
# django-template's so Phase 1's code move stays mechanical.
|
|
30
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
31
|
+
rev: v0.14.5
|
|
32
|
+
hooks:
|
|
33
|
+
- id: ruff
|
|
34
|
+
types_or: [ python, pyi ]
|
|
35
|
+
args: [--fix, --exit-non-zero-on-fix]
|
|
36
|
+
- id: ruff-format
|
|
37
|
+
types_or: [ python, pyi ]
|
|
38
|
+
|
|
39
|
+
# djlint joins in Phase 1/3 when the package ships templates (the package
|
|
40
|
+
# itself has none yet).
|
|
41
|
+
|
|
42
|
+
ci:
|
|
43
|
+
autoupdate_schedule: weekly
|
|
44
|
+
skip: []
|
|
45
|
+
submodules: false
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
<!-- version list -->
|
|
4
|
+
|
|
5
|
+
## v0.2.0 (2026-11-23)
|
|
6
|
+
|
|
7
|
+
### Documentation
|
|
8
|
+
|
|
9
|
+
- Add strata logo, favicon and README slogan
|
|
10
|
+
([`f7067f2`](https://gitlab.com/co-plus-plus/django-strata/-/commit/f7067f2c9ace6b2f7654858c39b124d5a7093470))
|
|
11
|
+
|
|
12
|
+
- Restore the original opening line under the new slogan
|
|
13
|
+
([`f829a6a`](https://gitlab.com/co-plus-plus/django-strata/-/commit/f829a6a35300f4c672a3964a89e4fa2d03322a7b))
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
- Form-renderer registry + StrataFormRenderer dispatcher
|
|
18
|
+
([`8c93725`](https://gitlab.com/co-plus-plus/django-strata/-/commit/8c937259e69af2126334674efebdf38cb174c932))
|
|
19
|
+
|
|
20
|
+
- **demo**: Strata logo and favicon in the example shells
|
|
21
|
+
([`f382d5f`](https://gitlab.com/co-plus-plus/django-strata/-/commit/f382d5f278b680b8173aaf25cee31fde8ff4df54))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## v0.1.0 (2026-11-23)
|
|
25
|
+
|
|
26
|
+
- Initial Release
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Glossary
|
|
2
|
+
|
|
3
|
+
The project's vocabulary — the terms the package's seams, system checks,
|
|
4
|
+
and docs use. Each entry names the seam that owns the concept.
|
|
5
|
+
|
|
6
|
+
## Form renderer
|
|
7
|
+
|
|
8
|
+
A **form renderer** renders a Django form's HTML — the templates behind
|
|
9
|
+
`{{ form }}`, `form.as_div()`, `BoundField`s, and widget markup. Renderers
|
|
10
|
+
are registered **per theme namespace** (`register_form_renderer`, from the
|
|
11
|
+
theme's `AppConfig.ready()`; a class or an instance — classes instantiate
|
|
12
|
+
lazily on first resolution) and resolved by the **request's shell theme**:
|
|
13
|
+
all forms rendered during a request whose URL resolves to the `mytheme`
|
|
14
|
+
shell — third-party apps' forms included — render through `mytheme`'s
|
|
15
|
+
registered renderer. The form never mentions the engine; the view never
|
|
16
|
+
mentions the renderer. Owned by `strata.forms`.
|
|
17
|
+
|
|
18
|
+
## The dispatcher
|
|
19
|
+
|
|
20
|
+
`StrataFormRenderer` — the shipped `FORM_RENDERER` implementation and the
|
|
21
|
+
form-rendering seam. It reads the request-scoped theme contextvar on
|
|
22
|
+
**every form-render call** and delegates `render()`/`get_template()` — and
|
|
23
|
+
proxies the `bound_field_class` / template-name defaults forms read
|
|
24
|
+
directly off `form.renderer` — to the resolved target. Zero per-request
|
|
25
|
+
state: the default renderer is instantiated once per process, so the
|
|
26
|
+
dispatcher is a singleton and all dispatch goes through the contextvar at
|
|
27
|
+
call time. Wired with one line:
|
|
28
|
+
`FORM_RENDERER = "strata.forms.StrataFormRenderer"`.
|
|
29
|
+
`FirstRegisteredFormRenderer` is the first-registered-fallback variant;
|
|
30
|
+
subclassing with a custom `fallback` is the extension point — the two
|
|
31
|
+
valid mode strings are `FALLBACK_DJANGO` and `FALLBACK_FIRST_REGISTERED`
|
|
32
|
+
(anything else raises `ImproperlyConfigured` at class definition). The
|
|
33
|
+
per-form escape hatch is Django's own seam (`Form(renderer=...)`,
|
|
34
|
+
`form.renderer =`, `default_renderer`) — it beats the global default.
|
|
35
|
+
|
|
36
|
+
## Fallback mode
|
|
37
|
+
|
|
38
|
+
What renders when the request has no shell theme (an unthemed area: admin,
|
|
39
|
+
emails, management commands) or its theme registered no renderer. Two
|
|
40
|
+
ready-made modes: `FALLBACK_DJANGO` (the default) — stock Django forms,
|
|
41
|
+
**recursion-guarded** (the renderer `settings.FORM_RENDERER` names, unless
|
|
42
|
+
that *is* the dispatcher — then `django.forms.renderers.DjangoTemplates`;
|
|
43
|
+
never `get_default_renderer()`, which would return the dispatcher itself);
|
|
44
|
+
and `FALLBACK_FIRST_REGISTERED` — the first-registered renderer (the
|
|
45
|
+
contextvar being unset included), deliberately symmetric with
|
|
46
|
+
`find_page_strategy()`'s first-registered invariant. An empty registry
|
|
47
|
+
always falls back to stock Django: never raise — forms must render, so a
|
|
48
|
+
dispatcher-wired-with-no-registrations deployment is a legitimate
|
|
49
|
+
stock-everywhere deployment.
|
|
50
|
+
|
|
51
|
+
## Fast form-render engine
|
|
52
|
+
|
|
53
|
+
The shipped theme renderer's (`ThemeFormRenderer`) standalone
|
|
54
|
+
`DjangoTemplates` backend: `NAME: "strata-forms"`, `DIRS` from strata's
|
|
55
|
+
registered template roots plus the stock form templates dir,
|
|
56
|
+
`APP_DIRS: True`, and `OPTIONS: {}` — **no context processors, ever**
|
|
57
|
+
(form rendering needs none, and the engine never reads request state).
|
|
58
|
+
Built lazily at first use. `get_template()` rewrites the stock form
|
|
59
|
+
template prefix, so theme form partials shadow the stock names
|
|
60
|
+
(`django/forms/div.html` → `ocean/forms/div.html`): the partial tree
|
|
61
|
+
mirrors the stock tree under `<namespace>/forms/`.
|
|
62
|
+
|
|
63
|
+
## Shell theme
|
|
64
|
+
|
|
65
|
+
The namespace slug of the root layer the request's URL resolves to,
|
|
66
|
+
published by `ThemedPageMiddleware` in the request-scoped contextvar
|
|
67
|
+
(`strata.context.current_theme_slug()`; async-safe). The single lookup
|
|
68
|
+
every per-request seam reads: the page strategy, the theme template
|
|
69
|
+
loader, and the form renderer all dispatch on it — the dispatch unit is
|
|
70
|
+
the request's shell theme, not "a namespace".
|
|
71
|
+
|
|
72
|
+
## Namespace
|
|
73
|
+
|
|
74
|
+
An implicit slug — there is no namespace registration. A namespace is
|
|
75
|
+
whatever slug appears as the key of a registered `(namespace, dir)` pair,
|
|
76
|
+
a root layer's `theme=`, or a form-renderer registration key. Precedence
|
|
77
|
+
is registration data (the order given is the resolution order), not a
|
|
78
|
+
named flag.
|
|
79
|
+
|
|
80
|
+
## Page strategy
|
|
81
|
+
|
|
82
|
+
The theme-registered `page_strategy(request, response)` callable that
|
|
83
|
+
shapes every `TemplateResponse` under a themed URL area — full page or
|
|
84
|
+
partial. Registered with `register_page_strategy`; lookup is the shell
|
|
85
|
+
theme's strategy first, then the first-registered one. Owned by
|
|
86
|
+
`strata.middleware`.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but not
|
|
32
|
+
limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing
|
|
141
|
+
the origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Fraunhofer FOKUS
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Makefile - django-strata development workflow
|
|
2
|
+
|
|
3
|
+
.PHONY: install lock upgrade test lint format typecheck release clean
|
|
4
|
+
|
|
5
|
+
install: ## Create .venv and sync dependencies from uv.lock
|
|
6
|
+
uv sync
|
|
7
|
+
|
|
8
|
+
lock: ## Resolve dependencies and update uv.lock
|
|
9
|
+
uv lock
|
|
10
|
+
|
|
11
|
+
upgrade: ## Re-lock with newer versions of all dependencies
|
|
12
|
+
uv lock --upgrade && uv sync
|
|
13
|
+
|
|
14
|
+
test: ## Run the pytest suite
|
|
15
|
+
uv run pytest $(PYTEST_FLAGS)
|
|
16
|
+
|
|
17
|
+
lint: ## Run ruff checks
|
|
18
|
+
uv run ruff check strata && uv run ruff format --check strata
|
|
19
|
+
|
|
20
|
+
format: ## Apply ruff formatting and autofixes
|
|
21
|
+
uv run ruff check --fix strata && uv run ruff format strata
|
|
22
|
+
|
|
23
|
+
typecheck: ## Run mypy against the package source
|
|
24
|
+
uv run mypy strata
|
|
25
|
+
|
|
26
|
+
NOOP ?= --noop
|
|
27
|
+
|
|
28
|
+
release: ## Preview a release with semantic-release (add NOOP= to release for real)
|
|
29
|
+
uv run semantic-release $(NOOP) version --vcs-release
|
|
30
|
+
|
|
31
|
+
clean: ## Remove build/test artifacts and caches
|
|
32
|
+
rm -rf .pytest_cache .ruff_cache .mypy_cache htmlcov coverage.xml dist build
|
|
33
|
+
find . -type d -name '__pycache__' -not -path './.venv/*' -exec rm -rf {} +
|