httpxgen 0.3.0__tar.gz → 0.4.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.
- {httpxgen-0.3.0 → httpxgen-0.4.0}/.github/workflows/ci.yml +68 -68
- httpxgen-0.4.0/.github/workflows/release.yml +135 -0
- httpxgen-0.4.0/IMPROVEMENT_SPEC.md +483 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/PKG-INFO +55 -10
- {httpxgen-0.3.0 → httpxgen-0.4.0}/README.md +724 -679
- {httpxgen-0.3.0 → httpxgen-0.4.0}/VISION.md +1 -1
- {httpxgen-0.3.0 → httpxgen-0.4.0}/changelog.md +324 -298
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/cli.py +94 -94
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/__init__.py +4 -4
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/build.py +217 -222
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/client.py +1057 -1047
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/models.py +630 -610
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/naming.py +97 -97
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/normalize.py +721 -692
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/operations.py +954 -927
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/package.py +282 -279
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/schema.py +226 -226
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/templates/binary_operation.jinja2 +51 -51
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/templates/client.jinja2 +29 -29
- httpxgen-0.3.0/httpxgen/generator/templates/exceptions.jinja2 → httpxgen-0.4.0/httpxgen/generator/templates/errors.jinja2 +79 -81
- httpxgen-0.4.0/httpxgen/generator/templates/models.jinja2 +37 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/templates/serialization.jinja2 +329 -287
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/templates/shared_init.jinja2 +66 -67
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/templates/transport.jinja2 +135 -155
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/templates.py +41 -42
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/openapi.py +134 -118
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/output.py +110 -110
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/references.py +162 -149
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/selection.py +196 -178
- {httpxgen-0.3.0 → httpxgen-0.4.0}/preview/__init__.py +93 -93
- {httpxgen-0.3.0 → httpxgen-0.4.0}/preview/invoices/__init__.py +22 -22
- {httpxgen-0.3.0 → httpxgen-0.4.0}/preview/invoices/client.py +270 -271
- {httpxgen-0.3.0 → httpxgen-0.4.0}/preview/invoices/models.py +59 -61
- {httpxgen-0.3.0 → httpxgen-0.4.0}/preview/payments/__init__.py +62 -62
- {httpxgen-0.3.0 → httpxgen-0.4.0}/preview/payments/client.py +675 -676
- {httpxgen-0.3.0 → httpxgen-0.4.0}/preview/payments/models.py +244 -246
- {httpxgen-0.3.0 → httpxgen-0.4.0}/preview/shared/__init__.py +71 -72
- httpxgen-0.3.0/preview/shared/exceptions.py → httpxgen-0.4.0/preview/shared/errors.py +84 -86
- {httpxgen-0.3.0 → httpxgen-0.4.0}/preview/shared/models.py +72 -41
- {httpxgen-0.3.0 → httpxgen-0.4.0}/preview/shared/serialization.py +336 -294
- {httpxgen-0.3.0 → httpxgen-0.4.0}/preview/shared/transport.py +141 -162
- {httpxgen-0.3.0 → httpxgen-0.4.0}/pyproject.toml +66 -66
- {httpxgen-0.3.0 → httpxgen-0.4.0}/specs/api.yml +753 -753
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/conftest.py +25 -25
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/generator/test_build.py +427 -406
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/generator/test_client.py +265 -267
- httpxgen-0.4.0/tests/generator/test_cookies.py +161 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/generator/test_improvements.py +351 -351
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/generator/test_models.py +203 -190
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/generator/test_normalize.py +425 -425
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/generator/test_package.py +61 -61
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/generator/test_runtime.py +597 -597
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/generator/test_schema.py +94 -94
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/generator/test_tickets.py +2634 -2634
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/generator/test_typing.py +116 -114
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/test_cli.py +75 -75
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/test_openapi.py +38 -31
- httpxgen-0.4.0/tests/test_openapi_32.py +286 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/test_output.py +171 -147
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/test_selection.py +136 -136
- {httpxgen-0.3.0 → httpxgen-0.4.0}/uv.lock +546 -546
- httpxgen-0.3.0/httpxgen/generator/templates/http_methods.jinja2 +0 -12
- httpxgen-0.3.0/httpxgen/generator/templates/models.jinja2 +0 -6
- httpxgen-0.3.0/preview/shared/http_methods.py +0 -17
- {httpxgen-0.3.0 → httpxgen-0.4.0}/.gitignore +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/.python-version +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/CLAUDE.md +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/LICENSE +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/__init__.py +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/errors.py +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/templates/enum.jinja2 +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/templates/generated_header.jinja2 +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/templates/model.jinja2 +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/templates/operation.jinja2 +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/generator/templates/package_init.jinja2 +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/io.py +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/httpxgen/loading.py +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/preview/py.typed +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/scripts/generate-preview.sh +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/generator/test_naming.py +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/generator/test_operations.py +0 -0
- {httpxgen-0.3.0 → httpxgen-0.4.0}/tests/test_loading.py +0 -0
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main]
|
|
6
|
-
pull_request:
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
lint:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v4
|
|
13
|
-
|
|
14
|
-
- name: Install uv
|
|
15
|
-
uses: astral-sh/setup-uv@v4
|
|
16
|
-
with:
|
|
17
|
-
python-version: "3.14"
|
|
18
|
-
|
|
19
|
-
- name: Install dependencies
|
|
20
|
-
run: uv sync --locked --all-groups
|
|
21
|
-
|
|
22
|
-
- name: Ruff lint
|
|
23
|
-
run: uv run ruff check --output-format=github .
|
|
24
|
-
|
|
25
|
-
- name: Ruff format
|
|
26
|
-
run: uv run ruff format --check .
|
|
27
|
-
|
|
28
|
-
preview:
|
|
29
|
-
runs-on: ubuntu-latest
|
|
30
|
-
steps:
|
|
31
|
-
- uses: actions/checkout@v4
|
|
32
|
-
|
|
33
|
-
- name: Install uv
|
|
34
|
-
uses: astral-sh/setup-uv@v4
|
|
35
|
-
with:
|
|
36
|
-
python-version: "3.14"
|
|
37
|
-
|
|
38
|
-
- name: Install dependencies
|
|
39
|
-
run: uv sync --locked --all-groups
|
|
40
|
-
|
|
41
|
-
- name: Regenerate the preview client
|
|
42
|
-
run: bash scripts/generate-preview.sh
|
|
43
|
-
|
|
44
|
-
- name: Fail if the checked-in preview is stale
|
|
45
|
-
run: git diff --exit-code -- preview
|
|
46
|
-
|
|
47
|
-
test:
|
|
48
|
-
runs-on: ubuntu-latest
|
|
49
|
-
strategy:
|
|
50
|
-
matrix:
|
|
51
|
-
python-version: ["3.12", "3.13", "3.14"]
|
|
52
|
-
steps:
|
|
53
|
-
- uses: actions/checkout@v4
|
|
54
|
-
|
|
55
|
-
- name: Install uv
|
|
56
|
-
uses: astral-sh/setup-uv@v4
|
|
57
|
-
with:
|
|
58
|
-
python-version: ${{ matrix.python-version }}
|
|
59
|
-
|
|
60
|
-
- name: Install dependencies
|
|
61
|
-
run: uv sync --locked --all-groups
|
|
62
|
-
|
|
63
|
-
- name: Run tests
|
|
64
|
-
run: uv run pytest
|
|
65
|
-
|
|
66
|
-
- name: Type-check generated protocols
|
|
67
|
-
if: matrix.python-version == '3.14'
|
|
68
|
-
run: uv run --frozen --with mypy==2.4.0 --with httpx2==2.13.1 pytest --no-cov tests/generator/test_typing.py
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
lint:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Install uv
|
|
15
|
+
uses: astral-sh/setup-uv@v4
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.14"
|
|
18
|
+
|
|
19
|
+
- name: Install dependencies
|
|
20
|
+
run: uv sync --locked --all-groups
|
|
21
|
+
|
|
22
|
+
- name: Ruff lint
|
|
23
|
+
run: uv run ruff check --output-format=github .
|
|
24
|
+
|
|
25
|
+
- name: Ruff format
|
|
26
|
+
run: uv run ruff format --check .
|
|
27
|
+
|
|
28
|
+
preview:
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
|
|
33
|
+
- name: Install uv
|
|
34
|
+
uses: astral-sh/setup-uv@v4
|
|
35
|
+
with:
|
|
36
|
+
python-version: "3.14"
|
|
37
|
+
|
|
38
|
+
- name: Install dependencies
|
|
39
|
+
run: uv sync --locked --all-groups
|
|
40
|
+
|
|
41
|
+
- name: Regenerate the preview client
|
|
42
|
+
run: bash scripts/generate-preview.sh
|
|
43
|
+
|
|
44
|
+
- name: Fail if the checked-in preview is stale
|
|
45
|
+
run: git diff --exit-code -- preview
|
|
46
|
+
|
|
47
|
+
test:
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
strategy:
|
|
50
|
+
matrix:
|
|
51
|
+
python-version: ["3.12", "3.13", "3.14"]
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v4
|
|
54
|
+
|
|
55
|
+
- name: Install uv
|
|
56
|
+
uses: astral-sh/setup-uv@v4
|
|
57
|
+
with:
|
|
58
|
+
python-version: ${{ matrix.python-version }}
|
|
59
|
+
|
|
60
|
+
- name: Install dependencies
|
|
61
|
+
run: uv sync --locked --all-groups
|
|
62
|
+
|
|
63
|
+
- name: Run tests
|
|
64
|
+
run: uv run pytest
|
|
65
|
+
|
|
66
|
+
- name: Type-check generated protocols
|
|
67
|
+
if: matrix.python-version == '3.14'
|
|
68
|
+
run: uv run --frozen --with mypy==2.4.0 --with httpx2==2.13.1 pytest --no-cov tests/generator/test_typing.py
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
release:
|
|
6
|
+
types: [published]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: release-${{ github.event.release.tag_name || github.head_ref || github.ref }}
|
|
13
|
+
cancel-in-progress: false
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build:
|
|
17
|
+
name: Build and verify distributions
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
persist-credentials: false
|
|
24
|
+
|
|
25
|
+
- name: Install uv
|
|
26
|
+
uses: astral-sh/setup-uv@v4
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.14"
|
|
29
|
+
|
|
30
|
+
- name: Validate release tag and source
|
|
31
|
+
if: github.event_name == 'release'
|
|
32
|
+
env:
|
|
33
|
+
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
34
|
+
run: |
|
|
35
|
+
python - <<'PY'
|
|
36
|
+
import os
|
|
37
|
+
import tomllib
|
|
38
|
+
from pathlib import Path
|
|
39
|
+
|
|
40
|
+
version = tomllib.loads(Path("pyproject.toml").read_text())["project"]["version"]
|
|
41
|
+
expected = f"v{version}"
|
|
42
|
+
if os.environ["RELEASE_TAG"] != expected:
|
|
43
|
+
raise SystemExit(f"Release tag must be {expected}")
|
|
44
|
+
PY
|
|
45
|
+
git merge-base --is-ancestor HEAD origin/main
|
|
46
|
+
|
|
47
|
+
- name: Install locked dependencies
|
|
48
|
+
run: uv sync --locked --all-groups
|
|
49
|
+
|
|
50
|
+
- name: Lint and format
|
|
51
|
+
run: |
|
|
52
|
+
uv run ruff check --output-format=github .
|
|
53
|
+
uv run ruff format --check .
|
|
54
|
+
|
|
55
|
+
- name: Run tests
|
|
56
|
+
run: uv run pytest
|
|
57
|
+
|
|
58
|
+
- name: Type-check generated protocols
|
|
59
|
+
run: uv run --frozen --with mypy==2.4.0 --with httpx2==2.13.1 pytest --no-cov tests/generator/test_typing.py
|
|
60
|
+
|
|
61
|
+
- name: Verify checked-in preview
|
|
62
|
+
run: |
|
|
63
|
+
bash scripts/generate-preview.sh
|
|
64
|
+
git diff --exit-code -- preview
|
|
65
|
+
|
|
66
|
+
- name: Build wheel and source distribution
|
|
67
|
+
run: uv build --no-sources
|
|
68
|
+
|
|
69
|
+
- name: Check distribution metadata
|
|
70
|
+
run: uvx --from twine twine check --strict dist/*
|
|
71
|
+
|
|
72
|
+
- name: Smoke-test the installed wheel outside the checkout
|
|
73
|
+
run: |
|
|
74
|
+
wheel="$(realpath dist/*.whl)"
|
|
75
|
+
cd "$RUNNER_TEMP"
|
|
76
|
+
uv run --isolated --no-project --with "$wheel" httpxgen --help
|
|
77
|
+
uv run --isolated --no-project --with "$wheel" httpxgen \
|
|
78
|
+
"$GITHUB_WORKSPACE/specs/api.yml" "$RUNNER_TEMP/release_smoke" \
|
|
79
|
+
--package-name release_smoke --tag payments --tag invoices
|
|
80
|
+
uv run --isolated --no-project --with "$wheel" httpxgen \
|
|
81
|
+
"$GITHUB_WORKSPACE/specs/api.yml" "$RUNNER_TEMP/release_smoke" \
|
|
82
|
+
--package-name release_smoke --tag payments --tag invoices --check
|
|
83
|
+
|
|
84
|
+
- name: Store verified distributions
|
|
85
|
+
uses: actions/upload-artifact@v4
|
|
86
|
+
with:
|
|
87
|
+
name: distributions
|
|
88
|
+
path: |
|
|
89
|
+
dist/*.whl
|
|
90
|
+
dist/*.tar.gz
|
|
91
|
+
if-no-files-found: error
|
|
92
|
+
|
|
93
|
+
publish:
|
|
94
|
+
name: Publish to PyPI
|
|
95
|
+
if: github.event_name == 'release'
|
|
96
|
+
needs: build
|
|
97
|
+
runs-on: ubuntu-latest
|
|
98
|
+
environment:
|
|
99
|
+
name: pypi
|
|
100
|
+
url: https://pypi.org/project/httpxgen/
|
|
101
|
+
permissions:
|
|
102
|
+
id-token: write
|
|
103
|
+
steps:
|
|
104
|
+
- name: Download verified distributions
|
|
105
|
+
uses: actions/download-artifact@v4
|
|
106
|
+
with:
|
|
107
|
+
name: distributions
|
|
108
|
+
path: dist
|
|
109
|
+
|
|
110
|
+
- name: Publish with Trusted Publishing
|
|
111
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
112
|
+
|
|
113
|
+
release-assets:
|
|
114
|
+
name: Attach published distributions to GitHub Release
|
|
115
|
+
if: github.event_name == 'release'
|
|
116
|
+
needs: publish
|
|
117
|
+
runs-on: ubuntu-latest
|
|
118
|
+
permissions:
|
|
119
|
+
contents: write
|
|
120
|
+
steps:
|
|
121
|
+
- name: Download published distributions
|
|
122
|
+
uses: actions/download-artifact@v4
|
|
123
|
+
with:
|
|
124
|
+
name: distributions
|
|
125
|
+
path: dist
|
|
126
|
+
|
|
127
|
+
- name: Calculate checksums
|
|
128
|
+
working-directory: dist
|
|
129
|
+
run: sha256sum -- *.whl *.tar.gz > SHA256SUMS
|
|
130
|
+
|
|
131
|
+
- name: Upload release assets
|
|
132
|
+
env:
|
|
133
|
+
GH_TOKEN: ${{ github.token }}
|
|
134
|
+
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
135
|
+
run: gh release upload "$RELEASE_TAG" dist/* --repo "$GITHUB_REPOSITORY" --clobber
|