@suss/adapter-python 0.32.0 → 0.33.1
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.
- package/README.md +6 -5
- package/dist/index.cjs +654 -224
- package/dist/index.d.cts +65 -1
- package/dist/index.d.ts +65 -1
- package/dist/index.js +652 -221
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -26,13 +26,14 @@ npx suss check --dir summaries/
|
|
|
26
26
|
- FastAPI and flask-restx routes, including a decorator a project re-exports through a wrapper module, with `response_model` and `status_code` taken as the declared contract.
|
|
27
27
|
- The path a route is served under, composed through `include_router` prefixes, however many mounts deep, including a mount written inside a function or spread out of a dictionary.
|
|
28
28
|
- SQLAlchemy calls, `requests` / `httpx` / `aiohttp` call sites, what a file reads from the environment, and what a handler calls out to, as facts the checker's rules run over.
|
|
29
|
-
-
|
|
29
|
+
- A statement the project wrote as SQL, whether it goes to a function the library exports, as SQLAlchemy's `text` does, or to a method on a client object the library handed the project. The statement reads through the value evaluator, so an f-string or a table name kept in another module's constant reads the same as one written out at the call.
|
|
30
|
+
- Environment reads written through a project helper: with `def env(key): return os.environ[key]`, a call to `env("DATABASE_URL")` is a read of `DATABASE_URL`, however many helpers the name is handed through on the way. The helper can be what a factory returned, as in `env = make_reader()`, and it can read through an environment object it was handed, as in `make_reader(os.environ)` giving back `lambda name: env[name]`. Not covered: a name built with an f-string (`env(f"{prefix}_URL")`), a name the helper takes off a dict, and a helper built by `functools.partial`.
|
|
30
31
|
|
|
31
32
|
How each of those is decided, and where it stops: [how the Python adapter reads a project](./DESIGN.md).
|
|
32
33
|
|
|
33
34
|
## Reading a value
|
|
34
35
|
|
|
35
|
-
Nothing outside the facility reads a node's text to find out what a value is. `values/evaluator.ts` is the evaluator: `evaluatedValue` runs the statements ahead of an expression and says what it comes to, and `stringValueOf` gives the string when it settles to one, so a path built out of an f-string or a module constant reads the same as one written out. `facts/resolve.ts` says where a name came from, with `writtenValueOf` and `originsOf`, and the literal readers in `ast.ts` (`stringLiteralValue`, `booleanLiteralValue`) are for the places a literal really is written out. When one of them cannot read a spelling, the case goes into the evaluator's lowering or the resolution rules; `npm run check:readers` at the repo root fails on a reader written beside a call site instead. [`docs
|
|
36
|
+
Nothing outside the facility reads a node's text to find out what a value is. `values/evaluator.ts` is the evaluator: `evaluatedValue` runs the statements ahead of an expression and says what it comes to, and `stringValueOf` gives the string when it settles to one, so a path built out of an f-string or a module constant reads the same as one written out. `facts/resolve.ts` says where a name came from, with `writtenValueOf` and `originsOf`, and the literal readers in `ast.ts` (`stringLiteralValue`, `booleanLiteralValue`) are for the places a literal really is written out. When one of them cannot read a spelling, the case goes into the evaluator's lowering or the resolution rules; `npm run check:readers` at the repo root fails on a reader written beside a call site instead. [`design/docs-internal/style.md#reading-a-value`](../../../design/docs-internal/style.md#reading-a-value) has the rule.
|
|
36
37
|
|
|
37
38
|
## Where it fits
|
|
38
39
|
|
|
@@ -42,9 +43,9 @@ It depends on `@suss/extractor`, `@suss/behavioral-ir`, `@suss/datalog` and `web
|
|
|
42
43
|
|
|
43
44
|
## More
|
|
44
45
|
|
|
45
|
-
- [Documentation](https://
|
|
46
|
-
- [Python and Ruby](https://
|
|
47
|
-
- [Every pack suss ships](https://
|
|
46
|
+
- [Documentation](https://suss.sh/)
|
|
47
|
+
- [Python and Ruby](https://suss.sh/guides/python-and-ruby)
|
|
48
|
+
- [Every pack suss ships](https://suss.sh/packs/catalog)
|
|
48
49
|
- [Source and issues](https://github.com/nimbuscloud-ai/suss)
|
|
49
50
|
|
|
50
51
|

|