pyqwest 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.
Files changed (62) hide show
  1. pyqwest-0.1.0/.cargo/config.toml +2 -0
  2. pyqwest-0.1.0/.gitattributes +1 -0
  3. pyqwest-0.1.0/.github/workflows/ci.yaml +87 -0
  4. pyqwest-0.1.0/.github/workflows/docs.yaml +51 -0
  5. pyqwest-0.1.0/.github/workflows/release.yaml +202 -0
  6. pyqwest-0.1.0/.gitignore +22 -0
  7. pyqwest-0.1.0/CODE_OF_CONDUCT.md +31 -0
  8. pyqwest-0.1.0/Cargo.lock +2554 -0
  9. pyqwest-0.1.0/Cargo.toml +46 -0
  10. pyqwest-0.1.0/LICENSE +21 -0
  11. pyqwest-0.1.0/PKG-INFO +21 -0
  12. pyqwest-0.1.0/README.md +82 -0
  13. pyqwest-0.1.0/codecov.yml +8 -0
  14. pyqwest-0.1.0/docs/api.md +14 -0
  15. pyqwest-0.1.0/docs/img/favicon.png +0 -0
  16. pyqwest-0.1.0/docs/img/logo.png +0 -0
  17. pyqwest-0.1.0/docs/index.md +76 -0
  18. pyqwest-0.1.0/poe_tasks.toml +48 -0
  19. pyqwest-0.1.0/pyproject.toml +193 -0
  20. pyqwest-0.1.0/pyqwest/__init__.py +47 -0
  21. pyqwest-0.1.0/pyqwest/_glue.py +79 -0
  22. pyqwest-0.1.0/pyqwest/httpx/__init__.py +5 -0
  23. pyqwest-0.1.0/pyqwest/httpx/_transport.py +280 -0
  24. pyqwest-0.1.0/pyqwest/pyqwest.pyi +1104 -0
  25. pyqwest-0.1.0/pyqwest.code-workspace +55 -0
  26. pyqwest-0.1.0/renovate.json +25 -0
  27. pyqwest-0.1.0/src/asyncio/awaitable.rs +107 -0
  28. pyqwest-0.1.0/src/asyncio/client.rs +176 -0
  29. pyqwest-0.1.0/src/asyncio/mod.rs +6 -0
  30. pyqwest-0.1.0/src/asyncio/request.rs +182 -0
  31. pyqwest-0.1.0/src/asyncio/response.rs +270 -0
  32. pyqwest-0.1.0/src/asyncio/stream.rs +103 -0
  33. pyqwest-0.1.0/src/asyncio/transport.rs +182 -0
  34. pyqwest-0.1.0/src/common.rs +95 -0
  35. pyqwest-0.1.0/src/headers.rs +1062 -0
  36. pyqwest-0.1.0/src/lib.rs +68 -0
  37. pyqwest-0.1.0/src/pyerrors.rs +113 -0
  38. pyqwest-0.1.0/src/shared/mod.rs +6 -0
  39. pyqwest-0.1.0/src/shared/request.rs +65 -0
  40. pyqwest-0.1.0/src/shared/response.rs +231 -0
  41. pyqwest-0.1.0/src/shared/transport.rs +126 -0
  42. pyqwest-0.1.0/src/sync/client.rs +158 -0
  43. pyqwest-0.1.0/src/sync/mod.rs +4 -0
  44. pyqwest-0.1.0/src/sync/request.rs +139 -0
  45. pyqwest-0.1.0/src/sync/response.rs +239 -0
  46. pyqwest-0.1.0/src/sync/transport.rs +155 -0
  47. pyqwest-0.1.0/tests/__init__.py +0 -0
  48. pyqwest-0.1.0/tests/apps/asgi/__init__.py +1 -0
  49. pyqwest-0.1.0/tests/apps/asgi/kitchensink.py +87 -0
  50. pyqwest-0.1.0/tests/conftest.py +159 -0
  51. pyqwest-0.1.0/tests/test_benchmark.py +330 -0
  52. pyqwest-0.1.0/tests/test_client.py +650 -0
  53. pyqwest-0.1.0/tests/test_errors.py +108 -0
  54. pyqwest-0.1.0/tests/test_headers.py +275 -0
  55. pyqwest-0.1.0/tests/test_middleware.py +328 -0
  56. pyqwest-0.1.0/tests/test_request.py +122 -0
  57. pyqwest-0.1.0/tests/test_response.py +155 -0
  58. pyqwest-0.1.0/tests/test_tls.py +70 -0
  59. pyqwest-0.1.0/tests/test_transport.py +121 -0
  60. pyqwest-0.1.0/tests/test_validation.py +29 -0
  61. pyqwest-0.1.0/uv.lock +2599 -0
  62. pyqwest-0.1.0/zensical.toml +44 -0
@@ -0,0 +1,2 @@
1
+ [build]
2
+ rustflags = ["--cfg", "reqwest_unstable"]
@@ -0,0 +1 @@
1
+ * text=auto eol=lf
@@ -0,0 +1,87 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ # Cancel in-progress jobs for PRs only
14
+ group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.sha || github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ jobs:
18
+ build:
19
+ runs-on: ${{ matrix.os }}
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ os:
24
+ - macos-15
25
+ - ubuntu-24.04
26
+ - windows-2025
27
+ python:
28
+ - "3.10"
29
+ - "3.14"
30
+ # Test oldest and newest on all OS's, but others only on one
31
+ # to save CI load.
32
+ include:
33
+ - os: ubuntu-24.04
34
+ python: "3.11"
35
+ - os: ubuntu-24.04
36
+ python: "3.12"
37
+ - os: ubuntu-24.04
38
+ python: "3.13"
39
+ - os: ubuntu-24.04
40
+ python: "3.14t"
41
+ # Enable coverage on just one job
42
+ - os: ubuntu-24.04
43
+ python: "3.14"
44
+ coverage: "cov"
45
+
46
+ env:
47
+ # Avoid multiple compile e.g. in lint and test by setting as a job env var
48
+ RUSTFLAGS: "--cfg reqwest_unstable ${{ matrix.coverage == 'cov' && '-C instrument-coverage' || '' }}"
49
+
50
+ steps:
51
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
52
+
53
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
54
+ with:
55
+ python-version: ${{ matrix.python }}
56
+
57
+ - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
58
+
59
+ - name: Setup rust
60
+ run: |
61
+ rustup update
62
+ ${{ matrix.coverage == 'cov' && 'rustup component add llvm-tools' || '' }}
63
+
64
+ - run: uv lock --check
65
+
66
+ - run: uv sync --python ${{ matrix.python }}
67
+
68
+ # Go ahead and run lint on all Python versions since we may have version-specific
69
+ # guards in rust in the future.
70
+ - name: run lints
71
+ if: startsWith(matrix.os, 'ubuntu-')
72
+ run: uv run poe lint
73
+
74
+ - name: run tests
75
+ run: uv run poe test
76
+
77
+ - name: verify wheel build
78
+ run: uv run poe wheel
79
+
80
+ - name: prepare coverage
81
+ if: ${{ matrix.coverage == 'cov' }}
82
+ run: |
83
+ $(rustc --print=target-libdir)/../bin/llvm-profdata merge -sparse default_*.profraw -o tests.profdata
84
+ $(rustc --print=target-libdir)/../bin/llvm-cov export -format=lcov --ignore-filename-regex='/.cargo/registry' --ignore-filename-regex='.cargo/git/checkouts' --ignore-filename-regex='.rustup/toolchains' -instr-profile tests.profdata pyqwest/pyqwest.*.so > tests.lcov
85
+
86
+ - uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
87
+ if: ${{ matrix.coverage == 'cov' }}
@@ -0,0 +1,51 @@
1
+ name: Documentation
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ paths:
7
+ - "docs/**"
8
+ - "pyqwest/**"
9
+ - zensical.toml
10
+ - ".github/workflows/docs.yaml"
11
+ pull_request:
12
+ paths:
13
+ - "docs/**"
14
+ - "pyqwest/**"
15
+ - zensical.toml
16
+ - ".github/workflows/docs.yaml"
17
+
18
+ permissions:
19
+ contents: read
20
+ pages: write
21
+ id-token: write
22
+
23
+ jobs:
24
+ build:
25
+ environment:
26
+ name: ${{ github.event_name != 'pull_request' && 'github-pages' || null }}
27
+ url: ${{ steps.deployment.outputs.page_url }}
28
+
29
+ runs-on: ubuntu-24.04
30
+
31
+ steps:
32
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
33
+
34
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
35
+
36
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
37
+ with:
38
+ python-version: "3.14"
39
+
40
+ - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
41
+
42
+ - run: uv run --group docs --no-dev zensical build --clean
43
+
44
+ - uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
45
+ if: github.event_name != 'pull_request'
46
+ with:
47
+ path: site
48
+
49
+ - uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
50
+ if: github.event_name != 'pull_request'
51
+ id: deployment
@@ -0,0 +1,202 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "*"
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ linux:
14
+ runs-on: ${{ matrix.platform.runner }}
15
+ strategy:
16
+ matrix:
17
+ platform:
18
+ - runner: ubuntu-24.04
19
+ target: x86_64
20
+ - runner: ubuntu-24.04-arm
21
+ target: aarch64
22
+ steps:
23
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
24
+
25
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
26
+ with:
27
+ python-version: 3.x
28
+
29
+ - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
30
+
31
+ - name: Build wheels
32
+ uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
33
+ with:
34
+ target: ${{ matrix.platform.target }}
35
+ args: --release --out dist -i 3.10 -i 3.11 -i 3.12 -i 3.13 -i 3.14 -i 3.14t -i pypy3.11
36
+ sccache: true
37
+ manylinux: auto
38
+
39
+ - name: Upload wheels
40
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
41
+ with:
42
+ name: wheels-linux-${{ matrix.platform.target }}
43
+ path: dist
44
+
45
+ musllinux:
46
+ runs-on: ${{ matrix.platform.runner }}
47
+ strategy:
48
+ matrix:
49
+ platform:
50
+ - runner: ubuntu-24.04
51
+ target: x86_64
52
+ - runner: ubuntu-24.04-arm
53
+ target: aarch64
54
+ steps:
55
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
56
+
57
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
58
+ with:
59
+ python-version: 3.x
60
+
61
+ - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
62
+
63
+ - name: Build wheels
64
+ uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
65
+ with:
66
+ target: ${{ matrix.platform.target }}
67
+ args: --release --out dist -i 3.10 -i 3.11 -i 3.12 -i 3.13 -i 3.14 -i 3.14t -i pypy3.11
68
+ sccache: true
69
+ manylinux: musllinux_1_2
70
+
71
+ - name: Upload wheels
72
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
73
+ with:
74
+ name: wheels-musllinux-${{ matrix.platform.target }}
75
+ path: dist
76
+
77
+ windows:
78
+ runs-on: ${{ matrix.platform.runner }}
79
+ strategy:
80
+ matrix:
81
+ platform:
82
+ - runner: windows-2025
83
+ steps:
84
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
85
+
86
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
87
+ with:
88
+ python-version: |
89
+ 3.10
90
+ 3.11
91
+ 3.12
92
+ 3.13
93
+
94
+ # On Windows, maturin seems to have trouble automatically detecting Python not in
95
+ # the tool cache, so we set these up individually and pass the path directly.
96
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
97
+ id: python-314
98
+ with:
99
+ python-version: "3.14"
100
+
101
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
102
+ id: python-314t
103
+ with:
104
+ python-version: 3.14t
105
+
106
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
107
+ id: python-pypy311
108
+ with:
109
+ python-version: pypy3.11
110
+
111
+ - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
112
+
113
+ - name: Build wheels
114
+ uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
115
+ with:
116
+ args: --release --out dist -i 3.10 -i 3.11 -i 3.12 -i 3.13 -i ${{ steps.python-314.outputs.python-path }} -i ${{ steps.python-314t.outputs.python-path }} -i ${{ steps.python-pypy311.outputs.python-path }}
117
+ sccache: true
118
+
119
+ - name: Upload wheels
120
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
121
+ with:
122
+ name: wheels-windows-${{ matrix.platform.target }}
123
+ path: dist
124
+
125
+ macos:
126
+ runs-on: ${{ matrix.platform.runner }}
127
+ strategy:
128
+ matrix:
129
+ platform:
130
+ - runner: macos-15
131
+ target: aarch64
132
+ steps:
133
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
134
+
135
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
136
+ with:
137
+ python-version: |
138
+ 3.10
139
+ 3.11
140
+ 3.12
141
+ 3.13
142
+ 3.14
143
+ 3.14t
144
+ pypy3.11
145
+
146
+ - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
147
+
148
+ - name: Build wheels
149
+ uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
150
+ with:
151
+ target: ${{ matrix.platform.target }}
152
+ args: --release --out dist -i 3.10 -i 3.11 -i 3.12 -i 3.13 -i 3.14 -i 3.14t -i pypy3.11
153
+ sccache: true
154
+
155
+ - name: Upload wheels
156
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
157
+ with:
158
+ name: wheels-macos-${{ matrix.platform.target }}
159
+ path: dist
160
+
161
+ sdist:
162
+ runs-on: ubuntu-24.04
163
+ steps:
164
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
165
+
166
+ - name: Build sdist
167
+ uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
168
+ with:
169
+ command: sdist
170
+ args: --out dist
171
+
172
+ - name: Upload sdist
173
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
174
+ with:
175
+ name: wheels-sdist
176
+ path: dist
177
+
178
+ release:
179
+ name: Release
180
+ runs-on: ubuntu-24.04
181
+ if: ${{ github.event_name != 'pull_request' }}
182
+ environment: ${{ github.event_name == 'push' && 'prod' || 'dev' }}
183
+ needs:
184
+ - linux
185
+ - musllinux
186
+ - windows
187
+ - macos
188
+ - sdist
189
+ permissions:
190
+ id-token: write
191
+ contents: write
192
+ attestations: write
193
+ steps:
194
+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
195
+ with:
196
+ path: dist/
197
+ merge-multiple: true
198
+
199
+ - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
200
+ with:
201
+ repository-url: ${{ github.event_name != 'push' && 'https://test.pypi.org/legacy/' || null }}
202
+ skip-existing: ${{ github.event_name != 'push' }}
@@ -0,0 +1,22 @@
1
+ debug
2
+ target
3
+
4
+ __pycache__
5
+ .venv
6
+
7
+ .envrc
8
+ .idea
9
+ .vscode
10
+
11
+ *.profraw
12
+ *.profdata
13
+ *.lcov
14
+
15
+ profile.json.gz
16
+
17
+ dist
18
+ out
19
+ site
20
+ .DS_Store
21
+ *.so
22
+ *.pyd
@@ -0,0 +1,31 @@
1
+ This project follows the CurioSwitch code of conduct.
2
+
3
+ > [!WARNING]
4
+ > Any following content is overridden by the laws of CurioSwitch's residing country, Japan.
5
+ > For example, things like death threats will be dealt with strictly.
6
+
7
+ There is just one guideline: be fair. It is not possible to define fairness precisely
8
+ but consider these examples when thinking about it.
9
+
10
+ Fair:
11
+
12
+ - Respond promptly to submitted issues / PRs.
13
+ - Contributors spend time on submissions and it is not fair to not do the same in return.
14
+ - Aim for robust / tested code and systems.
15
+ - It is not fair to users to give them a tool that only half-works and causes them frustration.
16
+ - Acknowledge others' points, even if disagreeing, instead of ignoring.
17
+ - People engage in good faith, and it is not fair to leave it wasted.
18
+
19
+ Unfair:
20
+
21
+ - Keep issues about bugs or significant pain points open for a long time or suggest the contributor can raise a PR.
22
+ - Users are not maintainers and it is not fair to expect them to become one to fix a bug
23
+ (it is always welcome when they have the time and will to contribute though).
24
+ - Prioritize issues and discussions with friends, acquaintances, or those in the same timezone over others.
25
+ - This is OSS and it is not fair to create boundaries or factions within it.
26
+
27
+ We are not perfect and may act in a way that isn't fair. This is fine and generally will not
28
+ need punitive measures - we will aim to improve over time. But do accept feedback about it in
29
+ good faith and respond to it fairly. If you need to provide feedback related to the above in
30
+ a private matter, feel free to email oss@curioswitch.org and we will aim to help in a fair
31
+ manner.