bazis-test-utils 2.2.2__tar.gz → 2.3.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.
- bazis_test_utils-2.3.0/.github/workflows/build-publish.yml +20 -0
- bazis_test_utils-2.3.0/.github/workflows/release.yml +74 -0
- bazis_test_utils-2.3.0/.github/workflows/tests.yml +68 -0
- bazis_test_utils-2.3.0/CLAUDE.md +38 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/PKG-INFO +11 -12
- bazis_test_utils-2.3.0/THIRD_PARTY_LICENSES.md +44 -0
- bazis_test_utils-2.3.0/bazis_test_utils/_version.py +24 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils/utils.py +26 -26
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils.egg-info/PKG-INFO +11 -12
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils.egg-info/SOURCES.txt +7 -1
- bazis_test_utils-2.3.0/bazis_test_utils.egg-info/requires.txt +13 -0
- bazis_test_utils-2.3.0/bazis_test_utils.egg-info/scm_file_list.json +25 -0
- bazis_test_utils-2.3.0/bazis_test_utils.egg-info/scm_version.json +8 -0
- bazis_test_utils-2.3.0/docs/releases/2.3.0.md +13 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/pyproject.toml +12 -11
- bazis_test_utils-2.2.2/.github/workflows/build-publish.yml +0 -16
- bazis_test_utils-2.2.2/THIRD_PARTY_LICENSES.md +0 -46
- bazis_test_utils-2.2.2/bazis_test_utils/_version.py +0 -34
- bazis_test_utils-2.2.2/bazis_test_utils.egg-info/requires.txt +0 -14
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/.github/workflows/update-licenses.yml +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/.gitignore +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/LICENSE +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/NOTICE +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/README.md +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils/__init__.py +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils/factories_abstract.py +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils/locale/en/LC_MESSAGES/django.mo +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils/locale/en/LC_MESSAGES/django.po +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils/locale/messages.pot +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils/locale/ru/LC_MESSAGES/django.mo +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils/locale/ru/LC_MESSAGES/django.po +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils/models_abstract.py +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils.egg-info/dependency_links.txt +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils.egg-info/top_level.txt +0 -0
- {bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/setup.cfg +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Build and Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*.*.*'
|
|
7
|
+
# started by the Release workflow on the tag it creates: a tag pushed with the
|
|
8
|
+
# workflow token does not trigger the push event above
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build:
|
|
16
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
17
|
+
uses: ecofuture-tech/.github/.github/workflows/reusable-build-publish.yml@main
|
|
18
|
+
secrets:
|
|
19
|
+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
|
20
|
+
TEST_PYPI_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# Creates the release tag vX.Y.Z on the current main commit and starts Build and Publish
|
|
4
|
+
# for it. Run it from the Actions tab (or through the GitHub API) on the main branch.
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
version:
|
|
10
|
+
description: 'Version without the "v" prefix, e.g. 2.3.0 or 2.4.0-rc1'
|
|
11
|
+
required: true
|
|
12
|
+
type: string
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
actions: write
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: release
|
|
20
|
+
cancel-in-progress: false
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
release:
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
timeout-minutes: 10
|
|
26
|
+
if: github.ref == 'refs/heads/main'
|
|
27
|
+
env:
|
|
28
|
+
GH_TOKEN: ${{ github.token }}
|
|
29
|
+
VERSION: ${{ inputs.version }}
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
with:
|
|
33
|
+
fetch-depth: 0
|
|
34
|
+
|
|
35
|
+
- name: Validate the version
|
|
36
|
+
run: |
|
|
37
|
+
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta|rc)[0-9]+)?$ ]]; then
|
|
38
|
+
echo "::error::Invalid version '$VERSION', expected e.g. 2.3.0 or 2.4.0-rc1"
|
|
39
|
+
exit 1
|
|
40
|
+
fi
|
|
41
|
+
if git rev-parse -q --verify "refs/tags/v$VERSION" >/dev/null; then
|
|
42
|
+
echo "::error::Tag v$VERSION already exists"
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
45
|
+
LAST_TAG=$(git tag --list 'v*' --sort=-v:refname | head -n 1)
|
|
46
|
+
echo "Last release: ${LAST_TAG:-none}, new release: v$VERSION"
|
|
47
|
+
if [ -n "$LAST_TAG" ] && [ "$(printf '%s\n%s\n' "${LAST_TAG#v}" "$VERSION" | sort -V | tail -n 1)" != "$VERSION" ]; then
|
|
48
|
+
echo "::error::Version $VERSION is not newer than $LAST_TAG"
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
- name: Require green tests on this commit
|
|
53
|
+
run: |
|
|
54
|
+
CONCLUSION=$(gh run list --workflow tests.yml --commit "$GITHUB_SHA" --status completed \
|
|
55
|
+
--json conclusion --jq 'map(.conclusion) | first // "none"')
|
|
56
|
+
echo "Tests on $GITHUB_SHA: $CONCLUSION"
|
|
57
|
+
if [ "$CONCLUSION" != "success" ]; then
|
|
58
|
+
echo "::error::The Tests workflow has not succeeded on $GITHUB_SHA ($CONCLUSION)"
|
|
59
|
+
exit 1
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
- name: Create the tag
|
|
63
|
+
run: |
|
|
64
|
+
git config user.name 'github-actions[bot]'
|
|
65
|
+
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
|
|
66
|
+
git tag -a "v$VERSION" -m "${{ github.event.repository.name }} $VERSION" "$GITHUB_SHA"
|
|
67
|
+
git push origin "v$VERSION"
|
|
68
|
+
|
|
69
|
+
- name: Start Build and Publish
|
|
70
|
+
run: gh workflow run build-publish.yml --ref "v$VERSION"
|
|
71
|
+
|
|
72
|
+
- name: Summary
|
|
73
|
+
run: |
|
|
74
|
+
echo "Tagged \`v$VERSION\` at \`$GITHUB_SHA\` and started Build and Publish." >> "$GITHUB_STEP_SUMMARY"
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: tests-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
lint:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
timeout-minutes: 10
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- uses: astral-sh/setup-uv@v6
|
|
23
|
+
- run: uvx ruff check bazis_test_utils
|
|
24
|
+
|
|
25
|
+
build:
|
|
26
|
+
name: build (python ${{ matrix.python }}, ${{ matrix.resolution }})
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
timeout-minutes: 15
|
|
29
|
+
strategy:
|
|
30
|
+
fail-fast: false
|
|
31
|
+
matrix:
|
|
32
|
+
python: ['3.12', '3.13', '3.14']
|
|
33
|
+
resolution: [highest]
|
|
34
|
+
include:
|
|
35
|
+
# the lowest versions allowed by pyproject.toml
|
|
36
|
+
- python: '3.12'
|
|
37
|
+
resolution: lowest-direct
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v4
|
|
40
|
+
with:
|
|
41
|
+
fetch-depth: 0
|
|
42
|
+
- uses: astral-sh/setup-uv@v6
|
|
43
|
+
with:
|
|
44
|
+
python-version: ${{ matrix.python }}
|
|
45
|
+
activate-environment: true
|
|
46
|
+
- name: Install the package
|
|
47
|
+
run: uv pip install --resolution ${{ matrix.resolution }} .
|
|
48
|
+
- name: Import the modules
|
|
49
|
+
# the models and factories need configured Django settings
|
|
50
|
+
run: |
|
|
51
|
+
python - <<'PY'
|
|
52
|
+
import django
|
|
53
|
+
from django.conf import settings
|
|
54
|
+
|
|
55
|
+
settings.configure(INSTALLED_APPS=[])
|
|
56
|
+
django.setup()
|
|
57
|
+
|
|
58
|
+
import bazis_test_utils.factories_abstract
|
|
59
|
+
import bazis_test_utils.models_abstract
|
|
60
|
+
from bazis_test_utils.utils import get_api_client
|
|
61
|
+
from fastapi import FastAPI
|
|
62
|
+
|
|
63
|
+
client = get_api_client(FastAPI(), token='token')
|
|
64
|
+
assert client.headers['Authorization'] == 'Bearer token'
|
|
65
|
+
assert client.get('/missing').status_code == 404
|
|
66
|
+
PY
|
|
67
|
+
- name: Build the distribution
|
|
68
|
+
run: uv build
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# bazis-test-utils
|
|
2
|
+
|
|
3
|
+
Test helpers shared by the Bazis packages: abstract test models, `factory_boy` factories
|
|
4
|
+
and an API test client (`bazis_test_utils/utils.py`). Every Bazis package depends on it
|
|
5
|
+
through its `test` extra, so a change here affects all their test suites.
|
|
6
|
+
|
|
7
|
+
## Checks
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ruff check bazis_test_utils
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The package has no tests of its own; CI imports the modules, exercises `get_api_client`
|
|
14
|
+
on Python 3.12–3.14 with the highest and the lowest allowed dependency versions, and
|
|
15
|
+
builds the distribution. Changes should also be checked against the test suites of the
|
|
16
|
+
Bazis packages.
|
|
17
|
+
|
|
18
|
+
## Releasing
|
|
19
|
+
|
|
20
|
+
A release is the tag `vX.Y.Z` on `main`: the Build and Publish workflow builds the package
|
|
21
|
+
(the version comes from the tag through setuptools-scm) and publishes it to PyPI
|
|
22
|
+
(pre-releases `-alphaN`/`-betaN`/`-rcN` go to Test PyPI) and creates the GitHub release.
|
|
23
|
+
|
|
24
|
+
Claude Code sessions cannot push tags. Release through the **Release** workflow instead:
|
|
25
|
+
|
|
26
|
+
1. Make sure the changes are merged into `main` and the Tests workflow is green on the
|
|
27
|
+
`main` head commit (the Release workflow checks this and refuses otherwise).
|
|
28
|
+
2. Add the release notes as `docs/releases/X.Y.Z.md` in the change being released.
|
|
29
|
+
3. Start the workflow `release.yml` on `ref: main` with the input `version: X.Y.Z`
|
|
30
|
+
(GitHub API: `POST /repos/ecofuture-tech/bazis-test-utils/actions/workflows/release.yml/dispatches`;
|
|
31
|
+
with the GitHub MCP tools: `actions_run_trigger`, method `run_workflow`).
|
|
32
|
+
4. The Release run creates the annotated tag and starts Build and Publish on it. Check
|
|
33
|
+
that both runs succeed and that the version appears on https://pypi.org/project/bazis-test-utils/.
|
|
34
|
+
|
|
35
|
+
Release the Bazis packages in dependency order: a package is tested in CI against the
|
|
36
|
+
versions of its Bazis dependencies published on PyPI. Pick the version by semver:
|
|
37
|
+
breaking changes (settings renamed or required, dependency removed, behavior changed)
|
|
38
|
+
bump the minor version while the project is below 3.0.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bazis-test-utils
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: A utility package for testing in the Bazis ecosystem — a framework based on Django + FastAPI + Pydantic.
|
|
5
5
|
Author-email: Ilya Kharyn <ilya.tt07@gmail.com>
|
|
6
6
|
Maintainer-email: Ilya Kharyn <ilya.tt07@gmail.com>
|
|
@@ -20,17 +20,16 @@ Requires-Python: >=3.12
|
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
License-File: NOTICE
|
|
23
|
-
Requires-Dist: django
|
|
24
|
-
Requires-Dist: fastapi
|
|
25
|
-
Requires-Dist:
|
|
26
|
-
Requires-Dist:
|
|
27
|
-
Requires-Dist:
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
Requires-Dist: pytest
|
|
30
|
-
Requires-Dist:
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist: uvicorn[standard]
|
|
23
|
+
Requires-Dist: django>=5.2
|
|
24
|
+
Requires-Dist: fastapi>=0.118
|
|
25
|
+
Requires-Dist: starlette>=0.44
|
|
26
|
+
Requires-Dist: factory_boy>=3.3
|
|
27
|
+
Requires-Dist: httpx>=0.27
|
|
28
|
+
Requires-Dist: httpx2>=2.0
|
|
29
|
+
Requires-Dist: pytest>=8.0
|
|
30
|
+
Requires-Dist: pytest-django>=4.9
|
|
31
|
+
Requires-Dist: pytest-mock>=3.14
|
|
32
|
+
Requires-Dist: uvicorn[standard]>=0.30
|
|
34
33
|
Provides-Extra: dev
|
|
35
34
|
Requires-Dist: ruff; extra == "dev"
|
|
36
35
|
Dynamic: license-file
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Third-Party Licenses
|
|
2
|
+
|
|
3
|
+
This document contains the licenses of all third-party dependencies used in this project.
|
|
4
|
+
|
|
5
|
+
| Name | Version | License |
|
|
6
|
+
|-------------------|-----------|--------------------------------------|
|
|
7
|
+
| Django | 6.1.1 | BSD-3-Clause |
|
|
8
|
+
| Faker | 40.40.0 | MIT License |
|
|
9
|
+
| PyYAML | 6.0.3 | MIT License |
|
|
10
|
+
| Pygments | 2.21.0 | BSD-2-Clause |
|
|
11
|
+
| annotated-doc | 0.0.5 | MIT |
|
|
12
|
+
| annotated-types | 0.8.0 | MIT |
|
|
13
|
+
| anyio | 4.15.1 | MIT |
|
|
14
|
+
| asgiref | 3.12.1 | BSD License |
|
|
15
|
+
| certifi | 2026.7.22 | Mozilla Public License 2.0 (MPL 2.0) |
|
|
16
|
+
| click | 8.5.0 | BSD-3-Clause |
|
|
17
|
+
| factory_boy | 3.3.3 | MIT License |
|
|
18
|
+
| fastapi | 0.142.2 | MIT |
|
|
19
|
+
| h11 | 0.16.0 | MIT License |
|
|
20
|
+
| httpcore | 1.0.9 | BSD-3-Clause |
|
|
21
|
+
| httpcore2 | 2.13.1 | BSD-3-Clause |
|
|
22
|
+
| httptools | 0.8.0 | MIT |
|
|
23
|
+
| httpx | 0.28.1 | BSD License |
|
|
24
|
+
| httpx2 | 2.13.1 | BSD-3-Clause |
|
|
25
|
+
| idna | 3.20 | BSD-3-Clause |
|
|
26
|
+
| iniconfig | 2.3.0 | MIT |
|
|
27
|
+
| opentelemetry-api | 1.45.0 | Apache-2.0 |
|
|
28
|
+
| packaging | 26.3 | Apache-2.0 OR BSD-2-Clause |
|
|
29
|
+
| pluggy | 1.6.0 | MIT License |
|
|
30
|
+
| pydantic | 2.13.5 | MIT |
|
|
31
|
+
| pydantic_core | 2.46.5 | MIT |
|
|
32
|
+
| pytest | 9.1.1 | MIT |
|
|
33
|
+
| pytest-django | 4.14.0 | BSD License |
|
|
34
|
+
| pytest-mock | 3.16.0 | MIT License |
|
|
35
|
+
| python-dotenv | 1.2.4 | BSD-3-Clause |
|
|
36
|
+
| sqlparse | 0.6.0 | BSD License |
|
|
37
|
+
| starlette | 1.7.0 | BSD-3-Clause |
|
|
38
|
+
| truststore | 0.10.4 | MIT |
|
|
39
|
+
| typing-inspection | 0.4.4 | MIT |
|
|
40
|
+
| typing_extensions | 4.16.0 | PSF-2.0 |
|
|
41
|
+
| uvicorn | 0.54.0 | BSD-3-Clause |
|
|
42
|
+
| uvloop | 0.23.0 | Apache Software License; MIT License |
|
|
43
|
+
| watchfiles | 1.3.0 | MIT License |
|
|
44
|
+
| websockets | 17.1 | BSD-3-Clause |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '2.3.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (2, 3, 0)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = 'gc94bed9a4'
|
|
@@ -20,7 +20,7 @@ from fastapi.testclient import TestClient
|
|
|
20
20
|
_RequestData = typing.Mapping[str, str | typing.Iterable[str]]
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
def get_api_client(app, token: str = None):
|
|
23
|
+
def get_api_client(app, token: str | None = None):
|
|
24
24
|
class ApiClient:
|
|
25
25
|
def __init__(self):
|
|
26
26
|
self.headers = {'Content-Type': 'application/vnd.api+json'}
|
|
@@ -29,7 +29,7 @@ def get_api_client(app, token: str = None):
|
|
|
29
29
|
|
|
30
30
|
self.client = TestClient(app, client=("127.0.0.1", 50000))
|
|
31
31
|
|
|
32
|
-
def get(self, url: str, params: dict = None, headers: dict = None):
|
|
32
|
+
def get(self, url: str, params: dict | None = None, headers: dict | None = None):
|
|
33
33
|
return self.client.get(
|
|
34
34
|
url,
|
|
35
35
|
params=params,
|
|
@@ -39,13 +39,13 @@ def get_api_client(app, token: str = None):
|
|
|
39
39
|
def post(
|
|
40
40
|
self,
|
|
41
41
|
url: str,
|
|
42
|
-
params: dict = None,
|
|
43
|
-
content: dict = None,
|
|
44
|
-
cookies: dict = None,
|
|
45
|
-
data: dict = None,
|
|
46
|
-
json_data: dict = None,
|
|
47
|
-
files: dict = None,
|
|
48
|
-
headers: dict = None,
|
|
42
|
+
params: dict | None = None,
|
|
43
|
+
content: dict | None = None,
|
|
44
|
+
cookies: dict | None = None,
|
|
45
|
+
data: dict | None = None,
|
|
46
|
+
json_data: dict | None = None,
|
|
47
|
+
files: dict | None = None,
|
|
48
|
+
headers: dict | None = None,
|
|
49
49
|
):
|
|
50
50
|
headers = self.headers | (headers or {})
|
|
51
51
|
if files:
|
|
@@ -65,13 +65,13 @@ def get_api_client(app, token: str = None):
|
|
|
65
65
|
def patch(
|
|
66
66
|
self,
|
|
67
67
|
url: str,
|
|
68
|
-
params: dict = None,
|
|
69
|
-
content: dict = None,
|
|
70
|
-
cookies: dict = None,
|
|
71
|
-
data: dict = None,
|
|
72
|
-
json_data: dict = None,
|
|
73
|
-
files: dict = None,
|
|
74
|
-
headers: dict = None,
|
|
68
|
+
params: dict | None = None,
|
|
69
|
+
content: dict | None = None,
|
|
70
|
+
cookies: dict | None = None,
|
|
71
|
+
data: dict | None = None,
|
|
72
|
+
json_data: dict | None = None,
|
|
73
|
+
files: dict | None = None,
|
|
74
|
+
headers: dict | None = None,
|
|
75
75
|
):
|
|
76
76
|
headers = self.headers | (headers or {})
|
|
77
77
|
if files:
|
|
@@ -88,19 +88,19 @@ def get_api_client(app, token: str = None):
|
|
|
88
88
|
files=files,
|
|
89
89
|
)
|
|
90
90
|
|
|
91
|
-
def delete(self, url: str, params: dict = None, headers: dict = None):
|
|
91
|
+
def delete(self, url: str, params: dict | None = None, headers: dict | None = None):
|
|
92
92
|
return self.client.delete(url, params=params, headers=self.headers | (headers or {}))
|
|
93
93
|
|
|
94
94
|
def put(
|
|
95
95
|
self,
|
|
96
96
|
url: str,
|
|
97
|
-
params: dict = None,
|
|
98
|
-
content: dict = None,
|
|
99
|
-
cookies: dict = None,
|
|
100
|
-
data: dict = None,
|
|
101
|
-
json_data: dict = None,
|
|
102
|
-
files: dict = None,
|
|
103
|
-
headers: dict = None,
|
|
97
|
+
params: dict | None = None,
|
|
98
|
+
content: dict | None = None,
|
|
99
|
+
cookies: dict | None = None,
|
|
100
|
+
data: dict | None = None,
|
|
101
|
+
json_data: dict | None = None,
|
|
102
|
+
files: dict | None = None,
|
|
103
|
+
headers: dict | None = None,
|
|
104
104
|
):
|
|
105
105
|
headers = self.headers | (headers or {})
|
|
106
106
|
if files:
|
|
@@ -117,10 +117,10 @@ def get_api_client(app, token: str = None):
|
|
|
117
117
|
files=files,
|
|
118
118
|
)
|
|
119
119
|
|
|
120
|
-
def options(self, url: str, params: dict = None, headers: dict = None):
|
|
120
|
+
def options(self, url: str, params: dict | None = None, headers: dict | None = None):
|
|
121
121
|
return self.client.options(url, params=params, headers=self.headers | (headers or {}))
|
|
122
122
|
|
|
123
|
-
def head(self, url: str, params: dict = None, headers: dict = None):
|
|
123
|
+
def head(self, url: str, params: dict | None = None, headers: dict | None = None):
|
|
124
124
|
return self.client.head(url, params=params, headers=self.headers | (headers or {}))
|
|
125
125
|
|
|
126
126
|
client = ApiClient()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bazis-test-utils
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: A utility package for testing in the Bazis ecosystem — a framework based on Django + FastAPI + Pydantic.
|
|
5
5
|
Author-email: Ilya Kharyn <ilya.tt07@gmail.com>
|
|
6
6
|
Maintainer-email: Ilya Kharyn <ilya.tt07@gmail.com>
|
|
@@ -20,17 +20,16 @@ Requires-Python: >=3.12
|
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
License-File: NOTICE
|
|
23
|
-
Requires-Dist: django
|
|
24
|
-
Requires-Dist: fastapi
|
|
25
|
-
Requires-Dist:
|
|
26
|
-
Requires-Dist:
|
|
27
|
-
Requires-Dist:
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
Requires-Dist: pytest
|
|
30
|
-
Requires-Dist:
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist: uvicorn[standard]
|
|
23
|
+
Requires-Dist: django>=5.2
|
|
24
|
+
Requires-Dist: fastapi>=0.118
|
|
25
|
+
Requires-Dist: starlette>=0.44
|
|
26
|
+
Requires-Dist: factory_boy>=3.3
|
|
27
|
+
Requires-Dist: httpx>=0.27
|
|
28
|
+
Requires-Dist: httpx2>=2.0
|
|
29
|
+
Requires-Dist: pytest>=8.0
|
|
30
|
+
Requires-Dist: pytest-django>=4.9
|
|
31
|
+
Requires-Dist: pytest-mock>=3.14
|
|
32
|
+
Requires-Dist: uvicorn[standard]>=0.30
|
|
34
33
|
Provides-Extra: dev
|
|
35
34
|
Requires-Dist: ruff; extra == "dev"
|
|
36
35
|
Dynamic: license-file
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
.gitignore
|
|
2
|
+
CLAUDE.md
|
|
2
3
|
LICENSE
|
|
3
4
|
NOTICE
|
|
4
5
|
README.md
|
|
5
6
|
THIRD_PARTY_LICENSES.md
|
|
6
7
|
pyproject.toml
|
|
7
8
|
.github/workflows/build-publish.yml
|
|
9
|
+
.github/workflows/release.yml
|
|
10
|
+
.github/workflows/tests.yml
|
|
8
11
|
.github/workflows/update-licenses.yml
|
|
9
12
|
bazis_test_utils/__init__.py
|
|
10
13
|
bazis_test_utils/_version.py
|
|
@@ -15,9 +18,12 @@ bazis_test_utils.egg-info/PKG-INFO
|
|
|
15
18
|
bazis_test_utils.egg-info/SOURCES.txt
|
|
16
19
|
bazis_test_utils.egg-info/dependency_links.txt
|
|
17
20
|
bazis_test_utils.egg-info/requires.txt
|
|
21
|
+
bazis_test_utils.egg-info/scm_file_list.json
|
|
22
|
+
bazis_test_utils.egg-info/scm_version.json
|
|
18
23
|
bazis_test_utils.egg-info/top_level.txt
|
|
19
24
|
bazis_test_utils/locale/messages.pot
|
|
20
25
|
bazis_test_utils/locale/en/LC_MESSAGES/django.mo
|
|
21
26
|
bazis_test_utils/locale/en/LC_MESSAGES/django.po
|
|
22
27
|
bazis_test_utils/locale/ru/LC_MESSAGES/django.mo
|
|
23
|
-
bazis_test_utils/locale/ru/LC_MESSAGES/django.po
|
|
28
|
+
bazis_test_utils/locale/ru/LC_MESSAGES/django.po
|
|
29
|
+
docs/releases/2.3.0.md
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
".github/workflows/build-publish.yml",
|
|
4
|
+
".github/workflows/release.yml",
|
|
5
|
+
".github/workflows/tests.yml",
|
|
6
|
+
".github/workflows/update-licenses.yml",
|
|
7
|
+
".gitignore",
|
|
8
|
+
"CLAUDE.md",
|
|
9
|
+
"LICENSE",
|
|
10
|
+
"NOTICE",
|
|
11
|
+
"README.md",
|
|
12
|
+
"THIRD_PARTY_LICENSES.md",
|
|
13
|
+
"bazis_test_utils/__init__.py",
|
|
14
|
+
"bazis_test_utils/factories_abstract.py",
|
|
15
|
+
"bazis_test_utils/locale/en/LC_MESSAGES/django.mo",
|
|
16
|
+
"bazis_test_utils/locale/en/LC_MESSAGES/django.po",
|
|
17
|
+
"bazis_test_utils/locale/messages.pot",
|
|
18
|
+
"bazis_test_utils/locale/ru/LC_MESSAGES/django.mo",
|
|
19
|
+
"bazis_test_utils/locale/ru/LC_MESSAGES/django.po",
|
|
20
|
+
"bazis_test_utils/models_abstract.py",
|
|
21
|
+
"bazis_test_utils/utils.py",
|
|
22
|
+
"docs/releases/2.3.0.md",
|
|
23
|
+
"pyproject.toml"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# bazis-test-utils 2.3.0
|
|
2
|
+
|
|
3
|
+
- `starlette.testclient` in Starlette 1.3+ uses `httpx2` and warns when only `httpx` is
|
|
4
|
+
installed; `httpx2` is now a dependency (`httpx` stays for older Starlette releases).
|
|
5
|
+
- `get_api_client` passes `client=` to `TestClient`, which needs Starlette 0.44:
|
|
6
|
+
the minimum versions are now `fastapi>=0.118` and `starlette>=0.44`. All dependencies
|
|
7
|
+
received minimum versions (`django>=5.2`, `pytest>=8`, `pytest-django>=4.9`, ...).
|
|
8
|
+
- `requests`, `requests-toolbelt` and `requests-mock` are no longer dependencies: nothing
|
|
9
|
+
in the package or in the Bazis test suites uses them. Projects that do must declare them.
|
|
10
|
+
- Optional arguments of the API client are annotated as `X | None`.
|
|
11
|
+
- CI: lint, import and API client smoke test on Python 3.12–3.14 and with the lowest
|
|
12
|
+
allowed dependency versions, and a distribution build. Releases are made with the
|
|
13
|
+
Release workflow (see `CLAUDE.md`).
|
|
@@ -34,17 +34,18 @@ classifiers = [
|
|
|
34
34
|
"Framework :: FastAPI",
|
|
35
35
|
]
|
|
36
36
|
dependencies = [
|
|
37
|
-
"django",
|
|
38
|
-
"fastapi",
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
37
|
+
"django>=5.2",
|
|
38
|
+
"fastapi>=0.118",
|
|
39
|
+
# TestClient(client=...) used by get_api_client
|
|
40
|
+
"starlette>=0.44",
|
|
41
|
+
"factory_boy>=3.3",
|
|
42
|
+
# the test client of Starlette < 1.3 uses httpx, newer releases use httpx2
|
|
43
|
+
"httpx>=0.27",
|
|
44
|
+
"httpx2>=2.0",
|
|
45
|
+
"pytest>=8.0",
|
|
46
|
+
"pytest-django>=4.9",
|
|
47
|
+
"pytest-mock>=3.14",
|
|
48
|
+
"uvicorn[standard]>=0.30",
|
|
48
49
|
]
|
|
49
50
|
|
|
50
51
|
[project.optional-dependencies]
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
name: Build and Publish
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- 'v*.*.*'
|
|
7
|
-
|
|
8
|
-
permissions:
|
|
9
|
-
contents: write
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
build:
|
|
13
|
-
uses: ecofuture-tech/.github/.github/workflows/reusable-build-publish.yml@main
|
|
14
|
-
secrets:
|
|
15
|
-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
|
16
|
-
TEST_PYPI_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# Third-Party Licenses
|
|
2
|
-
|
|
3
|
-
This document contains the licenses of all third-party dependencies used in this project.
|
|
4
|
-
|
|
5
|
-
| Name | Version | License |
|
|
6
|
-
|--------------------|----------|--------------------------------------|
|
|
7
|
-
| Django | 6.0.1 | BSD-3-Clause |
|
|
8
|
-
| Faker | 40.1.2 | MIT License |
|
|
9
|
-
| PyYAML | 6.0.3 | MIT License |
|
|
10
|
-
| Pygments | 2.19.2 | BSD License |
|
|
11
|
-
| annotated-doc | 0.0.4 | MIT |
|
|
12
|
-
| annotated-types | 0.7.0 | MIT License |
|
|
13
|
-
| anyio | 4.12.1 | MIT |
|
|
14
|
-
| asgiref | 3.11.0 | BSD License |
|
|
15
|
-
| certifi | 2026.1.4 | Mozilla Public License 2.0 (MPL 2.0) |
|
|
16
|
-
| charset-normalizer | 3.4.4 | MIT |
|
|
17
|
-
| click | 8.3.1 | BSD-3-Clause |
|
|
18
|
-
| factory_boy | 3.3.3 | MIT License |
|
|
19
|
-
| fastapi | 0.128.0 | MIT |
|
|
20
|
-
| h11 | 0.16.0 | MIT License |
|
|
21
|
-
| httpcore | 1.0.9 | BSD-3-Clause |
|
|
22
|
-
| httptools | 0.7.1 | MIT |
|
|
23
|
-
| httpx | 0.27.0 | BSD-3-Clause |
|
|
24
|
-
| idna | 3.11 | BSD-3-Clause |
|
|
25
|
-
| iniconfig | 2.3.0 | MIT |
|
|
26
|
-
| packaging | 25.0 | Apache Software License; BSD License |
|
|
27
|
-
| pluggy | 1.6.0 | MIT License |
|
|
28
|
-
| pydantic | 2.12.5 | MIT |
|
|
29
|
-
| pydantic_core | 2.41.5 | MIT |
|
|
30
|
-
| pytest | 9.0.2 | MIT |
|
|
31
|
-
| pytest-django | 4.11.1 | BSD License |
|
|
32
|
-
| pytest-mock | 3.15.1 | MIT License |
|
|
33
|
-
| python-dotenv | 1.2.1 | BSD-3-Clause |
|
|
34
|
-
| requests | 2.32.5 | Apache Software License |
|
|
35
|
-
| requests-mock | 1.12.1 | Apache Software License |
|
|
36
|
-
| requests-toolbelt | 1.0.0 | Apache Software License |
|
|
37
|
-
| sniffio | 1.3.1 | Apache Software License; MIT License |
|
|
38
|
-
| sqlparse | 0.5.5 | BSD License |
|
|
39
|
-
| starlette | 0.50.0 | BSD-3-Clause |
|
|
40
|
-
| typing-inspection | 0.4.2 | MIT |
|
|
41
|
-
| typing_extensions | 4.15.0 | PSF-2.0 |
|
|
42
|
-
| urllib3 | 2.6.3 | MIT |
|
|
43
|
-
| uvicorn | 0.40.0 | BSD-3-Clause |
|
|
44
|
-
| uvloop | 0.22.1 | Apache Software License; MIT License |
|
|
45
|
-
| watchfiles | 1.1.1 | MIT License |
|
|
46
|
-
| websockets | 16.0 | BSD-3-Clause |
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# file generated by setuptools-scm
|
|
2
|
-
# don't change, don't track in version control
|
|
3
|
-
|
|
4
|
-
__all__ = [
|
|
5
|
-
"__version__",
|
|
6
|
-
"__version_tuple__",
|
|
7
|
-
"version",
|
|
8
|
-
"version_tuple",
|
|
9
|
-
"__commit_id__",
|
|
10
|
-
"commit_id",
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
TYPE_CHECKING = False
|
|
14
|
-
if TYPE_CHECKING:
|
|
15
|
-
from typing import Tuple
|
|
16
|
-
from typing import Union
|
|
17
|
-
|
|
18
|
-
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
-
COMMIT_ID = Union[str, None]
|
|
20
|
-
else:
|
|
21
|
-
VERSION_TUPLE = object
|
|
22
|
-
COMMIT_ID = object
|
|
23
|
-
|
|
24
|
-
version: str
|
|
25
|
-
__version__: str
|
|
26
|
-
__version_tuple__: VERSION_TUPLE
|
|
27
|
-
version_tuple: VERSION_TUPLE
|
|
28
|
-
commit_id: COMMIT_ID
|
|
29
|
-
__commit_id__: COMMIT_ID
|
|
30
|
-
|
|
31
|
-
__version__ = version = '2.2.2'
|
|
32
|
-
__version_tuple__ = version_tuple = (2, 2, 2)
|
|
33
|
-
|
|
34
|
-
__commit_id__ = commit_id = 'g9a83c3673'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils/locale/en/LC_MESSAGES/django.mo
RENAMED
|
File without changes
|
{bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils/locale/en/LC_MESSAGES/django.po
RENAMED
|
File without changes
|
|
File without changes
|
{bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils/locale/ru/LC_MESSAGES/django.mo
RENAMED
|
File without changes
|
{bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils/locale/ru/LC_MESSAGES/django.po
RENAMED
|
File without changes
|
|
File without changes
|
{bazis_test_utils-2.2.2 → bazis_test_utils-2.3.0}/bazis_test_utils.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|