Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
afad4be
Add i18n support for parser/lexer/schema error messages
mpasternak May 13, 2026
bcfd457
Fix C812 missing trailing commas in i18n schema messages
mpasternak May 13, 2026
8257c3e
Add .pre-commit-config.yaml for changed-file linting
mpasternak May 13, 2026
4f8d4f3
Merge pull request #1 from iplweb/feature-i18n
mpasternak May 13, 2026
f72cd2d
Convert packaging from setup.py/setup.cfg to uv + pyproject.toml
mpasternak Jun 2, 2026
69f6cdc
Add bumpver for version management
mpasternak Jun 2, 2026
6579829
Switch pre-commit/lint stack from flake8+isort to ruff
mpasternak Jun 2, 2026
e1a0bdb
Switch test runner to pytest and modernize CI workflow
mpasternak Jun 3, 2026
8543bee
Clean up: .gitignore patterns and README version claim
mpasternak Jun 3, 2026
bd34343
Convert README from RST to Markdown and patch in badges, features, ma…
mpasternak Jun 3, 2026
371eb42
Release prep: bump version to 0.20.0 and record breaking change
mpasternak Jun 3, 2026
9a5dca0
Rename distribution to djangoql-iplweb (import name unchanged)
mpasternak Jun 3, 2026
5b70e97
Remove obsolete __future__ imports
mpasternak Jun 3, 2026
de78171
Remove the Py2/Py3 compat module
mpasternak Jun 3, 2026
e6028d5
Remove u'...' string prefixes (no-op since Py3.3)
mpasternak Jun 3, 2026
79336a8
Simplify super() calls to the Py3 no-arg form
mpasternak Jun 3, 2026
0918d4b
Drop redundant object base class from class definitions
mpasternak Jun 3, 2026
b83ece6
Harden CI and tighten publication metadata (OSS audit WARN fixes)
mpasternak Jun 3, 2026
02226f5
Remove dead Django-version compatibility import shims
mpasternak Jun 3, 2026
9d1462a
Add CONTRIBUTING.md documenting the dev + linting workflow
mpasternak Jun 3, 2026
2b58d4e
Merge feature-i18n: modernize packaging, tooling, i18n; release 0.20.0
mpasternak Jun 3, 2026
b5d011f
README: clarify fork status, point to upstream, drop "used by" logos
mpasternak Jun 3, 2026
976cd89
README: add "Supported by iplweb" credit
mpasternak Jun 3, 2026
01b805c
tests: raise coverage of djangoql package to 100%
mpasternak Jun 3, 2026
9cb8d1b
Merge pull request #2 from iplweb/tests/improve-coverage
mpasternak Jun 3, 2026
7c3e067
Add design spec: DjangoQL derived fields & MkDocs docs site
mpasternak Jun 3, 2026
8573995
Record sequencing decision: two plans (feature code, then docs)
mpasternak Jun 3, 2026
7d90a07
Add implementation plan: DjangoQL derived fields (code)
mpasternak Jun 3, 2026
2b4d995
feat(schema): add suggested flag to control autocomplete visibility
mpasternak Jun 3, 2026
dc7726b
test(schema): pin that suggested=False fields remain query-usable
mpasternak Jun 3, 2026
66a39d3
feat(schema): lazy get_annotations hook wired into apply_search
mpasternak Jun 3, 2026
202ac07
docs(schema): note collect_annotations requires a validated AST
mpasternak Jun 3, 2026
6a08937
test: add DateField and TimeField to Book for derived-field tests
mpasternak Jun 3, 2026
74fce83
feat(extras): date/time part fields and DatePartsSchemaMixin
mpasternak Jun 3, 2026
26e13fb
fix(extras): TimeExtractField handles list values; HH:MM[:SS] wording…
mpasternak Jun 3, 2026
cc78dfe
test: optional PostgreSQL backend via testcontainers (DJANGOQL_TEST_D…
mpasternak Jun 3, 2026
20ab30b
test(conftest): preserve parallel DB-name suffix; comment pinned PG i…
mpasternak Jun 3, 2026
59829eb
ci: run test suite against PostgreSQL via testcontainers
mpasternak Jun 3, 2026
779ce04
feat(extras): subquery-based AggregateField and CountField (reverse FK)
mpasternak Jun 3, 2026
2ae5111
fix(extras): CountField non-nullable; collision-proof annotation alias
mpasternak Jun 3, 2026
fd93afe
test(extras): CountField over ManyToMany relations
mpasternak Jun 3, 2026
8f4d8c8
feat(extras): Sum/Avg/Min/Max subquery aggregate fields
mpasternak Jun 3, 2026
a8b7aab
test(extras): nullable semantics for numeric aggregates; precision/nu…
mpasternak Jun 3, 2026
66afa33
feat(extras): AggregateSchemaMixin auto-generation and ExtrasSchema
mpasternak Jun 3, 2026
d097df0
fix(extras): skip non-editable numeric cols (GFK object_id) from aggr…
mpasternak Jun 3, 2026
bdbbf0f
test(extras): backward-compatibility guards; lint clean
mpasternak Jun 3, 2026
7bb4cc8
docs: changelog entry for derived fields and suggested flag
mpasternak Jun 3, 2026
df00ec8
Merge pull request #3 from iplweb/tests/improve-coverage
mpasternak Jun 3, 2026
30c7a98
Add implementation plan: MkDocs documentation site
mpasternak Jun 3, 2026
1806971
docs: scaffold MkDocs (Material) site; exclude superpowers/ from build
mpasternak Jun 3, 2026
ffc8a0d
docs: migrate README sections into MkDocs pages
mpasternak Jun 3, 2026
4c88649
docs: add Derived fields page (date/time parts, aggregates, suggested…
mpasternak Jun 3, 2026
f3da888
docs: include 'not in' in derived-fields operator list
mpasternak Jun 3, 2026
79fe0db
docs: trim README to overview; point to MkDocs site
mpasternak Jun 3, 2026
94159dc
docs: gitignore site/, fix Django 4+ example, quotes, typo, add PyPI …
mpasternak Jun 3, 2026
150139a
Merge pull request #4 from iplweb/docs/mkdocs-site
mpasternak Jun 3, 2026
54c026b
docs: GitHub Pages deploy workflow + site_url; point README at hosted…
mpasternak Jun 3, 2026
93a5de7
Merge pull request #5 from iplweb/docs/mkdocs-site
mpasternak Jun 3, 2026
1ddfd6e
Release 0.21.0
mpasternak Jun 3, 2026
c44380e
feat(extras): dot-syntax numeric aggregates, hide derived fields, cle…
mpasternak Jun 3, 2026
89559e9
feat: pluggable autocomplete value fields (DAL-friendly)
mpasternak Jun 3, 2026
8630e3b
feat: empty-result breakdown (explain why a query returns 0 rows)
mpasternak Jun 3, 2026
4d5d734
Merge pull request #6 from iplweb/feat/aggregate-dot-syntax
mpasternak Jun 4, 2026
16d2462
Merge branch 'master' into feat/autocomplete-value-fields
mpasternak Jun 4, 2026
bcecf8f
Merge pull request #7 from iplweb/feat/autocomplete-value-fields
mpasternak Jun 4, 2026
03de862
Merge remote-tracking branch 'origin/master' into feat/empty-result-b…
mpasternak Jun 4, 2026
9f4e203
Merge pull request #8 from iplweb/feat/empty-result-breakdown
mpasternak Jun 4, 2026
9c579d9
docs(spec): did-you-mean suggestions for unknown fields
mpasternak Jun 4, 2026
e9d4436
feat(schema): suggest close field matches for unknown-field typos
mpasternak Jun 4, 2026
6d9e68c
Merge pull request #9 from iplweb/feat/did-you-mean-fields
mpasternak Jun 4, 2026
2c84613
Release 0.22.0
mpasternak Jun 4, 2026
9cd3503
fix(schema): tighten 'did you mean' matching with a dominance margin
mpasternak Jun 4, 2026
6ae6629
i18n: complete and correct translations for all locales
mpasternak Jun 4, 2026
b13a3bf
Release 0.22.1
mpasternak Jun 4, 2026
d4b7990
docs(spec): AutocompleteField lookup_name + idiom <fk>__rel
mpasternak Jun 4, 2026
13bcb68
build: compile .mo at build time with Babel; stop tracking .mo in git
mpasternak Jun 4, 2026
ccfa1d4
Merge pull request #10 from iplweb/feat/build-time-mo-compilation
mpasternak Jun 4, 2026
4b7dd09
feat(extras): AutocompleteField lookup_name (picker pod alt-nazwą fil…
mpasternak Jun 4, 2026
62e7e2a
docs/test(extras): English docstring for get_lookup_name + != picker …
mpasternak Jun 4, 2026
cf4a149
docs(extras): document <fk>__rel idiom (relation + picker side by side)
mpasternak Jun 4, 2026
e35a642
Merge pull request #11 from iplweb/feat/autocomplete-lookup-name
mpasternak Jun 4, 2026
1d9db41
Release 0.23.0
mpasternak Jun 4, 2026
7afb73c
docs(spec): query UX design — multiline, pretty-print, branch counts,…
mpasternak Jun 4, 2026
7625af2
chore(admin): apply pre-commit modernization (re_path->path, str.format)
mpasternak Jun 4, 2026
2c7c1e2
feat(widget): Shift+Enter inserts newline (multiline queries)
mpasternak Jun 4, 2026
4d01301
feat(formatter): pretty-print queries + shared AST serializer
mpasternak Jun 4, 2026
c8783cd
feat(breakdown): on-demand per-branch record counts (explain)
mpasternak Jun 4, 2026
2affd7d
feat(highlight): generic syntax highlighting (tokenizer + overlay)
mpasternak Jun 4, 2026
7ca3e40
feat(example): runnable example_project demonstrating all query-UX fe…
mpasternak Jun 4, 2026
b8a89f7
docs(readme): list query-UX features + how to run example_project
mpasternak Jun 4, 2026
3ed63e6
Merge pull request #12 from iplweb/feat/query-ux
mpasternak Jun 4, 2026
3c02fec
feat(highlight): error-location marking; fix caret; demo autocomplete…
mpasternak Jun 4, 2026
29a96d7
Release 0.24.0
mpasternak Jun 4, 2026
f5481f5
fix(highlight): repaint the overlay when a suggestion is accepted
mpasternak Jun 4, 2026
fe1b22a
feat(schema): carry the offending name/value on schema errors
mpasternak Jun 4, 2026
a0b747e
feat(example): object-reference __rel pickers + query-box UX
mpasternak Jun 4, 2026
8ad5373
feat(autocomplete): show object ids as muted "#id" instead of "[id]"
mpasternak Jun 4, 2026
1ec2bcb
feat(example): syntax-highlight the "explain counts" labels
mpasternak Jun 4, 2026
0adcd51
feat(autocomplete): object pickers offer only = != in 'not in'
mpasternak Jun 4, 2026
31d35c4
feat(autocomplete): value suggestions inside `in (...)` lists
mpasternak Jun 4, 2026
c777d31
fix(extras): narrow AutocompleteSchemaMixin nullable probe to FieldDo…
mpasternak Jun 4, 2026
ac7afe8
test: example_project suite + edge-case coverage to ~99%
mpasternak Jun 4, 2026
8cf13a6
Release 0.25.0
mpasternak Jun 4, 2026
f0f042a
docs: design spec for translatable autocomplete labels
mpasternak Jun 5, 2026
a797434
feat(i18n): translatable autocomplete operator labels + search placeh…
mpasternak Jun 5, 2026
ae8d4f3
Release 0.26.0
mpasternak Jun 5, 2026
c888028
docs: design spec for markdown-based i18n syntax help
mpasternak Jun 5, 2026
7da188c
feat(help): Markdown-based, i18n-aware syntax help
mpasternak Jun 5, 2026
82b3f5d
Merge pull request #13 from iplweb/feat/markdown-syntax-help
mpasternak Jun 5, 2026
19b1a96
Release 0.27.0
mpasternak Jun 5, 2026
31a2349
feat(i18n): localize "Syntax Help" completion-popup link
mpasternak Jun 5, 2026
38a3c6e
Bump version 0.27.0 -> 0.27.1
mpasternak Jun 5, 2026
c1f4747
Fix logical operator precedence
mpasternak Jun 6, 2026
5c3e520
Fix localized syntax help language handling
mpasternak Jun 6, 2026
c523b75
Test djangojs catalog compilation
mpasternak Jun 6, 2026
7e6c1fb
Bump version 0.27.1 -> 0.27.2
mpasternak Jun 6, 2026
ccc591c
Add LLM schema description helper and management command
mpasternak Jul 4, 2026
212e2ba
Bump version 0.27.2 -> 0.28.0
mpasternak Jul 4, 2026
b3c5308
Ship djangoql.management subpackages in the build
mpasternak Jul 4, 2026
ea95837
Document describe_schema_for_llm and its management command
mpasternak Jul 4, 2026
cc8a35b
Add design spec for LLM schema enrichment (metadata, choices, FK values)
mpasternak Jul 4, 2026
b128a7e
Revise LLM schema enrichment spec after independent review
mpasternak Jul 4, 2026
14f4b15
Add implementation plan for LLM schema enrichment
mpasternak Jul 4, 2026
50e3be0
test: give Book.name a verbose_name and help_text
mpasternak Jul 4, 2026
4272ac2
feat: expose field label and help_text in LLM schema
mpasternak Jul 4, 2026
be484c7
feat: always emit choice labels as a closed set for LLM schema
mpasternak Jul 4, 2026
9413a6f
feat: auto-emit related-model values in LLM schema (gated)
mpasternak Jul 4, 2026
b49b200
feat: per-relation fk_options control for LLM schema values
mpasternak Jul 4, 2026
0fc55a1
feat: add --max-fk-options to djangoql_describe_schema_for_llm
mpasternak Jul 4, 2026
218d1dc
docs: document label/help_text, choices and fk values in LLM schema
mpasternak Jul 4, 2026
6fd1a7e
docs: correct max_fk_options=0 interaction with explicit fk_options s…
mpasternak Jul 4, 2026
2e602a6
fix: honor suggested flag in FK match-field heuristic; review nits
mpasternak Jul 4, 2026
02e2b6e
Add design spec for LLM schema compression (json/compact modes)
mpasternak Jul 5, 2026
4bc0e09
Add implementation plan for LLM schema compression
mpasternak Jul 5, 2026
00ee403
refactor: normalize LLM schema JSON (operator legend + terse fields)
mpasternak Jul 5, 2026
2103a10
feat: add compact text output mode to LLM schema description
mpasternak Jul 5, 2026
f7e850c
fix: preserve nullable relations and object_reference extras in compa…
mpasternak Jul 5, 2026
ba26bc4
feat: add --format json/compact to djangoql_describe_schema_for_llm
mpasternak Jul 5, 2026
46e50f2
docs: document normalized json and compact LLM schema formats
mpasternak Jul 5, 2026
2878e47
docs: document compact object_reference marker; clarify suggested_val…
mpasternak Jul 5, 2026
029e8c3
fix: copy grammar per call, render relation labels in compact, legend…
mpasternak Jul 5, 2026
a897fc2
Merge pull request #14 from iplweb/feat/llm-schema-enrichment
mpasternak Jul 5, 2026
67d0857
Add design spec for collapsing derived fields into type-level lookups
mpasternak Jul 5, 2026
df8dda4
Refine derived-collapse spec: detect over all fields, explicit exclusion
mpasternak Jul 5, 2026
fb93a05
Add implementation plan for derived-field collapse
mpasternak Jul 5, 2026
53e3f35
feat: detect derived-lookup capabilities and exclude derived fields f…
mpasternak Jul 5, 2026
c62c010
feat: advertise derived-field lookups/aggregates once in the LLM legend
mpasternak Jul 5, 2026
2b2372f
docs: document collapsed derived-field lookups and aggregates
mpasternak Jul 5, 2026
ede62f3
docs: correct partial-gating description for derived-field capabilities
mpasternak Jul 5, 2026
5f98cf9
fix: build derived-lookup examples from detected capabilities; detect…
mpasternak Jul 5, 2026
09fc6e7
Bump version 0.28.0 -> 0.29.0
mpasternak Jul 5, 2026
f02b093
docs: spec for declarative per-model field filtering
mpasternak Jul 5, 2026
1421063
docs: implementation plan for per-model field filtering
mpasternak Jul 5, 2026
c684595
feat: declarative per-model field allowlist/denylist
mpasternak Jul 5, 2026
9e5d583
feat: validate include_fields/exclude_fields at schema init
mpasternak Jul 5, 2026
29c6d50
test: lock in relation-block and LLM-description filtering
mpasternak Jul 5, 2026
032db7d
docs: document include_fields / exclude_fields field filtering
mpasternak Jul 5, 2026
1166f1b
Merge branch 'feat/per-model-field-filtering'
mpasternak Jul 5, 2026
c0b5d69
Bump version 0.29.0 -> 0.30.0
mpasternak Jul 5, 2026
989a2e2
fix(llm): _default_match_field prefers identifier fields (nazwa/skrot…
mpasternak Jul 5, 2026
55a9136
fix(llm): log swallowed exceptions in _distinct_values/_str_examples …
mpasternak Jul 5, 2026
d5abf69
Merge pull request #15 from iplweb/fix/auto-mode-match-field
mpasternak Jul 5, 2026
2c13e61
fix(llm): auto-mode also excludes custom AUTH_USER_MODEL
mpasternak Jul 5, 2026
bd8f803
Merge pull request #16 from iplweb/fix/auto-mode-match-field
mpasternak Jul 5, 2026
491047d
Bump version 0.30.0 -> 0.30.1
mpasternak Jul 5, 2026
52df6aa
Bump version 0.30.1 -> 0.30.2
mpasternak Jul 5, 2026
34a3036
feat(llm): schema.no_value_targets — hard denylist for embedded values
mpasternak Jul 10, 2026
04e890e
docs(handoff): deduplikacja wartości słowników w schemacie LLM
mpasternak Jul 11, 2026
46e693d
feat(llm): deduplikacja wartości słowników w schemacie LLM (0.31.0)
mpasternak Jul 11, 2026
958fa26
feat(llm): per-relation integer fk_options limit (bypass 20-cap) — 0.…
mpasternak Jul 11, 2026
44d2e04
chore: dodaj link BuyMeACoffee do FUNDING.yml
mpasternak Jul 24, 2026
7364d03
chore: dodaj URL Funding do pyproject.toml
mpasternak Jul 24, 2026
4e3a9d5
fix(tests): make the postgres job actually run against postgres
mpasternak Aug 6, 2026
d3220ff
Merge pull request #18 from iplweb/fix/postgres-job-actually-uses-sqlite
mpasternak Aug 6, 2026
e48c233
feat: add Django 6.1 to the supported version matrix
mpasternak Aug 6, 2026
17db804
Merge pull request #17 from iplweb/feat/django-61
mpasternak Aug 7, 2026
3ad9ca4
release: 0.31.2
mpasternak Aug 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
buy_me_a_coffee: mpasternak
33 changes: 33 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy docs

# Builds the MkDocs site and publishes it to the `gh-pages` branch on every
# push to master. Enable GitHub Pages once (Settings -> Pages -> Build and
# deployment -> Deploy from a branch -> gh-pages / root) for it to go live at
# https://iplweb.github.io/djangoql-iplweb/
on:
push:
branches: [master]
workflow_dispatch:

permissions:
contents: write # mkdocs gh-deploy pushes the built site to gh-pages

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history so gh-deploy can update gh-pages
- name: Install uv
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --all-extras
- name: Configure git identity
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Build and deploy to GitHub Pages
run: uv run mkdocs gh-deploy --force --no-history
254 changes: 73 additions & 181 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,201 +5,93 @@ on:
pull_request:
branches: [master]
workflow_dispatch:
jobs:
notify-build-start:
# Secrets are not available for forks for security reasons, so pull
# request checks will fail when trying to send the Slack notification.
# Unfortunately, there's no way to explicitly check that a secret is
# available, so we check for event_name instead:
# https://github.com/actions/runner/issues/520
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
# Send build notifications to Slack
- uses: ivelum/github-action-slack-notify-build@v1.7.2
id: slack
with:
channel_id: C0PT3267R
status: STARTED
color: '#ee9b00'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
outputs:
status_message_id: ${{ steps.slack.outputs.message_id }}

# Minimal default token scope; tests only need to read the repo.
permissions:
contents: read

jobs:
lint:
needs: [notify-build-start]
if: |
always() &&
(needs.notify-build-start.result == 'success' || needs.notify-build-start.result == 'skipped')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: get pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: cache pip
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip|lint
- run: pip install -r requirements-dev.txt
- run: flake8
- run: isort --diff -c .

# Send notification on build failure
- name: Notify slack fail
uses: ivelum/github-action-slack-notify-build@v1.7.2
if: failure() && github.event_name == 'push'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
message_id: ${{ needs.notify-build-start.outputs.status_message_id }}
channel_id: C0PT3267R
status: FAILED
color: '#d7263d'
- name: Install uv
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1
- name: Set up Python
run: uv python install 3.14
- name: Install dependencies
run: uv sync --all-extras
# Lint is informational only (|| true): the codebase is intentionally
# not bulk-formatted; enforcement happens in pre-commit on staged files.
- name: Lint with ruff
run: uv run ruff check . || true
- name: Check formatting with ruff
run: uv run ruff format --check . || true

tests:
needs: [notify-build-start, lint]
if: |
always() &&
(needs.notify-build-start.result == 'success' || needs.notify-build-start.result == 'skipped') &&
needs.lint.result == 'success'
runs-on: ubuntu-${{ matrix.ubuntu }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# requires-python = ">=3.10"; only currently-supported Django series.
# Django 5.2 LTS: Python 3.10-3.14; Django 6.0: Python 3.12-3.14;
# Django 6.1: Python 3.12-3.14.
include:
- {django: '1.8.*', python: '2.7', ubuntu: '22.04'}

- {django: '1.9.*', python: '2.7', ubuntu: '22.04'}

- {django: '1.10.*', python: '2.7', ubuntu: '22.04'}

- {django: '1.11.*', python: '2.7', ubuntu: '22.04'}
- {django: '1.11.*', python: '3.6', ubuntu: '22.04'}
- {django: '1.11.*', python: '3.7', ubuntu: '22.04'}

- {django: '2.0.*', python: '3.6', ubuntu: '22.04'}
- {django: '2.0.*', python: '3.7', ubuntu: '22.04'}

- {django: '2.1.*', python: '3.6', ubuntu: '22.04'}
- {django: '2.1.*', python: '3.7', ubuntu: '22.04'}

- {django: '2.2.*', python: '3.6', ubuntu: '22.04'}
- {django: '2.2.*', python: '3.7', ubuntu: '22.04'}
- {django: '2.2.*', python: '3.8', ubuntu: '24.04'}
- {django: '2.2.*', python: '3.9', ubuntu: '24.04'}

- {django: '3.0.*', python: '3.6', ubuntu: '22.04'}
- {django: '3.0.*', python: '3.7', ubuntu: '22.04'}
- {django: '3.0.*', python: '3.8', ubuntu: '24.04'}
- {django: '3.0.*', python: '3.9', ubuntu: '24.04'}

- {django: '3.1.*', python: '3.6', ubuntu: '22.04'}
- {django: '3.1.*', python: '3.7', ubuntu: '22.04'}
- {django: '3.1.*', python: '3.8', ubuntu: '24.04'}
- {django: '3.1.*', python: '3.9', ubuntu: '24.04'}

- {django: '3.2.*', python: '3.6', ubuntu: '22.04'}
- {django: '3.2.*', python: '3.7', ubuntu: '22.04'}
- {django: '3.2.*', python: '3.8', ubuntu: '24.04'}
- {django: '3.2.*', python: '3.9', ubuntu: '24.04'}
- {django: '3.2.*', python: '3.10', ubuntu: '24.04'}

- {django: '4.0.*', python: '3.8', ubuntu: '24.04'}
- {django: '4.0.*', python: '3.9', ubuntu: '24.04'}
- {django: '4.0.*', python: '3.10', ubuntu: '24.04'}

- {django: '4.1.*', python: '3.8', ubuntu: '24.04'}
- {django: '4.1.*', python: '3.9', ubuntu: '24.04'}
- {django: '4.1.*', python: '3.10', ubuntu: '24.04'}
- {django: '4.1.*', python: '3.11', ubuntu: '24.04'}

- {django: '4.2.*', python: '3.8', ubuntu: '24.04'}
- {django: '4.2.*', python: '3.9', ubuntu: '24.04'}
- {django: '4.2.*', python: '3.10', ubuntu: '24.04'}
- {django: '4.2.*', python: '3.11', ubuntu: '24.04'}
- {django: '4.2.*', python: '3.12', ubuntu: '24.04'}

- {django: '5.0.*', python: '3.10', ubuntu: '24.04'}
- {django: '5.0.*', python: '3.11', ubuntu: '24.04'}
- {django: '5.0.*', python: '3.12', ubuntu: '24.04'}

- {django: '5.1.*', python: '3.10', ubuntu: '24.04'}
- {django: '5.1.*', python: '3.11', ubuntu: '24.04'}
- {django: '5.1.*', python: '3.12', ubuntu: '24.04'}
- {django: '5.1.*', python: '3.13', ubuntu: '24.04'}

- {django: '5.2.*', python: '3.10', ubuntu: '24.04'}
- {django: '5.2.*', python: '3.11', ubuntu: '24.04'}
- {django: '5.2.*', python: '3.12', ubuntu: '24.04'}
- {django: '5.2.*', python: '3.13', ubuntu: '24.04'}
- {django: '5.2.*', python: '3.14', ubuntu: '24.04'}

- {django: '6.0.*', python: '3.12', ubuntu: '24.04'}
- {django: '6.0.*', python: '3.13', ubuntu: '24.04'}
- {django: '6.0.*', python: '3.14', ubuntu: '24.04'}

- {python-version: '3.10', django-version: '5.2'}
- {python-version: '3.11', django-version: '5.2'}
- {python-version: '3.12', django-version: '5.2'}
- {python-version: '3.13', django-version: '5.2'}
- {python-version: '3.14', django-version: '5.2'}
- {python-version: '3.12', django-version: '6.0'}
- {python-version: '3.13', django-version: '6.0'}
- {python-version: '3.14', django-version: '6.0'}
- {python-version: '3.12', django-version: '6.1'}
- {python-version: '3.13', django-version: '6.1'}
- {python-version: '3.14', django-version: '6.1'}
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.7+
if: ${{ matrix.python != '2.7' && matrix.python != '3.6' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Setup Python 2.7/3.6
if: ${{ matrix.python == '2.7' || matrix.python == '3.6' }}
uses: MatteoH2O1999/setup-python@v2
with:
python-version: ${{ matrix.python }}
allow-build: info
cache-build: true
- name: update pip
- name: Install uv
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies (project + Django ${{ matrix.django-version }})
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- name: get pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: cache pip
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip|${{ matrix.python }}|${{ matrix.django }}
- run: pip install PLY
- run: pip install Django==${{ matrix.django }}
- run: pip install -e .
- run: python test_project/manage.py test core.tests

# Send notification on build failure
- name: Notify slack fail
uses: ivelum/github-action-slack-notify-build@v1.7.2
if: failure() && github.event_name == 'push'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
message_id: ${{ needs.notify-build-start.outputs.status_message_id }}
channel_id: C0PT3267R
status: FAILED
color: '#d7263d'

notify-build-success:
if: ${{ github.event_name == 'push' }}
needs: [notify-build-start, tests]
uv sync --all-extras
uv pip install "django~=${{ matrix.django-version }}.0"
- name: Compile translation catalogs (Babel)
# .mo files are not tracked in git; compile them with the same Babel
# function the build backend uses (no system gettext needed).
run: uv run --no-sync python -c "from _translations import compile_catalogs; compile_catalogs()"
- name: Run tests
# --no-sync so the matrix-pinned Django above is not reverted by uv.
run: uv run --no-sync pytest
- name: Run example_project tests
# The example_project is a separate Django project (its own settings and
# models), so it isn't collected by the main pytest run; exercise its
# suite via manage.py so the showcase schema/views don't rot.
working-directory: example_project
run: uv run --no-sync python manage.py test library -v2

tests-postgres:
runs-on: ubuntu-latest
steps:
# Send notification on build success
- name: Notify slack success
uses: ivelum/github-action-slack-notify-build@v1.7.2
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install dependencies (project + Django 5.2)
run: |
uv sync --all-extras
uv pip install "django~=5.2.0"
- name: Compile translation catalogs (Babel)
# .mo files are not tracked in git; compile them with the same Babel
# function the build backend uses (no system gettext needed).
run: uv run --no-sync python -c "from _translations import compile_catalogs; compile_catalogs()"
- name: Run tests (PostgreSQL via testcontainers)
# --no-sync so the pinned Django above is not reverted by uv.
# Testcontainers manages the postgres:16-alpine container itself;
# no services: block needed — the runner's Docker daemon is used.
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
message_id: ${{ needs.notify-build-start.outputs.status_message_id }}
channel_id: C0PT3267R
status: SUCCESS
color: '#16db65'
DJANGOQL_TEST_DB: postgres
run: uv run --no-sync pytest
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,34 @@

node_modules
test_project/db.sqlite3
example_project/db.sqlite3

build
dist
djangoql.egg-info
site/

# Compiled gettext catalogs: generated from .po at build time (Babel), not
# tracked. See _translations.py / _build_meta.py.
*.mo

.venv/
uv.lock

.pytest_cache/
.ruff_cache/
.coverage
htmlcov/
*.egg-info/

# Secrets / credentials (never commit)
.env
.env.*
!.env.example
!.env.sample
*.pem
*.key
*.p12
*.pfx
credentials.json
service-account*.json
41 changes: 41 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Pre-commit runs on STAGED files only — changed files get linted before
# they land, the rest of the repo is untouched.
#
# Install: uv sync --all-extras && pre-commit install
# Manual: pre-commit run # staged files only
# pre-commit run --all-files # everything (escape hatch)
#
# Ruff replaces the previous flake8 + isort stack. The enforced rules are
# mirrored in pyproject.toml [tool.ruff] (E/F/W + flake8-quotes Q +
# flake8-print T20 + flake8-builtins A + isort I), so lint coverage is
# preserved. pyupgrade / django-upgrade modernize syntax, but only on the
# files you actually stage — never run them across the whole repo.

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: detect-private-key

- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py310-plus] # floor from requires-python = ">=3.10"

- repo: https://github.com/adamchainz/django-upgrade
rev: 1.30.0
hooks:
- id: django-upgrade
args: [--target-version, "4.2"] # floor from the supported Django range

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.15
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
Loading
Loading