Compare commits

...

No commits in common. "a0c9b03015058911c5cddedf66083eed963963dd" and "99059a0c71b27aab977ef70e3eb5496f6393e90e" have entirely different histories.

2 changed files with 6 additions and 16 deletions

View File

@ -16,15 +16,13 @@ TLSSession(backend=MyBackend(...)) # or one you write — see "Writing your ow
## Install ## Install
Depends on `aioweb`. The TLS clients are **optional extras** — install the backend(s) Depends on `aioweb`. The TLS clients are **optional extras** — install the backend you
you want; importing the package never fails because an extra is missing. want; importing the package never fails because an extra is missing.
`requirements.txt` (pick the extra you need): `requirements.txt`:
``` ```
aioweb_tls[curl] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0 aioweb_tls[curl] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0
aioweb_tls[noble] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0
aioweb_tls[all] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0
``` ```
Direct: Direct:
@ -32,17 +30,10 @@ Direct:
```bash ```bash
pip install "aioweb_tls[curl] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0" pip install "aioweb_tls[curl] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0"
pip install "aioweb_tls[noble] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0" pip install "aioweb_tls[noble] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0"
pip install "aioweb_tls[all] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0"
``` ```
- `[curl]` → curl_cffi backend · `[noble]` → noble_tls backend · `[all]` → both. Constructing a backend whose client isn't installed raises a clear `RuntimeError`
- **No extra** (`pip install aioweb_tls`) is also valid: you get `TLSSession` and the naming the extra — the error fires at construction, never at import.
`TLSBackend` protocol — the framework and the bring-your-own-backend path — but no
bundled client. `CurlCffi()` / `Noble()` then raise a clear `RuntimeError` naming the
extra to install. Use a bare install when you only need a custom backend of your own.
Constructing a backend whose client isn't installed raises that `RuntimeError` at
construction, never at import.
## curl_cffi backend ## curl_cffi backend

View File

@ -14,7 +14,6 @@ dependencies = [
[project.optional-dependencies] [project.optional-dependencies]
curl = ["curl_cffi>=0.15"] curl = ["curl_cffi>=0.15"]
noble = ["noble-tls>=0.1.5"] noble = ["noble-tls>=0.1.5"]
all = ["curl_cffi>=0.15", "noble-tls>=0.1.5"]
[tool.hatch.build.targets.wheel] [tool.hatch.build.targets.wheel]
packages = ["src/aioweb_tls"] packages = ["src/aioweb_tls"]