drf-query-method 0.1.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.
- drf_query_method-0.1.0/.editorconfig +37 -0
- drf_query_method-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +61 -0
- drf_query_method-0.1.0/.github/ISSUE_TEMPLATE/config.yml +1 -0
- drf_query_method-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +30 -0
- drf_query_method-0.1.0/.github/dependabot.yml +17 -0
- drf_query_method-0.1.0/.github/pull_request_template.md +17 -0
- drf_query_method-0.1.0/.github/workflows/ci.yml +149 -0
- drf_query_method-0.1.0/.github/workflows/codeql.yml +35 -0
- drf_query_method-0.1.0/.github/workflows/docs.yml +51 -0
- drf_query_method-0.1.0/.github/workflows/publish.yml +64 -0
- drf_query_method-0.1.0/.github/workflows/zizmor.yml +37 -0
- drf_query_method-0.1.0/.gitignore +54 -0
- drf_query_method-0.1.0/CHANGELOG/0.1.0.md +28 -0
- drf_query_method-0.1.0/CHANGELOG/unreleased.md +3 -0
- drf_query_method-0.1.0/CODE_OF_CONDUCT.md +89 -0
- drf_query_method-0.1.0/CONTRIBUTING.md +160 -0
- drf_query_method-0.1.0/LICENSE +61 -0
- drf_query_method-0.1.0/PKG-INFO +98 -0
- drf_query_method-0.1.0/README.md +60 -0
- drf_query_method-0.1.0/SECURITY.md +32 -0
- drf_query_method-0.1.0/docs/api.md +5 -0
- drf_query_method-0.1.0/docs/index.md +16 -0
- drf_query_method-0.1.0/docs/installation.md +38 -0
- drf_query_method-0.1.0/docs/usage.md +151 -0
- drf_query_method-0.1.0/justfile +117 -0
- drf_query_method-0.1.0/pyproject.toml +133 -0
- drf_query_method-0.1.0/scripts/release.py +250 -0
- drf_query_method-0.1.0/src/drf_query_method/__init__.py +20 -0
- drf_query_method-0.1.0/src/drf_query_method/django_filters.py +36 -0
- drf_query_method-0.1.0/src/drf_query_method/filters.py +38 -0
- drf_query_method-0.1.0/src/drf_query_method/methods.py +16 -0
- drf_query_method-0.1.0/src/drf_query_method/params.py +48 -0
- drf_query_method-0.1.0/src/drf_query_method/patching.py +107 -0
- drf_query_method-0.1.0/src/drf_query_method/permissions.py +45 -0
- drf_query_method-0.1.0/src/drf_query_method/py.typed +1 -0
- drf_query_method-0.1.0/src/drf_query_method/routers.py +61 -0
- drf_query_method-0.1.0/src/drf_query_method/test.py +41 -0
- drf_query_method-0.1.0/src/drf_query_method/viewsets.py +36 -0
- drf_query_method-0.1.0/tests/__init__.py +0 -0
- drf_query_method-0.1.0/tests/conftest.py +14 -0
- drf_query_method-0.1.0/tests/settings.py +21 -0
- drf_query_method-0.1.0/tests/test_django_filters.py +77 -0
- drf_query_method-0.1.0/tests/test_drf_query_method.py +11 -0
- drf_query_method-0.1.0/tests/test_filters.py +43 -0
- drf_query_method-0.1.0/tests/test_methods.py +21 -0
- drf_query_method-0.1.0/tests/test_params.py +37 -0
- drf_query_method-0.1.0/tests/test_patching.py +112 -0
- drf_query_method-0.1.0/tests/test_permissions.py +109 -0
- drf_query_method-0.1.0/tests/test_routers.py +63 -0
- drf_query_method-0.1.0/tests/test_test.py +31 -0
- drf_query_method-0.1.0/tests/urls.py +8 -0
- drf_query_method-0.1.0/tests/views.py +74 -0
- drf_query_method-0.1.0/uv.lock +1331 -0
- drf_query_method-0.1.0/zensical.toml +27 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# https://editorconfig.org
|
|
2
|
+
root = true
|
|
3
|
+
|
|
4
|
+
[*]
|
|
5
|
+
charset = utf-8
|
|
6
|
+
end_of_line = lf
|
|
7
|
+
indent_style = space
|
|
8
|
+
indent_size = 4
|
|
9
|
+
trim_trailing_whitespace = true
|
|
10
|
+
insert_final_newline = true
|
|
11
|
+
|
|
12
|
+
[*.{html,css,js,json,sh,yml,yaml}]
|
|
13
|
+
indent_size = 2
|
|
14
|
+
|
|
15
|
+
[*.bat]
|
|
16
|
+
indent_style = tab
|
|
17
|
+
end_of_line = crlf
|
|
18
|
+
|
|
19
|
+
[LICENSE]
|
|
20
|
+
insert_final_newline = false
|
|
21
|
+
|
|
22
|
+
[justfile]
|
|
23
|
+
indent_style = space
|
|
24
|
+
indent_size = 4
|
|
25
|
+
|
|
26
|
+
# Ignore binary or generated files
|
|
27
|
+
[*.{png,jpg,gif,ico,woff,woff2,ttf,eot,svg,pdf}]
|
|
28
|
+
charset = unset
|
|
29
|
+
end_of_line = unset
|
|
30
|
+
indent_style = unset
|
|
31
|
+
indent_size = unset
|
|
32
|
+
trim_trailing_whitespace = unset
|
|
33
|
+
insert_final_newline = unset
|
|
34
|
+
max_line_length = unset
|
|
35
|
+
|
|
36
|
+
[*.{diff,patch}]
|
|
37
|
+
trim_trailing_whitespace = false
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Something isn't working as expected.
|
|
3
|
+
title: "BUG: "
|
|
4
|
+
labels: [bug]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
id: description
|
|
8
|
+
attributes:
|
|
9
|
+
label: Describe the bug
|
|
10
|
+
description: What happened? What did you expect to happen?
|
|
11
|
+
validations:
|
|
12
|
+
required: true
|
|
13
|
+
- type: textarea
|
|
14
|
+
id: steps
|
|
15
|
+
attributes:
|
|
16
|
+
label: Steps to reproduce
|
|
17
|
+
description: Minimal steps to trigger the bug.
|
|
18
|
+
placeholder: |
|
|
19
|
+
1. Install with `uv pip install drf-query-method`
|
|
20
|
+
2. Run `...`
|
|
21
|
+
3. See error
|
|
22
|
+
validations:
|
|
23
|
+
required: true
|
|
24
|
+
- type: textarea
|
|
25
|
+
id: expected
|
|
26
|
+
attributes:
|
|
27
|
+
label: Expected behavior
|
|
28
|
+
validations:
|
|
29
|
+
required: true
|
|
30
|
+
- type: input
|
|
31
|
+
id: version
|
|
32
|
+
attributes:
|
|
33
|
+
label: "drf-query-method version"
|
|
34
|
+
placeholder: "0.1.0"
|
|
35
|
+
validations:
|
|
36
|
+
required: true
|
|
37
|
+
- type: input
|
|
38
|
+
id: python-version
|
|
39
|
+
attributes:
|
|
40
|
+
label: Python version
|
|
41
|
+
placeholder: "3.13"
|
|
42
|
+
validations:
|
|
43
|
+
required: true
|
|
44
|
+
- type: dropdown
|
|
45
|
+
id: os
|
|
46
|
+
attributes:
|
|
47
|
+
label: Operating system
|
|
48
|
+
options:
|
|
49
|
+
- macOS
|
|
50
|
+
- Linux
|
|
51
|
+
- Windows
|
|
52
|
+
- Other
|
|
53
|
+
validations:
|
|
54
|
+
required: true
|
|
55
|
+
- type: textarea
|
|
56
|
+
id: context
|
|
57
|
+
attributes:
|
|
58
|
+
label: Additional context
|
|
59
|
+
description: Logs, tracebacks, screenshots, or anything else that helps.
|
|
60
|
+
validations:
|
|
61
|
+
required: false
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
blank_issues_enabled: true
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: Suggest something new.
|
|
3
|
+
title: "FEAT: "
|
|
4
|
+
labels: [enhancement]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
id: description
|
|
8
|
+
attributes:
|
|
9
|
+
label: Describe the feature
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: motivation
|
|
14
|
+
attributes:
|
|
15
|
+
label: Motivation
|
|
16
|
+
description: What problem does this solve? What's the use case?
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: alternatives
|
|
21
|
+
attributes:
|
|
22
|
+
label: Alternatives considered
|
|
23
|
+
validations:
|
|
24
|
+
required: false
|
|
25
|
+
- type: textarea
|
|
26
|
+
id: context
|
|
27
|
+
attributes:
|
|
28
|
+
label: Additional context
|
|
29
|
+
validations:
|
|
30
|
+
required: false
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: github-actions
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
cooldown:
|
|
8
|
+
default-days: 7
|
|
9
|
+
open-pull-requests-limit: 5
|
|
10
|
+
|
|
11
|
+
- package-ecosystem: uv
|
|
12
|
+
directory: /
|
|
13
|
+
schedule:
|
|
14
|
+
interval: weekly
|
|
15
|
+
cooldown:
|
|
16
|
+
default-days: 7
|
|
17
|
+
open-pull-requests-limit: 5
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
## What
|
|
2
|
+
|
|
3
|
+
<!-- 1-3 sentences. Link the issue if there is one. -->
|
|
4
|
+
|
|
5
|
+
## AI Provenance
|
|
6
|
+
|
|
7
|
+
<!-- Remove this section for human-authored PRs. -->
|
|
8
|
+
|
|
9
|
+
- **Tool:** <!-- Claude Code, Cursor, Copilot, Codex, etc. -->
|
|
10
|
+
- **Model:** <!-- Claude Opus 4.6, GPT-4o, etc. -->
|
|
11
|
+
- **Prompt/thread:** <!-- Paste your prompt or a link to the thread. -->
|
|
12
|
+
|
|
13
|
+
## Checklist
|
|
14
|
+
|
|
15
|
+
- [ ] Addresses exactly one issue or feature
|
|
16
|
+
- [ ] New or changed behavior has test coverage
|
|
17
|
+
- [ ] Diff contains only changes for this task
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
pull_request:
|
|
9
|
+
types:
|
|
10
|
+
- opened
|
|
11
|
+
- synchronize
|
|
12
|
+
- reopened
|
|
13
|
+
- ready_for_review
|
|
14
|
+
|
|
15
|
+
permissions: {}
|
|
16
|
+
|
|
17
|
+
concurrency:
|
|
18
|
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
19
|
+
cancel-in-progress: true
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
lint:
|
|
23
|
+
name: Lint
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
permissions:
|
|
26
|
+
contents: read
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
29
|
+
with:
|
|
30
|
+
persist-credentials: false
|
|
31
|
+
|
|
32
|
+
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
|
33
|
+
|
|
34
|
+
- name: Ruff format check
|
|
35
|
+
run: uv run ruff format --check .
|
|
36
|
+
|
|
37
|
+
- name: Ruff lint
|
|
38
|
+
run: uv run ruff check .
|
|
39
|
+
|
|
40
|
+
type-check:
|
|
41
|
+
name: Type check
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
permissions:
|
|
44
|
+
contents: read
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
47
|
+
with:
|
|
48
|
+
persist-credentials: false
|
|
49
|
+
|
|
50
|
+
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
|
51
|
+
|
|
52
|
+
- name: Type check with ty
|
|
53
|
+
run: uv run ty check .
|
|
54
|
+
|
|
55
|
+
test:
|
|
56
|
+
name: Test (Python ${{ matrix.python }}, Django ${{ matrix.django }}, DRF ${{ matrix.drf }})
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
permissions:
|
|
59
|
+
contents: read
|
|
60
|
+
continue-on-error: ${{ matrix.experimental || false }}
|
|
61
|
+
strategy:
|
|
62
|
+
fail-fast: false
|
|
63
|
+
matrix:
|
|
64
|
+
include:
|
|
65
|
+
- { python: "3.10", django: "4.2", drf: "3.16" }
|
|
66
|
+
- { python: "3.11", django: "5.0", drf: "3.16" }
|
|
67
|
+
- { python: "3.12", django: "5.1", drf: "3.16" }
|
|
68
|
+
- { python: "3.12", django: "4.2", drf: "3.17" }
|
|
69
|
+
- { python: "3.13", django: "5.2", drf: "3.17" }
|
|
70
|
+
- { python: "3.13", django: "6.0", drf: "3.17" }
|
|
71
|
+
- { python: "3.12", django: "5.2", drf: "3.18" }
|
|
72
|
+
- { python: "3.14", django: "6.0", drf: "3.18" }
|
|
73
|
+
- { python: "3.14", django: "6.1", drf: "3.18" }
|
|
74
|
+
- { python: "3.14", django: "main", drf: "main", experimental: true }
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
77
|
+
with:
|
|
78
|
+
persist-credentials: false
|
|
79
|
+
|
|
80
|
+
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
|
81
|
+
|
|
82
|
+
- name: Install Django ${{ matrix.django }} and DRF ${{ matrix.drf }}
|
|
83
|
+
env:
|
|
84
|
+
PYTHON: ${{ matrix.python }}
|
|
85
|
+
DJANGO: ${{ matrix.django }}
|
|
86
|
+
DRF: ${{ matrix.drf }}
|
|
87
|
+
run: |
|
|
88
|
+
if [ "$DJANGO" = "main" ]; then
|
|
89
|
+
django_req="django @ https://github.com/django/django/archive/main.tar.gz"
|
|
90
|
+
else
|
|
91
|
+
django_req="django~=$DJANGO.0"
|
|
92
|
+
fi
|
|
93
|
+
if [ "$DRF" = "main" ]; then
|
|
94
|
+
drf_req="djangorestframework @ https://github.com/encode/django-rest-framework/archive/main.tar.gz"
|
|
95
|
+
else
|
|
96
|
+
drf_req="djangorestframework~=$DRF.0"
|
|
97
|
+
fi
|
|
98
|
+
uv venv --python "$PYTHON"
|
|
99
|
+
uv pip install -e . "$django_req" "$drf_req" django-filter coverage pytest pytest-django
|
|
100
|
+
|
|
101
|
+
- name: Run tests with coverage
|
|
102
|
+
run: .venv/bin/coverage run -m pytest
|
|
103
|
+
|
|
104
|
+
- name: Upload coverage data
|
|
105
|
+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
106
|
+
with:
|
|
107
|
+
name: coverage-${{ matrix.python }}-${{ matrix.django }}-${{ matrix.drf }}
|
|
108
|
+
path: .coverage.*
|
|
109
|
+
include-hidden-files: true
|
|
110
|
+
|
|
111
|
+
coverage:
|
|
112
|
+
name: Coverage
|
|
113
|
+
needs: test
|
|
114
|
+
runs-on: ubuntu-latest
|
|
115
|
+
permissions:
|
|
116
|
+
contents: read
|
|
117
|
+
steps:
|
|
118
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
119
|
+
with:
|
|
120
|
+
persist-credentials: false
|
|
121
|
+
|
|
122
|
+
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
|
123
|
+
|
|
124
|
+
- name: Download coverage data
|
|
125
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
126
|
+
with:
|
|
127
|
+
pattern: coverage-*
|
|
128
|
+
merge-multiple: true
|
|
129
|
+
|
|
130
|
+
- name: Combine coverage
|
|
131
|
+
run: uv run coverage combine
|
|
132
|
+
|
|
133
|
+
- name: Coverage report
|
|
134
|
+
run: |
|
|
135
|
+
echo '## Coverage Report' >> $GITHUB_STEP_SUMMARY
|
|
136
|
+
echo '```' >> $GITHUB_STEP_SUMMARY
|
|
137
|
+
uv run coverage report | tee -a $GITHUB_STEP_SUMMARY
|
|
138
|
+
echo '```' >> $GITHUB_STEP_SUMMARY
|
|
139
|
+
|
|
140
|
+
all-checks-pass:
|
|
141
|
+
name: All checks pass
|
|
142
|
+
if: always()
|
|
143
|
+
needs: [lint, type-check, test, coverage]
|
|
144
|
+
runs-on: ubuntu-latest
|
|
145
|
+
steps:
|
|
146
|
+
- name: Check job results
|
|
147
|
+
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
|
|
148
|
+
with:
|
|
149
|
+
jobs: ${{ toJSON(needs) }}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: CodeQL
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: '0 6 * * 1'
|
|
10
|
+
|
|
11
|
+
permissions: {}
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
analyze:
|
|
15
|
+
name: Analyze
|
|
16
|
+
if: ${{ github.event.repository.private == false || vars.CODE_SECURITY_ENABLED == 'true' }}
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
permissions:
|
|
19
|
+
actions: read
|
|
20
|
+
contents: read
|
|
21
|
+
security-events: write
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
24
|
+
with:
|
|
25
|
+
persist-credentials: false
|
|
26
|
+
|
|
27
|
+
- name: Initialize CodeQL
|
|
28
|
+
uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
|
|
29
|
+
with:
|
|
30
|
+
languages: python # Add c-cpp, go, java-kotlin, or swift if needed
|
|
31
|
+
build-mode: none # Switch to autobuild for compiled languages
|
|
32
|
+
queries: security-extended
|
|
33
|
+
|
|
34
|
+
- name: Perform CodeQL Analysis
|
|
35
|
+
uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
permissions: {}
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: docs-deploy
|
|
13
|
+
# Let in-flight deployments finish to avoid a half-deployed site.
|
|
14
|
+
cancel-in-progress: false
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
build:
|
|
18
|
+
name: Build
|
|
19
|
+
if: ${{ vars.DOCS_DEPLOYMENT_ENABLED == 'true' }}
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
permissions:
|
|
22
|
+
contents: read
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
25
|
+
with:
|
|
26
|
+
persist-credentials: false
|
|
27
|
+
|
|
28
|
+
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
|
29
|
+
|
|
30
|
+
- name: Build docs
|
|
31
|
+
run: uv run --group docs zensical build --clean
|
|
32
|
+
|
|
33
|
+
- uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
|
|
34
|
+
|
|
35
|
+
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
|
|
36
|
+
with:
|
|
37
|
+
path: site
|
|
38
|
+
|
|
39
|
+
deploy:
|
|
40
|
+
name: Deploy
|
|
41
|
+
needs: build
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
permissions:
|
|
44
|
+
pages: write
|
|
45
|
+
id-token: write
|
|
46
|
+
environment:
|
|
47
|
+
name: github-pages
|
|
48
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
|
|
51
|
+
id: deployment
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
permissions: {}
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: publish
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build:
|
|
15
|
+
name: Build distribution
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
21
|
+
with:
|
|
22
|
+
persist-credentials: false
|
|
23
|
+
|
|
24
|
+
# Cache disabled to prevent cache-poisoning attacks on release artifacts.
|
|
25
|
+
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
|
26
|
+
with:
|
|
27
|
+
enable-cache: false
|
|
28
|
+
|
|
29
|
+
- name: Build
|
|
30
|
+
run: uv build
|
|
31
|
+
|
|
32
|
+
- name: Upload distribution
|
|
33
|
+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
34
|
+
with:
|
|
35
|
+
name: dist
|
|
36
|
+
path: dist/
|
|
37
|
+
|
|
38
|
+
publish:
|
|
39
|
+
name: Publish to PyPI
|
|
40
|
+
needs: build
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
permissions:
|
|
43
|
+
id-token: write
|
|
44
|
+
attestations: write
|
|
45
|
+
# Requires environment protection rules in GitHub Settings:
|
|
46
|
+
# Settings > Environments > pypi > Add required reviewers
|
|
47
|
+
# and restrict deployment to v* tags.
|
|
48
|
+
environment:
|
|
49
|
+
name: pypi
|
|
50
|
+
url: https://pypi.org/p/drf-query-method
|
|
51
|
+
steps:
|
|
52
|
+
- name: Download distribution
|
|
53
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
54
|
+
with:
|
|
55
|
+
name: dist
|
|
56
|
+
path: dist/
|
|
57
|
+
|
|
58
|
+
- name: Attest build provenance
|
|
59
|
+
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
|
|
60
|
+
with:
|
|
61
|
+
subject-path: "dist/*"
|
|
62
|
+
|
|
63
|
+
- name: Publish to PyPI
|
|
64
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Workflow security analysis
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths:
|
|
8
|
+
- ".github/workflows/**"
|
|
9
|
+
pull_request:
|
|
10
|
+
types:
|
|
11
|
+
- opened
|
|
12
|
+
- synchronize
|
|
13
|
+
- reopened
|
|
14
|
+
- ready_for_review
|
|
15
|
+
paths:
|
|
16
|
+
- ".github/workflows/**"
|
|
17
|
+
|
|
18
|
+
permissions: {}
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
zizmor:
|
|
22
|
+
name: Run zizmor
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
permissions:
|
|
25
|
+
actions: read
|
|
26
|
+
contents: read
|
|
27
|
+
security-events: write
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
30
|
+
with:
|
|
31
|
+
persist-credentials: false
|
|
32
|
+
|
|
33
|
+
- name: Run zizmor
|
|
34
|
+
uses: zizmorcore/zizmor-action@6fc4b006235f201fdab3722e17240ab420d580e5 # v0.6.1
|
|
35
|
+
with:
|
|
36
|
+
advanced-security: ${{ github.event.repository.private == false || vars.CODE_SECURITY_ENABLED == 'true' }}
|
|
37
|
+
inputs: ./.github/
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
build/
|
|
11
|
+
dist/
|
|
12
|
+
eggs/
|
|
13
|
+
.eggs/
|
|
14
|
+
*.egg-info/
|
|
15
|
+
*.egg
|
|
16
|
+
MANIFEST
|
|
17
|
+
|
|
18
|
+
# Unit test / coverage reports
|
|
19
|
+
htmlcov/
|
|
20
|
+
.tox/
|
|
21
|
+
.nox/
|
|
22
|
+
.coverage
|
|
23
|
+
.coverage.*
|
|
24
|
+
coverage.xml
|
|
25
|
+
.hypothesis/
|
|
26
|
+
.pytest_cache/
|
|
27
|
+
|
|
28
|
+
# Environments
|
|
29
|
+
.env
|
|
30
|
+
.envrc
|
|
31
|
+
.venv
|
|
32
|
+
|
|
33
|
+
# uv
|
|
34
|
+
# Generally recommended to include uv.lock in version control for
|
|
35
|
+
# reproducibility. Uncomment for libraries where you want consumers
|
|
36
|
+
# to resolve their own dependencies.
|
|
37
|
+
# uv.lock
|
|
38
|
+
|
|
39
|
+
# Ruff
|
|
40
|
+
.ruff_cache/
|
|
41
|
+
|
|
42
|
+
# Type checkers
|
|
43
|
+
.mypy_cache/
|
|
44
|
+
.dmypy.json
|
|
45
|
+
dmypy.json
|
|
46
|
+
.pyre/
|
|
47
|
+
.pytype/
|
|
48
|
+
|
|
49
|
+
# Documentation build output
|
|
50
|
+
site/
|
|
51
|
+
|
|
52
|
+
# IDE files
|
|
53
|
+
# .idea/
|
|
54
|
+
# .vscode/
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# drf-query-method 0.1.0
|
|
2
|
+
|
|
3
|
+
These are the changes that will go out in the next release.
|
|
4
|
+
|
|
5
|
+
## Added
|
|
6
|
+
|
|
7
|
+
- `patch()`, which adds `QUERY` support to DRF in place, and to django-filter's `DjangoFilterBackend` when installed.
|
|
8
|
+
- Opt-in routers, viewsets, filters, permissions, test clients and a django-filter backend, named after DRF's.
|
|
9
|
+
- `filter_params()`, the URL query parameters with a `QUERY` request's body merged over them.
|
|
10
|
+
- `add_query_method()`, which lets Django versions before 6.2 dispatch `QUERY`.
|
|
11
|
+
- Documentation for both approaches, and for sending `QUERY` requests from clients.
|
|
12
|
+
|
|
13
|
+
drf-query-method started out as a project generated from [Cookiecutter PyPackage](https://github.com/audreyfeldroy/cookiecutter-pypackage) containing:
|
|
14
|
+
|
|
15
|
+
- Initial scaffold for drf-query-method.
|
|
16
|
+
- `src/drf_query_method/` package with a py.typed marker
|
|
17
|
+
- Tests with pytest and pytest-django
|
|
18
|
+
- CI via GitHub Actions: lint (Ruff), type check (ty), a Python/Django/DRF test matrix, coverage reporting
|
|
19
|
+
- Security scanning: CodeQL analysis for public repositories, Dependabot, and a Zizmor workflow audit
|
|
20
|
+
- Docs site with Zensical + mkdocstrings and a GitHub Pages deployment workflow
|
|
21
|
+
- Trusted publishing to PyPI with OIDC and build provenance attestation
|
|
22
|
+
- `justfile` with dev commands: qa, test, type-check, docs-serve, release
|
|
23
|
+
- Issue templates, PR template, contributing guide, code of conduct, security policy
|
|
24
|
+
- BSD 3-Clause license, .editorconfig, .gitignore
|
|
25
|
+
|
|
26
|
+
### Contributors
|
|
27
|
+
|
|
28
|
+
[@BenA-SA](https://github.com/BenA-SA) (Ben Atkinson) created drf-query-method.
|