hot-dev 1.1.2__tar.gz → 1.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.
- hot_dev-1.3.0/.github/dependabot.yml +10 -0
- hot_dev-1.3.0/.github/workflows/ci.yml +163 -0
- {hot_dev-1.1.2 → hot_dev-1.3.0}/.github/workflows/release.yml +4 -4
- hot_dev-1.3.0/AGENTS.md +80 -0
- {hot_dev-1.1.2 → hot_dev-1.3.0}/LICENSE +14 -2
- hot_dev-1.3.0/NOTICE +2 -0
- hot_dev-1.3.0/PKG-INFO +381 -0
- hot_dev-1.3.0/README.md +361 -0
- hot_dev-1.3.0/integration/VALIDATION.md +51 -0
- hot_dev-1.3.0/integration/fixture/.env.example +3 -0
- hot_dev-1.3.0/integration/fixture/.gitignore +5 -0
- hot_dev-1.3.0/integration/fixture/hot/src/fixture/sdk.hot +79 -0
- hot_dev-1.3.0/integration/fixture/hot.hot +22 -0
- hot_dev-1.3.0/integration/hot-server.ref +1 -0
- hot_dev-1.3.0/integration/run.sh +37 -0
- hot_dev-1.3.0/integration/suborg_fixture.py +473 -0
- {hot_dev-1.1.2 → hot_dev-1.3.0}/pyproject.toml +6 -5
- {hot_dev-1.1.2 → hot_dev-1.3.0}/src/hot/__init__.py +4 -1
- hot_dev-1.3.0/src/hot/_streaming.py +565 -0
- hot_dev-1.3.0/src/hot/_transport.py +277 -0
- {hot_dev-1.1.2 → hot_dev-1.3.0}/src/hot/client.py +24 -1
- hot_dev-1.3.0/src/hot/errors.py +156 -0
- hot_dev-1.3.0/src/hot/resources.py +2075 -0
- {hot_dev-1.1.2 → hot_dev-1.3.0}/tests/openapi_operations.json +58 -32
- {hot_dev-1.1.2 → hot_dev-1.3.0}/tests/test_client.py +90 -10
- hot_dev-1.3.0/tests/test_deadlines.py +228 -0
- hot_dev-1.3.0/tests/test_integration.py +174 -0
- {hot_dev-1.1.2 → hot_dev-1.3.0}/tests/test_openapi_coverage.py +34 -1
- hot_dev-1.3.0/tests/test_orgs.py +215 -0
- {hot_dev-1.1.2 → hot_dev-1.3.0}/tests/test_reconnect.py +19 -33
- hot_dev-1.3.0/tests/test_reconnect_policy.py +295 -0
- {hot_dev-1.1.2 → hot_dev-1.3.0}/tests/test_resources.py +60 -1
- hot_dev-1.3.0/tests/test_run_correlation.py +346 -0
- hot_dev-1.3.0/tests/test_runs.py +80 -0
- hot_dev-1.3.0/tests/test_suborg_integration.py +244 -0
- hot_dev-1.3.0/tests/test_tasks.py +79 -0
- hot_dev-1.3.0/tests/test_transport.py +132 -0
- hot_dev-1.1.2/.github/workflows/ci.yml +0 -42
- hot_dev-1.1.2/AGENTS.md +0 -43
- hot_dev-1.1.2/PKG-INFO +0 -212
- hot_dev-1.1.2/README.md +0 -193
- hot_dev-1.1.2/src/hot/_transport.py +0 -157
- hot_dev-1.1.2/src/hot/errors.py +0 -71
- hot_dev-1.1.2/src/hot/resources.py +0 -1154
- {hot_dev-1.1.2 → hot_dev-1.3.0}/.gitignore +0 -0
- {hot_dev-1.1.2 → hot_dev-1.3.0}/src/hot/py.typed +0 -0
- {hot_dev-1.1.2 → hot_dev-1.3.0}/src/hot/sse.py +0 -0
- {hot_dev-1.1.2 → hot_dev-1.3.0}/src/hot/types.py +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
# Weekly: run the org API isolation job against hot main, so drift in the
|
|
9
|
+
# API or its OpenAPI operations shows up before the pin is moved.
|
|
10
|
+
schedule:
|
|
11
|
+
- cron: "23 6 * * 1"
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
test:
|
|
18
|
+
name: Python ${{ matrix.python-version }}
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
strategy:
|
|
21
|
+
fail-fast: false
|
|
22
|
+
matrix:
|
|
23
|
+
python-version:
|
|
24
|
+
- "3.10"
|
|
25
|
+
- "3.11"
|
|
26
|
+
- "3.12"
|
|
27
|
+
- "3.13"
|
|
28
|
+
- "3.14"
|
|
29
|
+
- "3.15"
|
|
30
|
+
|
|
31
|
+
steps:
|
|
32
|
+
- name: Checkout
|
|
33
|
+
uses: actions/checkout@v7
|
|
34
|
+
|
|
35
|
+
- name: Set up Python
|
|
36
|
+
uses: actions/setup-python@v7
|
|
37
|
+
with:
|
|
38
|
+
python-version: ${{ matrix.python-version }}
|
|
39
|
+
allow-prereleases: true
|
|
40
|
+
cache: pip
|
|
41
|
+
|
|
42
|
+
- name: Install
|
|
43
|
+
run: python -m pip install -e ".[dev]"
|
|
44
|
+
|
|
45
|
+
- name: Lint
|
|
46
|
+
run: |
|
|
47
|
+
ruff check .
|
|
48
|
+
ruff format --check src tests
|
|
49
|
+
|
|
50
|
+
- name: Test
|
|
51
|
+
run: pytest
|
|
52
|
+
|
|
53
|
+
- name: Build
|
|
54
|
+
run: python -m build
|
|
55
|
+
|
|
56
|
+
integration:
|
|
57
|
+
name: Integration (hot dev)
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
steps:
|
|
60
|
+
- name: Checkout
|
|
61
|
+
uses: actions/checkout@v7
|
|
62
|
+
|
|
63
|
+
- name: Set up Python
|
|
64
|
+
uses: actions/setup-python@v7
|
|
65
|
+
with:
|
|
66
|
+
python-version: "3.13"
|
|
67
|
+
|
|
68
|
+
- name: Install package
|
|
69
|
+
run: |
|
|
70
|
+
python -m venv .venv
|
|
71
|
+
.venv/bin/python -m pip install -e ".[dev]"
|
|
72
|
+
|
|
73
|
+
- name: Install hot
|
|
74
|
+
uses: hot-dev/setup-hot@92cf9e03f49293fb31f28a56ed2c85a3424d90ad # v1
|
|
75
|
+
|
|
76
|
+
- name: Run integration tests
|
|
77
|
+
run: ./integration/run.sh
|
|
78
|
+
|
|
79
|
+
postgres-isolation:
|
|
80
|
+
name: Org API isolation (PostgreSQL)
|
|
81
|
+
runs-on: ubuntu-24.04
|
|
82
|
+
timeout-minutes: 60
|
|
83
|
+
permissions:
|
|
84
|
+
contents: read
|
|
85
|
+
env:
|
|
86
|
+
CARGO_INCREMENTAL: "0"
|
|
87
|
+
CARGO_PROFILE_DEV_DEBUG: line-tables-only
|
|
88
|
+
CARGO_NET_RETRY: "2"
|
|
89
|
+
SQLX_OFFLINE: "true"
|
|
90
|
+
steps:
|
|
91
|
+
- name: Checkout SDK
|
|
92
|
+
uses: actions/checkout@v7
|
|
93
|
+
|
|
94
|
+
# A released CLI may lag these API changes. Pin the tested server source
|
|
95
|
+
# separately so its schema, runtime qualification, and OpenAPI agree.
|
|
96
|
+
# The weekly scheduled run builds hot main instead, to catch drift.
|
|
97
|
+
- name: Checkout matching Hot server
|
|
98
|
+
uses: actions/checkout@v7
|
|
99
|
+
with:
|
|
100
|
+
repository: hot-dev/hot
|
|
101
|
+
ref: ${{ github.event_name == 'schedule' && 'main' || 'd7700112ada1f75211e3b6e66519e9388998f045' }} # Keep aligned with integration/hot-server.ref
|
|
102
|
+
path: .hot-server
|
|
103
|
+
persist-credentials: false
|
|
104
|
+
|
|
105
|
+
- name: Verify matching Hot revision
|
|
106
|
+
if: github.event_name != 'schedule'
|
|
107
|
+
shell: bash
|
|
108
|
+
run: |
|
|
109
|
+
expected="$(cat integration/hot-server.ref)"
|
|
110
|
+
actual="$(git -C .hot-server rev-parse HEAD)"
|
|
111
|
+
if [[ "$expected" != "$actual" ]]; then
|
|
112
|
+
echo "Hot checkout and integration/hot-server.ref must match" >&2
|
|
113
|
+
exit 1
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
- name: Set up Python for the fixture
|
|
117
|
+
uses: actions/setup-python@v7
|
|
118
|
+
with:
|
|
119
|
+
python-version: "3.13"
|
|
120
|
+
|
|
121
|
+
- name: Install build and PostgreSQL client dependencies
|
|
122
|
+
run: |
|
|
123
|
+
sudo apt-get update
|
|
124
|
+
sudo apt-get install -y build-essential pkg-config libssl-dev cmake clang lld postgresql-client
|
|
125
|
+
docker version
|
|
126
|
+
|
|
127
|
+
- name: Install server Rust toolchain
|
|
128
|
+
uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
|
|
129
|
+
with:
|
|
130
|
+
toolchain: "1.99.1"
|
|
131
|
+
|
|
132
|
+
- name: Cache matching server build
|
|
133
|
+
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
|
|
134
|
+
with:
|
|
135
|
+
workspaces: .hot-server -> target
|
|
136
|
+
key: postgres-isolation-${{ github.event_name == 'schedule' && 'main' || hashFiles('integration/hot-server.ref') }}
|
|
137
|
+
cache-workspace-crates: "true"
|
|
138
|
+
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
139
|
+
|
|
140
|
+
- name: Install Tailwind for the server build
|
|
141
|
+
shell: bash
|
|
142
|
+
run: |
|
|
143
|
+
mkdir -p "$RUNNER_TEMP/hot-sdk-bin"
|
|
144
|
+
curl -fsSL --retry 3 \
|
|
145
|
+
https://github.com/tailwindlabs/tailwindcss/releases/download/v4.3.0/tailwindcss-linux-x64 \
|
|
146
|
+
-o "$RUNNER_TEMP/hot-sdk-bin/tailwindcss"
|
|
147
|
+
chmod +x "$RUNNER_TEMP/hot-sdk-bin/tailwindcss"
|
|
148
|
+
echo "$RUNNER_TEMP/hot-sdk-bin" >> "$GITHUB_PATH"
|
|
149
|
+
|
|
150
|
+
- name: Build matching Hot CLI
|
|
151
|
+
working-directory: .hot-server
|
|
152
|
+
run: cargo build --locked --package hot_cli --jobs 4
|
|
153
|
+
|
|
154
|
+
- name: Install Python SDK dependencies
|
|
155
|
+
run: python -m pip install -e ".[dev]"
|
|
156
|
+
|
|
157
|
+
- name: Test org API isolation with restricted runtime credentials
|
|
158
|
+
run: |
|
|
159
|
+
python3 integration/suborg_fixture.py \
|
|
160
|
+
--backend postgres \
|
|
161
|
+
--hot .hot-server/target/debug/hot \
|
|
162
|
+
--hot-repo .hot-server \
|
|
163
|
+
-- python -m pytest tests/test_suborg_integration.py -v
|
|
@@ -19,19 +19,19 @@ jobs:
|
|
|
19
19
|
|
|
20
20
|
steps:
|
|
21
21
|
- name: Checkout
|
|
22
|
-
uses: actions/checkout@
|
|
22
|
+
uses: actions/checkout@v7
|
|
23
23
|
|
|
24
24
|
- name: Set up Python
|
|
25
|
-
uses: actions/setup-python@
|
|
25
|
+
uses: actions/setup-python@v7
|
|
26
26
|
with:
|
|
27
27
|
python-version: "3.13"
|
|
28
28
|
cache: pip
|
|
29
29
|
|
|
30
30
|
- name: Install build tools
|
|
31
|
-
run: python -m pip install build
|
|
31
|
+
run: python -m pip install build==1.6.1
|
|
32
32
|
|
|
33
33
|
- name: Build
|
|
34
34
|
run: python -m build
|
|
35
35
|
|
|
36
36
|
- name: Publish
|
|
37
|
-
uses: pypa/gh-action-pypi-publish@release/v1
|
|
37
|
+
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1
|
hot_dev-1.3.0/AGENTS.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# AGENTS.md - hot-python
|
|
2
|
+
|
|
3
|
+
This repo contains the Python SDK for the Hot Dev API.
|
|
4
|
+
|
|
5
|
+
## Package Shape
|
|
6
|
+
|
|
7
|
+
- PyPI distribution name: `hot-dev`
|
|
8
|
+
- Python import package: `hot`
|
|
9
|
+
- Source layout: `src/hot/`, with `py.typed` marker
|
|
10
|
+
- Runtime dependency: `httpx`
|
|
11
|
+
- Versioning follows the public API package version, starting at `1.0.0`.
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
python -m pip install -e ".[dev]"
|
|
17
|
+
ruff check .
|
|
18
|
+
ruff format --check src tests
|
|
19
|
+
pytest
|
|
20
|
+
python -m build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## CI and Releases
|
|
24
|
+
|
|
25
|
+
- CI runs on pushes and pull requests to `main`: install, lint (`ruff check`,
|
|
26
|
+
`ruff format --check`), test (`pytest`), and build (`python -m build`) on
|
|
27
|
+
Python 3.10–3.15. Dev tools are pinned in `pyproject.toml`; Dependabot bumps
|
|
28
|
+
them and the Actions weekly.
|
|
29
|
+
- The "Org API isolation (PostgreSQL)" job builds the hot revision in
|
|
30
|
+
`integration/hot-server.ref` (keep the CI checkout `ref:` identical) and runs
|
|
31
|
+
`integration/suborg_fixture.py` against restricted PostgreSQL roles. A weekly
|
|
32
|
+
scheduled run builds hot `main` instead, to catch API drift.
|
|
33
|
+
- PyPI releases run from tags named `v<version>` matching the
|
|
34
|
+
`pyproject.toml` version.
|
|
35
|
+
- Publishing uses PyPI Trusted Publishing via OIDC against the `pypi` GitHub
|
|
36
|
+
Actions environment — no PyPI token secret is required, but the project
|
|
37
|
+
publisher must be configured on PyPI before the first tag push.
|
|
38
|
+
|
|
39
|
+
Release flow:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Bump the version in pyproject.toml.
|
|
43
|
+
git add pyproject.toml
|
|
44
|
+
git commit -m "release v<version>"
|
|
45
|
+
git tag v<version>
|
|
46
|
+
git push origin main v<version>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Always update the SDK version in lockstep with new API surface area added to
|
|
50
|
+
the matching `@hot-dev/sdk` JavaScript release when possible.
|
|
51
|
+
|
|
52
|
+
## Integration Tests
|
|
53
|
+
|
|
54
|
+
`integration/run.sh` starts a scratch `hot dev` (requires the `hot` CLI and
|
|
55
|
+
python3 on PATH) serving the Hot fixture project in `integration/fixture`
|
|
56
|
+
(project `sdk-fixture`: an echo event handler, an always-failing handler and
|
|
57
|
+
function, and hot:call targets). It binds 127.0.0.1 on HOT_TEST_PORT (default
|
|
58
|
+
4725), mints a full-access API key with `hot key create`,
|
|
59
|
+
exports HOT_TEST_BASE_URL / HOT_TEST_API_KEY, and runs `pytest tests/test_integration.py`.
|
|
60
|
+
The integration tests skip when HOT_TEST_API_KEY is unset, so regular test
|
|
61
|
+
runs are unaffected. The fixture pins the API to 127.0.0.1 because binding
|
|
62
|
+
"localhost" can yield an IPv6-only listener that JDK-style clients (which
|
|
63
|
+
dial the first resolved address only) cannot reach.
|
|
64
|
+
|
|
65
|
+
## Lockstep Releases
|
|
66
|
+
|
|
67
|
+
All five SDK repos (hot-js, hot-python, hot-go, hot-rust, hot-java) release in
|
|
68
|
+
lockstep. Checklist for a coordinated release:
|
|
69
|
+
|
|
70
|
+
1. Bump every SDK's version: js `npm version` (syncs src/version.ts via the
|
|
71
|
+
`version` script), python pyproject.toml, rust Cargo.toml, java
|
|
72
|
+
gradle.properties + README snippets, go `Version` constant in client.go.
|
|
73
|
+
2. Regenerate each repo's openapi-operations fixture from a current `hot dev`
|
|
74
|
+
and reconcile the coverage tables.
|
|
75
|
+
3. Run every repo's `integration/run.sh`.
|
|
76
|
+
4. Commit, tag `v<version>`, push in each repo.
|
|
77
|
+
|
|
78
|
+
The integration fixture (integration/fixture, run.sh) is
|
|
79
|
+
duplicated across all five repos; the canonical copy lives in **hot-python** —
|
|
80
|
+
change it there first, then sync the others.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
Apache License
|
|
2
3
|
Version 2.0, January 2004
|
|
3
4
|
http://www.apache.org/licenses/
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
"Contribution" shall mean any work of authorship, including
|
|
49
50
|
the original version of the Work and any modifications or additions
|
|
50
51
|
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
53
|
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
54
|
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
55
|
means any form of electronic, verbal, or written communication sent
|
|
@@ -175,7 +176,18 @@
|
|
|
175
176
|
|
|
176
177
|
END OF TERMS AND CONDITIONS
|
|
177
178
|
|
|
178
|
-
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
179
191
|
|
|
180
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
193
|
you may not use this file except in compliance with the License.
|
hot_dev-1.3.0/NOTICE
ADDED