codeplain 0.3.14.dev50__py3-none-any.whl → 0.4.1__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: codeplain
3
- Version: 0.3.14.dev50
3
+ Version: 0.4.1
4
4
  Summary: Transform plain language specifications into working code
5
5
  License-File: LICENSE
6
6
  Classifier: Environment :: Console
@@ -10,7 +10,7 @@ Classifier: Topic :: Software Development :: Code Generators
10
10
  Requires-Python: ==3.11.*
11
11
  Requires-Dist: gitpython==3.2.1
12
12
  Requires-Dist: mistletoe==1.6.0
13
- Requires-Dist: plain-parser==0.1.4
13
+ Requires-Dist: plain-parser==0.2.0
14
14
  Requires-Dist: python-frontmatter==1.3.0
15
15
  Requires-Dist: python-liquid2==0.4.0
16
16
  Requires-Dist: pyyaml==6.0.3
@@ -79,6 +79,7 @@ tests/test_change_detection.py,sha256=jGSBuMFHFiZxe14kB6PucH3Aw0dh5RsKpvQgxhmUdE
79
79
  tests/test_cli_output.py,sha256=9yTk0pD2w6vkiSdSkYwneUmEtNqX4x64F6PzYShUEcw,19331
80
80
  tests/test_conformance_fix_journal.py,sha256=6IDSMKTSRLB-iWb6jzGvG3TwJomzg0S0SlyG4IbAZdg,10729
81
81
  tests/test_console_log_styles.py,sha256=sxlhynMAP-kmqhBn1-pKvZXdCnlKSyCGJqwYKrh6sQ0,6468
82
+ tests/test_dependency_pins.py,sha256=D_c5sb7ikwuV4zy8trB0DDzwNLkhAX221X67atLA-ec,1864
82
83
  tests/test_distill_conformance_test_memory.py,sha256=Tftw9l-gLVwIU6QttY03h2VedvuFxpIsCmZIzvWfxMA,5481
83
84
  tests/test_dry_run_link_validation.py,sha256=0Ca7v4DHMPBVmmBLWr2AHk4xVHzdOS2PHiPdumgpWkM,2154
84
85
  tests/test_file_utils.py,sha256=RPab1wBsbE7XAPGync56WveFVnRvafFVRia1a2mMQhk,4490
@@ -125,8 +126,8 @@ tui/spinner.py,sha256=Ro6Gd9Przf-whuHqPRY6HwI0T57yJjyNPbhDbigZKZE,2471
125
126
  tui/state_handlers.py,sha256=SCAcBXLgGhpVFBLrTL76g7Z507q4fLgSwYkGiwAMLRc,16067
126
127
  tui/styles.css,sha256=kiC7Og_2G1E7owoiZgV95-3_dSeQnsNj3qzaY04xkDg,6727
127
128
  tui/widget_helpers.py,sha256=jitm2WHiKj-NVFL-hULxWzckPreRbUTl9OIZLN31-ek,6997
128
- codeplain-0.3.14.dev50.dist-info/METADATA,sha256=ZgG_XPrS0KK8YMMWP7LLcx-QO1Lphx6NkHQrLPqt2lQ,7261
129
- codeplain-0.3.14.dev50.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
130
- codeplain-0.3.14.dev50.dist-info/entry_points.txt,sha256=oDZkBqu9WhtZApb_K6ia8-fn9aojwmAsgnKELceX5T4,46
131
- codeplain-0.3.14.dev50.dist-info/licenses/LICENSE,sha256=pCeKgQ1mXE5OmNUuKOfOZh1T1vqkeCUxghE7N8qgnzc,11345
132
- codeplain-0.3.14.dev50.dist-info/RECORD,,
129
+ codeplain-0.4.1.dist-info/METADATA,sha256=p_6ntZcJ6AqM_j3nuFPZnYSPud1HXtTydMCvoly-_QA,7254
130
+ codeplain-0.4.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
131
+ codeplain-0.4.1.dist-info/entry_points.txt,sha256=oDZkBqu9WhtZApb_K6ia8-fn9aojwmAsgnKELceX5T4,46
132
+ codeplain-0.4.1.dist-info/licenses/LICENSE,sha256=pCeKgQ1mXE5OmNUuKOfOZh1T1vqkeCUxghE7N8qgnzc,11345
133
+ codeplain-0.4.1.dist-info/RECORD,,
@@ -0,0 +1,52 @@
1
+ """The pins of requirements.txt and pyproject.toml must say the same thing.
2
+
3
+ requirements.txt builds the development environment and the CI jobs. pyproject.toml is what the
4
+ wheel carries, so it is what an installed client gets. A pin changed in one file and not the other
5
+ passes every test here and still ships a client that cannot start.
6
+ """
7
+
8
+ import os
9
+ import re
10
+ import tomllib
11
+
12
+ REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
13
+
14
+
15
+ def _name(requirement: str) -> str:
16
+ return re.split(r"[=<>@\[]", requirement, maxsplit=1)[0].strip().lower()
17
+
18
+
19
+ def _requirements() -> dict[str, str]:
20
+ with open(os.path.join(REPO, "requirements.txt"), encoding="utf-8") as f:
21
+ lines = [line.strip() for line in f]
22
+ return {_name(line): line for line in lines if line and not line.startswith("#")}
23
+
24
+
25
+ def _pyproject() -> tuple[dict[str, str], dict[str, str]]:
26
+ with open(os.path.join(REPO, "pyproject.toml"), "rb") as f:
27
+ pyproject = tomllib.load(f)["project"]
28
+ runtime = {_name(item): item for item in pyproject["dependencies"]}
29
+ dev = {_name(item): item for item in pyproject["optional-dependencies"]["dev"]}
30
+ return runtime, dev
31
+
32
+
33
+ def test_every_pin_of_the_wheel_matches_requirements():
34
+ requirements = _requirements()
35
+ runtime, dev = _pyproject()
36
+
37
+ mismatched = {
38
+ name: (requirement, requirements.get(name))
39
+ for name, requirement in {**runtime, **dev}.items()
40
+ if requirements.get(name) != requirement
41
+ }
42
+
43
+ assert mismatched == {}, f"pyproject.toml and requirements.txt disagree: {mismatched}"
44
+
45
+
46
+ def test_requirements_names_nothing_the_wheel_leaves_out():
47
+ requirements = _requirements()
48
+ runtime, dev = _pyproject()
49
+
50
+ missing = sorted(set(requirements) - set(runtime) - set(dev))
51
+
52
+ assert missing == [], f"requirements.txt pins what pyproject.toml does not declare: {missing}"