entangled-cli 2.2.0__tar.gz → 2.2.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.
Files changed (45) hide show
  1. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/PKG-INFO +1 -1
  2. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/code_reader.py +1 -1
  3. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/tangle.py +2 -2
  4. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/document.py +6 -6
  5. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/task.py +1 -1
  6. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/pyproject.toml +1 -1
  7. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/.gitignore +0 -0
  8. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/LICENSE +0 -0
  9. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/README.md +0 -0
  10. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/__init__.py +0 -0
  11. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/__init__.py +0 -0
  12. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/brei.py +0 -0
  13. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/new.py +0 -0
  14. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/status.py +0 -0
  15. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/stitch.py +0 -0
  16. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/sync.py +0 -0
  17. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/commands/watch.py +0 -0
  18. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/config/__init__.py +0 -0
  19. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/config/language.py +0 -0
  20. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/config/templates.py +0 -0
  21. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/config/version.py +0 -0
  22. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/errors/__init__.py +0 -0
  23. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/errors/internal.py +0 -0
  24. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/errors/user.py +0 -0
  25. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/filedb.py +0 -0
  26. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/from_str.py +0 -0
  27. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/__init__.py +0 -0
  28. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/base.py +0 -0
  29. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/build.py +0 -0
  30. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/quarto_attributes.py +0 -0
  31. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/repl.py +0 -0
  32. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/shebang.py +0 -0
  33. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/hooks/spdx_license.py +0 -0
  34. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/logging.py +0 -0
  35. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/main.py +0 -0
  36. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/markdown_reader.py +0 -0
  37. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/parsing.py +0 -0
  38. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/properties.py +0 -0
  39. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/py.typed +0 -0
  40. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/status.py +0 -0
  41. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/tangle.py +0 -0
  42. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/text_location.py +0 -0
  43. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/transaction.py +0 -0
  44. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/utility.py +0 -0
  45. {entangled_cli-2.2.0 → entangled_cli-2.2.1}/entangled/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: entangled-cli
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: Literate Programming toolbox
5
5
  Project-URL: Homepage, https://entangled.github.io/
6
6
  Project-URL: Repository, https://github.com/entangled/entangled.py
@@ -66,7 +66,7 @@ class CodeReader(mawk.RuleSet):
66
66
  def on_block_end(self, m: re.Match[str]) -> list[str]:
67
67
  if m["indent"] != self.current.indent:
68
68
  raise IndentationError(self.location)
69
- self.refs[self.current.ref].source = "\n".join(self.current.content)
69
+ self.refs.get_codeblock(self.current.ref).source = "\n".join(self.current.content)
70
70
  _ = self.stack.pop()
71
71
  return []
72
72
 
@@ -69,8 +69,8 @@ def tangle(*, annotate: str | None = None, force: bool = False, show: bool = Fal
69
69
 
70
70
  for tgt in refs.targets:
71
71
  result, deps = tangle_ref(refs, tgt, annotation_method)
72
- mode = next(refs[tgt]).mode
73
- t.write(Path(tgt), result, list(map(Path, deps)), mode)
72
+ mask = next(iter(refs.by_name(tgt))).mode
73
+ t.write(Path(tgt), result, list(map(Path, deps)), mask)
74
74
 
75
75
  for h in hooks:
76
76
  h.on_tangle(t, refs)
@@ -1,13 +1,13 @@
1
1
  from textwrap import indent
2
- from typing import Optional, Union, Iterable, Any, override
2
+ from collections.abc import Iterable
3
+ from typing import override
3
4
  from dataclasses import dataclass, field
4
5
  from collections import defaultdict
5
6
  from functools import singledispatchmethod
6
- from itertools import chain
7
7
  from pathlib import PurePath
8
8
 
9
- from .config import Language, AnnotationMethod, config
10
- from .properties import Property, get_attribute
9
+ from .config.language import Language
10
+ from .properties import Property
11
11
  from .errors.internal import InternalError
12
12
  from .text_location import TextLocation
13
13
 
@@ -101,7 +101,7 @@ class ReferenceMap:
101
101
  return self.map[key]
102
102
 
103
103
  @singledispatchmethod
104
- def __getitem__(self, key):
104
+ def __getitem__(self, key: ReferenceId | str) -> CodeBlock | Iterable[CodeBlock]:
105
105
  raise NotImplementedError(f"Invalid key: {type(key)}")
106
106
 
107
107
  @__getitem__.register
@@ -129,7 +129,7 @@ def content_to_text(r: ReferenceMap, c: Content) -> str:
129
129
  case ReferenceId(): return r.get_codeblock(c).indented_text
130
130
 
131
131
 
132
- def document_to_text(r: ReferenceMap, cs: list[Content]) -> str:
132
+ def document_to_text(r: ReferenceMap, cs: Iterable[Content]) -> str:
133
133
  """
134
134
  Reconstruct original plain text content from a reference map and
135
135
  list of content.
@@ -44,7 +44,7 @@ class Hook(HookBase):
44
44
  ref: ReferenceId
45
45
 
46
46
  def to_brei_task(self, refs: ReferenceMap):
47
- cb = refs[self.ref]
47
+ cb = refs.get_codeblock(self.ref)
48
48
  if (path := get_attribute(cb.properties, "file")) is None:
49
49
  script, _ = tangle_ref(refs, self.ref.name, AnnotationMethod.NAKED)
50
50
  else:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "entangled-cli"
3
- version = "2.2.0"
3
+ version = "2.2.1"
4
4
  description = "Literate Programming toolbox"
5
5
  authors = [{ name = "Johan Hidding", email = "j.hidding@esciencecenter.nl" }]
6
6
  requires-python = ">=3.12,<4"
File without changes
File without changes
File without changes