uncoded 2.1.0__tar.gz → 2.1.1__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.
- {uncoded-2.1.0 → uncoded-2.1.1}/.github/workflows/ci.yml +2 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.pre-commit-config.yaml +13 -8
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/docs.yaml +7 -3
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/namespace.yaml +23 -4
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/__init__.pyi +1 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/ast_helpers.pyi +1 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/body.pyi +1 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/cli.pyi +12 -1
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/config.pyi +2 -1
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/docs_map.pyi +4 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/extract.pyi +4 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/markers.pyi +1 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/namespace_map.pyi +1 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/read_helpers.pyi +1 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/refs.pyi +2 -1
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/resolver.pyi +3 -2
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/skill.pyi +1 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/stubs.pyi +14 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/sync.pyi +1 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/src/uncoded/yaml_tree.pyi +2 -1
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/tests/test_body.pyi +3 -2
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/tests/test_cli.pyi +1 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/tests/test_config.pyi +2 -1
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/tests/test_docs_map.pyi +4 -0
- uncoded-2.1.1/.uncoded/stubs/tests/test_encoding_gate.pyi +8 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/tests/test_extract.pyi +1 -0
- uncoded-2.1.1/.uncoded/stubs/tests/test_markers.pyi +21 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/tests/test_namespace_map.pyi +1 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/tests/test_refs.pyi +1 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/tests/test_skill.pyi +1 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/tests/test_stubs.pyi +5 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/tests/test_sync.pyi +1 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.uncoded/stubs/tests/test_uncoded.pyi +1 -0
- uncoded-2.1.1/AGENTS.md +191 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/PKG-INFO +5 -66
- {uncoded-2.1.0 → uncoded-2.1.1}/README.md +2 -65
- uncoded-2.1.1/pyproject.toml +117 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/body.py +1 -1
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/cli.py +140 -100
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/config.py +9 -8
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/docs_map.py +25 -23
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/extract.py +23 -20
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/namespace_map.py +1 -1
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/read_helpers.py +3 -1
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/refs.py +11 -10
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/resolver.py +10 -10
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/skill.py +1 -1
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/stubs.py +73 -81
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/yaml_tree.py +1 -1
- {uncoded-2.1.0 → uncoded-2.1.1}/tests/test_body.py +44 -44
- {uncoded-2.1.0 → uncoded-2.1.1}/tests/test_cli.py +152 -80
- {uncoded-2.1.0 → uncoded-2.1.1}/tests/test_config.py +39 -36
- {uncoded-2.1.0 → uncoded-2.1.1}/tests/test_docs_map.py +9 -0
- uncoded-2.1.1/tests/test_encoding_gate.py +25 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/tests/test_extract.py +17 -14
- uncoded-2.1.1/tests/test_markers.py +21 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/tests/test_refs.py +45 -28
- {uncoded-2.1.0 → uncoded-2.1.1}/tests/test_skill.py +6 -6
- {uncoded-2.1.0 → uncoded-2.1.1}/tests/test_stubs.py +54 -30
- {uncoded-2.1.0 → uncoded-2.1.1}/tests/test_sync.py +12 -12
- {uncoded-2.1.0 → uncoded-2.1.1}/uv.lock +54 -0
- uncoded-2.1.0/AGENTS.md +0 -80
- uncoded-2.1.0/pyproject.toml +0 -82
- {uncoded-2.1.0 → uncoded-2.1.1}/.agents/skills/uncoded-code-navigation/SKILL.md +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.agents/skills/uncoded-coherence-review/SKILL.md +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.agents/skills/uncoded-doc-navigation/SKILL.md +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.claude/skills/uncoded-code-navigation/SKILL.md +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.claude/skills/uncoded-coherence-review/SKILL.md +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.claude/skills/uncoded-doc-navigation/SKILL.md +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.github/workflows/publish.yml +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.gitignore +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.markdownlint-cli2.yaml +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/.prettierrc +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/CLAUDE.md +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/LICENSE +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/__init__.py +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/ast_helpers.py +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/code_navigation.md +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/coherence_review.md +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/doc_navigation.md +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/markers.py +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/src/uncoded/sync.py +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/tests/__init__.py +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/tests/test_namespace_map.py +0 -0
- {uncoded-2.1.0 → uncoded-2.1.1}/tests/test_uncoded.py +0 -0
|
@@ -13,18 +13,23 @@ repos:
|
|
|
13
13
|
- id: check-toml
|
|
14
14
|
- id: check-added-large-files
|
|
15
15
|
|
|
16
|
-
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
17
|
-
rev: v0.15.10
|
|
18
|
-
hooks:
|
|
19
|
-
- id: ruff
|
|
20
|
-
args: [--fix]
|
|
21
|
-
- id: ruff-format
|
|
22
|
-
|
|
23
16
|
- repo: local
|
|
24
17
|
hooks:
|
|
18
|
+
- id: ruff-check
|
|
19
|
+
name: ruff check
|
|
20
|
+
entry: uv run ruff check --fix --exit-non-zero-on-fix --show-fixes
|
|
21
|
+
language: system
|
|
22
|
+
types_or: [python, pyi]
|
|
23
|
+
pass_filenames: false
|
|
24
|
+
- id: ruff-format
|
|
25
|
+
name: ruff format
|
|
26
|
+
entry: uv run ruff format
|
|
27
|
+
language: system
|
|
28
|
+
types_or: [python, pyi]
|
|
29
|
+
pass_filenames: false
|
|
25
30
|
- id: ty
|
|
26
31
|
name: ty
|
|
27
|
-
entry:
|
|
32
|
+
entry: uv run ty check src tests
|
|
28
33
|
language: system
|
|
29
34
|
pass_filenames: false
|
|
30
35
|
# Runs before uncoded so the generated skill files are built from
|
|
@@ -19,14 +19,18 @@ README.md:
|
|
|
19
19
|
Find references to a symbol:
|
|
20
20
|
How agents use it:
|
|
21
21
|
Coherence review:
|
|
22
|
-
Dev setup:
|
|
23
|
-
Note for Windows contributors:
|
|
24
22
|
Upgrading from v1:
|
|
25
|
-
|
|
23
|
+
Contributing:
|
|
26
24
|
AGENTS.md:
|
|
27
25
|
uncoded:
|
|
28
26
|
Problem:
|
|
29
27
|
Approach:
|
|
30
28
|
Commands:
|
|
29
|
+
Dev setup:
|
|
30
|
+
Windows:
|
|
31
|
+
Linting and formatting:
|
|
31
32
|
Docstrings:
|
|
33
|
+
Testing:
|
|
34
|
+
Conventions:
|
|
35
|
+
Releasing:
|
|
32
36
|
Before you start:
|
|
@@ -18,8 +18,11 @@ src/:
|
|
|
18
18
|
resolve_body:
|
|
19
19
|
_extract_body:
|
|
20
20
|
cli.py:
|
|
21
|
+
_validate_root:
|
|
21
22
|
_sync_code_artefacts:
|
|
23
|
+
_sync_doc_artefacts:
|
|
22
24
|
_sync:
|
|
25
|
+
_report_lookup_error:
|
|
23
26
|
_body:
|
|
24
27
|
_refs:
|
|
25
28
|
main:
|
|
@@ -35,6 +38,7 @@ src/:
|
|
|
35
38
|
read_config:
|
|
36
39
|
docs_map.py:
|
|
37
40
|
DOCS_HEADER:
|
|
41
|
+
_parse_atx_heading:
|
|
38
42
|
extract_headings:
|
|
39
43
|
_unique_key:
|
|
40
44
|
_collapse_empty:
|
|
@@ -51,6 +55,7 @@ src/:
|
|
|
51
55
|
constants:
|
|
52
56
|
classes:
|
|
53
57
|
functions:
|
|
58
|
+
_extract_class_members:
|
|
54
59
|
extract_module:
|
|
55
60
|
iter_source_files:
|
|
56
61
|
extract_modules:
|
|
@@ -90,8 +95,8 @@ src/:
|
|
|
90
95
|
tail:
|
|
91
96
|
parse:
|
|
92
97
|
__str__:
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
SymbolNotFoundError:
|
|
99
|
+
UnsupportedNamePathError:
|
|
95
100
|
resolve_ast_node:
|
|
96
101
|
resolve_name_position:
|
|
97
102
|
resolve_ast_node_from_source:
|
|
@@ -146,8 +151,12 @@ src/:
|
|
|
146
151
|
_render_function:
|
|
147
152
|
_format_assignment_body:
|
|
148
153
|
_render_assignment:
|
|
154
|
+
_render_class:
|
|
149
155
|
render_stub:
|
|
150
156
|
_generate_stubs:
|
|
157
|
+
_resolve_stubs_root:
|
|
158
|
+
_remove_orphan_stubs:
|
|
159
|
+
_prune_empty_stub_dirs:
|
|
151
160
|
_write_stubs:
|
|
152
161
|
remove_all_stubs:
|
|
153
162
|
build_stubs:
|
|
@@ -184,7 +193,7 @@ tests/:
|
|
|
184
193
|
test_shadowed_class_member_found_in_last_definition:
|
|
185
194
|
test_shadowed_class_member_not_found_in_last_definition:
|
|
186
195
|
test_not_found_in_class:
|
|
187
|
-
|
|
196
|
+
TestUnsupportedNamePathError:
|
|
188
197
|
SUPPORTED_SHAPES:
|
|
189
198
|
_assert_raises:
|
|
190
199
|
test_three_segment_path:
|
|
@@ -292,7 +301,7 @@ tests/:
|
|
|
292
301
|
test_finds_in_parent_of_start:
|
|
293
302
|
test_returns_none_if_not_found:
|
|
294
303
|
TestReadConfig:
|
|
295
|
-
|
|
304
|
+
test_raises_when_no_config_file:
|
|
296
305
|
test_source_roots_read_from_pyproject:
|
|
297
306
|
test_doc_roots_read_from_pyproject:
|
|
298
307
|
test_both_roots_empty_when_section_absent:
|
|
@@ -342,6 +351,7 @@ tests/:
|
|
|
342
351
|
test_rel_path_is_relative_to_project_root:
|
|
343
352
|
test_skips_non_utf8_file_with_warning:
|
|
344
353
|
test_single_file_root_unreadable_yields_nothing:
|
|
354
|
+
test_bom_prefixed_file_heading_appears:
|
|
345
355
|
TestBuildDocsMap:
|
|
346
356
|
test_empty_files:
|
|
347
357
|
test_headingless_file_maps_to_null:
|
|
@@ -359,6 +369,8 @@ tests/:
|
|
|
359
369
|
test_header_present:
|
|
360
370
|
test_yaml_parseable:
|
|
361
371
|
test_null_renders_clean:
|
|
372
|
+
test_encoding_gate.py:
|
|
373
|
+
test_encoding_warning_gate:
|
|
362
374
|
test_extract.py:
|
|
363
375
|
TestExtractModuleFromSource:
|
|
364
376
|
test_classes_and_functions:
|
|
@@ -389,6 +401,12 @@ tests/:
|
|
|
389
401
|
test_preserves_source_order:
|
|
390
402
|
test_module_with_only_constants_is_kept:
|
|
391
403
|
test_skips_files_with_no_symbols:
|
|
404
|
+
test_markers.py:
|
|
405
|
+
TestMarkerCompleteness:
|
|
406
|
+
test_namespace_map_carries_marker:
|
|
407
|
+
test_docs_map_carries_marker:
|
|
408
|
+
test_stub_carries_marker:
|
|
409
|
+
test_skill_carries_marker:
|
|
392
410
|
test_namespace_map.py:
|
|
393
411
|
TestBuildMap:
|
|
394
412
|
test_single_file:
|
|
@@ -548,6 +566,7 @@ tests/:
|
|
|
548
566
|
test_check_mode_reports_without_removing:
|
|
549
567
|
test_check_mode_noop_when_absent:
|
|
550
568
|
test_returns_count_of_pyi_files:
|
|
569
|
+
test_stray_non_pyi_file_not_removed:
|
|
551
570
|
_setup:
|
|
552
571
|
_build:
|
|
553
572
|
test_sync.py:
|
|
@@ -1,25 +1,36 @@
|
|
|
1
|
+
# Generated by uncoded — do not edit; regeneration overwrites.
|
|
1
2
|
# src/uncoded/cli.py
|
|
2
3
|
|
|
3
4
|
import argparse
|
|
4
5
|
import sys
|
|
5
6
|
from pathlib import Path
|
|
7
|
+
from typing import Literal
|
|
6
8
|
from uncoded.body import resolve_body
|
|
7
9
|
from uncoded.config import ConfigError, read_config
|
|
8
10
|
from uncoded.docs_map import build_docs_map, iter_doc_files, render_docs_map
|
|
9
11
|
from uncoded.extract import extract_modules, iter_source_files
|
|
10
12
|
from uncoded.namespace_map import build_map, render_map
|
|
11
13
|
from uncoded.refs import find_refs
|
|
12
|
-
from uncoded.resolver import NamePath,
|
|
14
|
+
from uncoded.resolver import NamePath, SymbolNotFoundError, UnsupportedNamePathError
|
|
13
15
|
from uncoded.skill import sync_skills
|
|
14
16
|
from uncoded.stubs import build_stubs, remove_all_stubs
|
|
15
17
|
from uncoded.sync import remove_file, sync_file
|
|
16
18
|
|
|
19
|
+
def _validate_root(configured: Path, *, kind: Literal['source', 'doc'], project_root: Path, resolved_project_root: Path, accepts_md_file: bool) -> Path:
|
|
20
|
+
...
|
|
21
|
+
|
|
17
22
|
def _sync_code_artefacts(*, build: bool, configured_source_roots: list[Path], project_root: Path, resolved_project_root: Path, check: bool) -> int:
|
|
18
23
|
...
|
|
19
24
|
|
|
25
|
+
def _sync_doc_artefacts(*, build: bool, configured_doc_roots: list[Path], project_root: Path, resolved_project_root: Path, check: bool) -> int:
|
|
26
|
+
...
|
|
27
|
+
|
|
20
28
|
def _sync(*, start: Path | None, check: bool) -> int:
|
|
21
29
|
...
|
|
22
30
|
|
|
31
|
+
def _report_lookup_error(exc: Exception, *, name_path: str, in_path: str) -> int:
|
|
32
|
+
...
|
|
33
|
+
|
|
23
34
|
def _body(*, name_path: str, in_path: str) -> int:
|
|
24
35
|
...
|
|
25
36
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# Generated by uncoded — do not edit; regeneration overwrites.
|
|
1
2
|
# src/uncoded/config.py
|
|
2
3
|
|
|
3
4
|
import tomllib
|
|
@@ -13,7 +14,7 @@ def _has_uncoded_section(*, pyproject_path: Path) -> bool:
|
|
|
13
14
|
def _find_config_file(*, start: Path) -> Path | None:
|
|
14
15
|
...
|
|
15
16
|
|
|
16
|
-
def read_config(start: Path) -> Config
|
|
17
|
+
def read_config(start: Path) -> Config:
|
|
17
18
|
...
|
|
18
19
|
|
|
19
20
|
class ConfigError(Exception):
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# Generated by uncoded — do not edit; regeneration overwrites.
|
|
1
2
|
# src/uncoded/docs_map.py
|
|
2
3
|
|
|
3
4
|
from collections.abc import Iterable, Iterator
|
|
@@ -8,6 +9,9 @@ from uncoded.yaml_tree import render_yaml_tree
|
|
|
8
9
|
|
|
9
10
|
DOCS_HEADER = ...
|
|
10
11
|
|
|
12
|
+
def _parse_atx_heading(line: str) -> tuple[int, str] | None:
|
|
13
|
+
...
|
|
14
|
+
|
|
11
15
|
def extract_headings(text: str) -> list[tuple[int, str]]:
|
|
12
16
|
...
|
|
13
17
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# Generated by uncoded — do not edit; regeneration overwrites.
|
|
1
2
|
# src/uncoded/extract.py
|
|
2
3
|
|
|
3
4
|
import ast
|
|
@@ -8,6 +9,9 @@ from pathlib import Path
|
|
|
8
9
|
from uncoded.ast_helpers import assign_target_name, property_kind
|
|
9
10
|
from uncoded.read_helpers import read_source_text_or_warn
|
|
10
11
|
|
|
12
|
+
def _extract_class_members(node: ast.ClassDef) -> ClassInfo:
|
|
13
|
+
...
|
|
14
|
+
|
|
11
15
|
def extract_module(source: str, rel_path: str) -> ModuleInfo:
|
|
12
16
|
...
|
|
13
17
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# Generated by uncoded — do not edit; regeneration overwrites.
|
|
1
2
|
# src/uncoded/refs.py
|
|
2
3
|
|
|
3
4
|
from __future__ import annotations
|
|
@@ -12,7 +13,7 @@ from uncoded.config import find_pyproject_toml
|
|
|
12
13
|
from uncoded.read_helpers import read_source_text
|
|
13
14
|
from uncoded.resolver import NamePath, resolve_name_position
|
|
14
15
|
|
|
15
|
-
TY_VERSION = '0.0.
|
|
16
|
+
TY_VERSION = '0.0.53'
|
|
16
17
|
|
|
17
18
|
def find_refs(name_path: NamePath, in_path: Path) -> list[Reference]:
|
|
18
19
|
...
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# Generated by uncoded — do not edit; regeneration overwrites.
|
|
1
2
|
# src/uncoded/resolver.py
|
|
2
3
|
|
|
3
4
|
import ast
|
|
@@ -28,8 +29,8 @@ class NamePath(NamedTuple):
|
|
|
28
29
|
def __str__(self) -> str:
|
|
29
30
|
...
|
|
30
31
|
|
|
31
|
-
class
|
|
32
|
+
class SymbolNotFoundError(Exception):
|
|
32
33
|
...
|
|
33
34
|
|
|
34
|
-
class
|
|
35
|
+
class UnsupportedNamePathError(Exception):
|
|
35
36
|
...
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# Generated by uncoded — do not edit; regeneration overwrites.
|
|
1
2
|
# src/uncoded/stubs.py
|
|
2
3
|
|
|
3
4
|
import ast
|
|
@@ -5,6 +6,7 @@ from collections.abc import Iterable
|
|
|
5
6
|
from dataclasses import dataclass, field
|
|
6
7
|
from pathlib import Path
|
|
7
8
|
from uncoded.ast_helpers import property_kind
|
|
9
|
+
from uncoded.markers import GENERATED_MARKER
|
|
8
10
|
from uncoded.sync import remove_file, sync_file
|
|
9
11
|
|
|
10
12
|
VALUE_WIDTH_CAP = 80
|
|
@@ -42,12 +44,24 @@ def _format_assignment_body(a: StubAssignment) -> str:
|
|
|
42
44
|
def _render_assignment(a: StubAssignment, indent: str) -> str:
|
|
43
45
|
...
|
|
44
46
|
|
|
47
|
+
def _render_class(cls: StubClass) -> list[str]:
|
|
48
|
+
...
|
|
49
|
+
|
|
45
50
|
def render_stub(module: StubModule) -> str:
|
|
46
51
|
...
|
|
47
52
|
|
|
48
53
|
def _generate_stubs(files: Iterable[tuple[str, str]]) -> dict[Path, str]:
|
|
49
54
|
...
|
|
50
55
|
|
|
56
|
+
def _resolve_stubs_root(*, source_root: Path, output_dir: Path, project_root: Path) -> Path | None:
|
|
57
|
+
...
|
|
58
|
+
|
|
59
|
+
def _remove_orphan_stubs(*, expected: set[Path], abs_stubs_root: Path, project_root: Path, check: bool) -> int:
|
|
60
|
+
...
|
|
61
|
+
|
|
62
|
+
def _prune_empty_stub_dirs(*, abs_stubs_root: Path) -> None:
|
|
63
|
+
...
|
|
64
|
+
|
|
51
65
|
def _write_stubs(*, stubs: dict[Path, str], source_root: Path, output_dir: Path, project_root: Path, check: bool) -> int:
|
|
52
66
|
...
|
|
53
67
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# Generated by uncoded — do not edit; regeneration overwrites.
|
|
1
2
|
# src/uncoded/yaml_tree.py
|
|
2
3
|
|
|
3
4
|
import yaml
|
|
@@ -6,5 +7,5 @@ def render_yaml_tree(header: str, mapping: dict) -> str:
|
|
|
6
7
|
...
|
|
7
8
|
|
|
8
9
|
class _CleanDumper(yaml.SafeDumper):
|
|
9
|
-
def increase_indent(self, flow, indentless):
|
|
10
|
+
def increase_indent(self, flow: bool, indentless: bool) -> None:
|
|
10
11
|
...
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# Generated by uncoded — do not edit; regeneration overwrites.
|
|
1
2
|
# tests/test_body.py
|
|
2
3
|
|
|
3
4
|
import ast
|
|
@@ -5,7 +6,7 @@ import textwrap
|
|
|
5
6
|
from unittest import mock
|
|
6
7
|
import pytest
|
|
7
8
|
from uncoded.body import resolve_body
|
|
8
|
-
from uncoded.resolver import NamePath,
|
|
9
|
+
from uncoded.resolver import NamePath, SymbolNotFoundError, UnsupportedNamePathError, resolve_ast_node, resolve_name_position
|
|
9
10
|
|
|
10
11
|
class TestResolveBodyTopLevel:
|
|
11
12
|
def test_function_without_decorators(self, tmp_path):
|
|
@@ -75,7 +76,7 @@ class TestResolveBodyClassMember:
|
|
|
75
76
|
def test_not_found_in_class(self, tmp_path):
|
|
76
77
|
...
|
|
77
78
|
|
|
78
|
-
class
|
|
79
|
+
class TestUnsupportedNamePathError:
|
|
79
80
|
SUPPORTED_SHAPES = ("'name'", "'Class/member'")
|
|
80
81
|
|
|
81
82
|
def _assert_raises(self, name_path):
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# Generated by uncoded — do not edit; regeneration overwrites.
|
|
1
2
|
# tests/test_config.py
|
|
2
3
|
|
|
3
4
|
from pathlib import Path
|
|
@@ -15,7 +16,7 @@ class TestFindPyprojectToml:
|
|
|
15
16
|
...
|
|
16
17
|
|
|
17
18
|
class TestReadConfig:
|
|
18
|
-
def
|
|
19
|
+
def test_raises_when_no_config_file(self, tmp_path):
|
|
19
20
|
...
|
|
20
21
|
|
|
21
22
|
def test_source_roots_read_from_pyproject(self, tmp_path):
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# Generated by uncoded — do not edit; regeneration overwrites.
|
|
1
2
|
# tests/test_docs_map.py
|
|
2
3
|
|
|
3
4
|
from pathlib import Path
|
|
@@ -102,6 +103,9 @@ class TestIterDocFiles:
|
|
|
102
103
|
def test_single_file_root_unreadable_yields_nothing(self, tmp_path, capsys):
|
|
103
104
|
...
|
|
104
105
|
|
|
106
|
+
def test_bom_prefixed_file_heading_appears(self, tmp_path):
|
|
107
|
+
...
|
|
108
|
+
|
|
105
109
|
class TestBuildDocsMap:
|
|
106
110
|
def test_empty_files(self):
|
|
107
111
|
...
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Generated by uncoded — do not edit; regeneration overwrites.
|
|
2
|
+
# tests/test_markers.py
|
|
3
|
+
|
|
4
|
+
from uncoded.docs_map import render_docs_map
|
|
5
|
+
from uncoded.markers import GENERATED_MARKER
|
|
6
|
+
from uncoded.namespace_map import render_map
|
|
7
|
+
from uncoded.skill import SKILLS, _render_content
|
|
8
|
+
from uncoded.stubs import StubModule, render_stub
|
|
9
|
+
|
|
10
|
+
class TestMarkerCompleteness:
|
|
11
|
+
def test_namespace_map_carries_marker(self):
|
|
12
|
+
...
|
|
13
|
+
|
|
14
|
+
def test_docs_map_carries_marker(self):
|
|
15
|
+
...
|
|
16
|
+
|
|
17
|
+
def test_stub_carries_marker(self):
|
|
18
|
+
...
|
|
19
|
+
|
|
20
|
+
def test_skill_carries_marker(self):
|
|
21
|
+
...
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
# Generated by uncoded — do not edit; regeneration overwrites.
|
|
1
2
|
# tests/test_stubs.py
|
|
2
3
|
|
|
3
4
|
import textwrap
|
|
4
5
|
from pathlib import Path
|
|
5
6
|
import pytest
|
|
6
7
|
from uncoded.extract import iter_source_files
|
|
8
|
+
from uncoded.markers import GENERATED_MARKER
|
|
7
9
|
from uncoded.stubs import StubAssignment, StubClass, StubFunction, StubModule, StubParam, _write_stubs, build_stubs, extract_stub, remove_all_stubs, render_stub
|
|
8
10
|
|
|
9
11
|
def _setup(tmp_path):
|
|
@@ -230,3 +232,6 @@ class TestRemoveAllStubs:
|
|
|
230
232
|
|
|
231
233
|
def test_returns_count_of_pyi_files(self, tmp_path):
|
|
232
234
|
...
|
|
235
|
+
|
|
236
|
+
def test_stray_non_pyi_file_not_removed(self, tmp_path):
|
|
237
|
+
...
|