entangled-cli 2.1.10__tar.gz → 2.1.12__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 (44) hide show
  1. entangled_cli-2.1.12/.gitignore +6 -0
  2. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/PKG-INFO +21 -24
  3. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/README.md +3 -0
  4. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/code_reader.py +4 -4
  5. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/commands/stitch.py +1 -1
  6. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/document.py +3 -2
  7. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/hooks/quarto_attributes.py +9 -4
  8. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/markdown_reader.py +6 -6
  9. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/tangle.py +1 -1
  10. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/text_location.py +2 -1
  11. entangled_cli-2.1.12/pyproject.toml +60 -0
  12. entangled_cli-2.1.10/pyproject.toml +0 -52
  13. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/LICENSE +0 -0
  14. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/__init__.py +0 -0
  15. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/commands/__init__.py +0 -0
  16. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/commands/brei.py +0 -0
  17. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/commands/new.py +0 -0
  18. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/commands/status.py +0 -0
  19. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/commands/sync.py +0 -0
  20. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/commands/tangle.py +0 -0
  21. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/commands/watch.py +0 -0
  22. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/config/__init__.py +0 -0
  23. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/config/language.py +0 -0
  24. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/config/templates.py +0 -0
  25. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/config/version.py +0 -0
  26. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/construct.py +0 -0
  27. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/errors/__init__.py +0 -0
  28. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/errors/internal.py +0 -0
  29. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/errors/user.py +0 -0
  30. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/filedb.py +0 -0
  31. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/hooks/__init__.py +0 -0
  32. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/hooks/base.py +0 -0
  33. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/hooks/build.py +0 -0
  34. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/hooks/shebang.py +0 -0
  35. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/hooks/task.py +0 -0
  36. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/logging.py +0 -0
  37. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/main.py +0 -0
  38. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/parsing.py +0 -0
  39. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/properties.py +0 -0
  40. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/py.typed +0 -0
  41. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/status.py +0 -0
  42. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/transaction.py +0 -0
  43. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/utility.py +0 -0
  44. {entangled_cli-2.1.10 → entangled_cli-2.1.12}/entangled/version.py +0 -0
@@ -0,0 +1,6 @@
1
+ __pycache__
2
+ .vscode
3
+ .coverage
4
+ coverage.*
5
+ dist
6
+ site
@@ -1,29 +1,24 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: entangled-cli
3
- Version: 2.1.10
3
+ Version: 2.1.12
4
4
  Summary: Literate Programming toolbox
5
- Home-page: https://entangled.github.io/
6
- License: Apache 2
7
- Author: Johan Hidding
8
- Author-email: j.hidding@esciencecenter.nl
9
- Requires-Python: >=3.11,<4.0
10
- Classifier: License :: Other/Proprietary License
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Classifier: Programming Language :: Python :: 3.13
15
- Requires-Dist: argh (>=0.30,<0.31)
16
- Requires-Dist: brei (>=0.2.3,<0.3.0)
17
- Requires-Dist: copier (>=9,<10)
18
- Requires-Dist: filelock (>=3.12.0,<4.0.0)
19
- Requires-Dist: mawk (>=0.1.4,<0.2.0)
20
- Requires-Dist: pexpect (>=4.9.0,<5.0.0)
21
- Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
22
- Requires-Dist: rich (>=13.3.5,<14.0.0)
23
- Requires-Dist: rich-argparse (>=1.4.0,<2.0.0)
24
- Requires-Dist: tomlkit (>=0.12.1,<0.13.0)
25
- Requires-Dist: watchdog (>=3.0.0,<4.0.0)
5
+ Project-URL: Homepage, https://entangled.github.io/
26
6
  Project-URL: Repository, https://github.com/entangled/entangled.py
7
+ Author-email: Johan Hidding <j.hidding@esciencecenter.nl>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Requires-Python: ~=3.11
11
+ Requires-Dist: argh<0.31,>=0.30
12
+ Requires-Dist: brei<0.3,>=0.2.3
13
+ Requires-Dist: copier<10,>=9
14
+ Requires-Dist: filelock<4,>=3.12.0
15
+ Requires-Dist: mawk<0.2,>=0.1.4
16
+ Requires-Dist: pexpect<5,>=4.9.0
17
+ Requires-Dist: pyyaml<7,>=6.0.1
18
+ Requires-Dist: rich-argparse<2,>=1.4.0
19
+ Requires-Dist: rich<14,>=13.3.5
20
+ Requires-Dist: tomlkit<0.13,>=0.12.1
21
+ Requires-Dist: watchdog<4,>=3.0.0
27
22
  Description-Content-Type: text/markdown
28
23
 
29
24
  # Entangled
@@ -182,6 +177,9 @@ identifiers = ["java"]
182
177
  comment = { open = "//" }
183
178
  ```
184
179
 
180
+ ## Working in VSCode
181
+ The [EntangleD-VSCode](https://github.com/deephbz/entangled-vscode) extension provides code block navigation, reference&symbol search, NOWEB high-lighting functionalities.
182
+
185
183
  ## Working with Git
186
184
 
187
185
  When using Entangled in conjunction with Git, there are a few tricks that you may want to know about.
@@ -518,4 +516,3 @@ If you have an idea for improving Entangled, please file an issue before creatin
518
516
  ## License
519
517
 
520
518
  Copyright 2023 Netherlands eScience Center, written by Johan Hidding, licensed under the Apache 2 license, see LICENSE.
521
-
@@ -154,6 +154,9 @@ identifiers = ["java"]
154
154
  comment = { open = "//" }
155
155
  ```
156
156
 
157
+ ## Working in VSCode
158
+ The [EntangleD-VSCode](https://github.com/deephbz/entangled-vscode) extension provides code block navigation, reference&symbol search, NOWEB high-lighting functionalities.
159
+
157
160
  ## Working with Git
158
161
 
159
162
  When using Entangled in conjunction with Git, there are a few tricks that you may want to know about.
@@ -1,5 +1,5 @@
1
1
  from dataclasses import dataclass, field
2
- from pathlib import Path
2
+ from pathlib import Path, PurePath
3
3
 
4
4
  import mawk
5
5
  import re
@@ -18,9 +18,9 @@ class Frame:
18
18
  class CodeReader(mawk.RuleSet):
19
19
  """Reads an annotated code file."""
20
20
 
21
- def __init__(self, path: str, refs: ReferenceMap):
21
+ def __init__(self, path: PurePath, refs: ReferenceMap):
22
22
  self.location = TextLocation(path, 0)
23
- self.stack: list[Frame] = [Frame(ReferenceId("#root#", "", -1), "")]
23
+ self.stack: list[Frame] = [Frame(ReferenceId("#root#", PurePath("-"), -1), "")]
24
24
  self.refs: ReferenceMap = refs
25
25
 
26
26
  @property
@@ -56,7 +56,7 @@ class CodeReader(mawk.RuleSet):
56
56
 
57
57
  self.stack.append(
58
58
  Frame(
59
- ReferenceId(m["ref_name"], m["source"], ref_count), m["indent"], content
59
+ ReferenceId(m["ref_name"], PurePath(m["source"]), ref_count), m["indent"], content
60
60
  )
61
61
  )
62
62
  return []
@@ -57,7 +57,7 @@ def stitch(*, force: bool = False, show: bool = False):
57
57
  logging.debug("reading `%s`", path)
58
58
  t.update(path)
59
59
  with open(path, "r") as f:
60
- CodeReader(str(path), refs).run(f.read())
60
+ CodeReader(path, refs).run(f.read())
61
61
 
62
62
  for path in input_file_list:
63
63
  t.write(path, stitch_markdown(refs, content[path]), [])
@@ -3,6 +3,7 @@ from dataclasses import dataclass, field
3
3
  from collections import defaultdict
4
4
  from functools import singledispatchmethod
5
5
  from itertools import chain
6
+ from pathlib import PurePath
6
7
 
7
8
  from .config import Language, AnnotationMethod, config
8
9
  from .properties import Property, get_attribute
@@ -17,7 +18,7 @@ def length(iter: Iterable[Any]) -> int:
17
18
  @dataclass
18
19
  class ReferenceId:
19
20
  name: str
20
- file: str
21
+ file: PurePath
21
22
  ref_count: int
22
23
 
23
24
  def __hash__(self):
@@ -71,7 +72,7 @@ class ReferenceMap:
71
72
 
72
73
  return (self.map[r] for r in self.index[n])
73
74
 
74
- def new_id(self, filename: str, name: str) -> ReferenceId:
75
+ def new_id(self, filename: PurePath, name: str) -> ReferenceId:
75
76
  c = length(filter(lambda r: r.file == filename, self.index[name]))
76
77
  return ReferenceId(name, filename, c)
77
78
 
@@ -34,13 +34,18 @@ class Hook(HookBase):
34
34
  attrs = yaml.safe_load(header)
35
35
  if attrs is None:
36
36
  return
37
+ if not isinstance(attrs, dict):
38
+ log.warning("quarto attributes do not evaluate to dictionary; skipping")
39
+ log.warning(f"tried to parse: {header}")
40
+ return
37
41
 
38
- if "id" in attrs:
42
+ if "id" in attrs.keys():
39
43
  code.properties.append(Id(attrs["id"]))
40
44
 
41
- if "classes" in attrs:
45
+ if "classes" in attrs.keys():
42
46
  code.properties.extend(Class(c) for c in attrs["classes"])
43
-
44
- code.properties.extend(Attribute(k, v) for k, v in attrs.items())
47
+
48
+ code.properties.extend(Attribute(k, v) for k, v in attrs.items()
49
+ if k not in ("id", "classes"))
45
50
 
46
51
  log.debug("quarto attributes: %s", attrs)
@@ -1,6 +1,6 @@
1
1
  from typing import Optional
2
2
  from copy import copy
3
- from pathlib import Path
3
+ from pathlib import Path, PurePath
4
4
 
5
5
  import re
6
6
  import mawk
@@ -20,8 +20,8 @@ class MarkdownLexer(mawk.RuleSet):
20
20
  content."""
21
21
  def __init__(
22
22
  self,
23
- filename: str
24
- ):
23
+ filename: Path
24
+ ):
25
25
  self.location = TextLocation(filename)
26
26
  self.raw_content: list[RawContent] = []
27
27
  self.inside_codeblock: bool = False
@@ -122,13 +122,13 @@ def read_markdown_file(
122
122
  -> tuple[ReferenceMap, list[Content]]:
123
123
 
124
124
  with open(path, "r") as f:
125
- path_str = str(path.resolve().relative_to(Path.cwd()))
126
- return read_markdown_string(f.read(), path_str, refs, hooks)
125
+ rel_path = path.resolve().relative_to(Path.cwd())
126
+ return read_markdown_string(f.read(), rel_path, refs, hooks)
127
127
 
128
128
 
129
129
  def read_markdown_string(
130
130
  text: str,
131
- path_str: str = "-",
131
+ path_str: Path = Path("-"),
132
132
  refs: ReferenceMap | None = None,
133
133
  hooks: list[HookBase] | None = None) \
134
134
  -> tuple[ReferenceMap, list[Content]]:
@@ -95,7 +95,7 @@ class AnnotatedTangler(Tangler):
95
95
  if self.cb.header is not None:
96
96
  result.append(self.cb.header)
97
97
  result.append(
98
- f"{self.cb.language.comment.open} ~/~ begin <<{self.ref.file}#{self.ref.name}>>[{count}]{self.close_comment}"
98
+ f"{self.cb.language.comment.open} ~/~ begin <<{self.ref.file.as_posix()}#{self.ref.name}>>[{count}]{self.close_comment}"
99
99
  )
100
100
  return result
101
101
 
@@ -1,9 +1,10 @@
1
1
  from dataclasses import dataclass
2
+ from pathlib import PurePath
2
3
 
3
4
 
4
5
  @dataclass
5
6
  class TextLocation:
6
- filename: str
7
+ filename: PurePath
7
8
  line_number: int = 0
8
9
 
9
10
  def __str__(self):
@@ -0,0 +1,60 @@
1
+ [project]
2
+ name = "entangled-cli"
3
+ version = "2.1.12"
4
+ description = "Literate Programming toolbox"
5
+ authors = [{ name = "Johan Hidding", email = "j.hidding@esciencecenter.nl" }]
6
+ requires-python = "~=3.11"
7
+ readme = "README.md"
8
+ license = "Apache-2.0"
9
+ dependencies = [
10
+ "mawk>=0.1.4,<0.2",
11
+ "watchdog>=3.0.0,<4",
12
+ "filelock>=3.12.0,<4",
13
+ "argh>=0.30,<0.31",
14
+ "rich>=13.3.5,<14",
15
+ "tomlkit>=0.12.1,<0.13",
16
+ "copier>=9,<10",
17
+ "brei>=0.2.3,<0.3",
18
+ "rich-argparse>=1.4.0,<2",
19
+ "pexpect>=4.9.0,<5",
20
+ "pyyaml>=6.0.1,<7",
21
+ ]
22
+
23
+ [project.urls]
24
+ Homepage = "https://entangled.github.io/"
25
+ Repository = "https://github.com/entangled/entangled.py"
26
+
27
+ [project.scripts]
28
+ entangled = "entangled.main:cli"
29
+
30
+ [dependency-groups]
31
+ dev = [
32
+ "pytest>=7.3.1,<8",
33
+ "mypy>=1.3.0,<2",
34
+ "black>=23.3.0,<24",
35
+ "pytest-cov>=4.0.0,<5",
36
+ "mkdocs>=1.4.3,<2",
37
+ "mkdocs-material>=9.1.13,<10",
38
+ "mkdocstrings[python]>=0.21.2,<0.22",
39
+ "pytest-asyncio>=0.21.1,<0.22",
40
+ "ruff>=0.4.4,<0.5",
41
+ "types-pyyaml>=6.0.12.20240311,<7",
42
+ "types-pygments>=2.18.0.20240506,<3",
43
+ "types-colorama>=0.4.15.20240311,<0.5",
44
+ ]
45
+
46
+ [tool.hatch.build.targets.sdist]
47
+ include = ["entangled"]
48
+
49
+ [tool.hatch.build.targets.wheel]
50
+ include = ["entangled"]
51
+
52
+ [build-system]
53
+ requires = ["hatchling"]
54
+ build-backend = "hatchling.build"
55
+
56
+ [tool.pytest.ini_options]
57
+ testpaths = ["test"]
58
+
59
+ [tool.mypy]
60
+ packages = ["entangled"]
@@ -1,52 +0,0 @@
1
- [tool.poetry]
2
- name = "entangled-cli"
3
- version = "2.1.10"
4
- description = "Literate Programming toolbox"
5
- repository = "https://github.com/entangled/entangled.py"
6
- homepage = "https://entangled.github.io/"
7
- authors = ["Johan Hidding <j.hidding@esciencecenter.nl>"]
8
- license = "Apache 2"
9
- readme = "README.md"
10
- packages = [{ include = "entangled" }]
11
-
12
- [tool.poetry.dependencies]
13
- python = "^3.11"
14
- mawk = "^0.1.4" # use mawk as line parsing engine
15
- watchdog = "^3.0.0" # file watching
16
- filelock = "^3.12.0" # file lock for json db
17
- argh = "^0.30" # easy argument parsing
18
- rich = "^13.3.5" # colourful output
19
- tomlkit = "^0.12.1" # read/write toml files
20
- copier = "^9" # project templates
21
- brei = "^0.2.3" # build system
22
- rich-argparse = "^1.4.0" # colourful help messages
23
- pexpect = "^4.9.0"
24
- pyyaml = "^6.0.1"
25
-
26
- [tool.poetry.group.dev.dependencies]
27
- pytest = "^7.3.1"
28
- mypy = "^1.3.0"
29
- black = "^23.3.0"
30
- pytest-cov = "^4.0.0"
31
- mkdocs = "^1.4.3"
32
- mkdocs-material = "^9.1.13"
33
- mkdocstrings = { extras = ["python"], version = "^0.21.2" }
34
- twine = "^4.0.2"
35
- pytest-asyncio = "^0.21.1"
36
- ruff = "^0.4.4"
37
- types-pyyaml = "^6.0.12.20240311"
38
- types-pygments = "^2.18.0.20240506"
39
- types-colorama = "^0.4.15.20240311"
40
-
41
- [build-system]
42
- requires = ["poetry-core"]
43
- build-backend = "poetry.core.masonry.api"
44
-
45
- [tool.pytest.ini_options]
46
- testpaths = ["test"]
47
-
48
- [tool.mypy]
49
- packages = ["entangled"]
50
-
51
- [tool.poetry.scripts]
52
- entangled = "entangled.main:cli"
File without changes