apexcodexpy 0.7.1__tar.gz → 0.7.2__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 (25) hide show
  1. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/PKG-INFO +2 -1
  2. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/service.py +2 -0
  3. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/typer/root.py +15 -0
  4. apexcodexpy-0.7.2/codex/infra/workflows/lock.py +33 -0
  5. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/pyproject.toml +1 -1
  6. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/LICENSE +0 -0
  7. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/README.md +0 -0
  8. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/__init__.py +0 -0
  9. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/__init__.py +0 -0
  10. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/program.py +0 -0
  11. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/pyproject.py +0 -0
  12. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/reporters.py +0 -0
  13. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/result.py +0 -0
  14. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/tools.py +0 -0
  15. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/typer/__init__.py +0 -0
  16. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/typer/device.py +0 -0
  17. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/typer/testing.py +0 -0
  18. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/workflows/__init__.py +0 -0
  19. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/workflows/base.py +0 -0
  20. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/workflows/build.py +0 -0
  21. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/workflows/ci.py +0 -0
  22. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/workflows/dependabot.py +0 -0
  23. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/workflows/validate.py +0 -0
  24. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/infra/yamler.py +0 -0
  25. {apexcodexpy-0.7.1 → apexcodexpy-0.7.2}/codex/runner.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apexcodexpy
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: The Non-Destructive Configuration Steward for Python Projects.
5
5
  License-File: LICENSE
6
6
  Author: Apex Dev
@@ -11,6 +11,7 @@ Classifier: Programming Language :: Python :: 3.11
11
11
  Classifier: Programming Language :: Python :: 3.12
12
12
  Classifier: Programming Language :: Python :: 3.13
13
13
  Classifier: Programming Language :: Python :: 3.14
14
+ Classifier: Programming Language :: Python :: 3.15
14
15
  Requires-Dist: deptry
15
16
  Requires-Dist: mypy
16
17
  Requires-Dist: ruamel-yaml
@@ -22,6 +22,7 @@ from codex.infra.workflows import (
22
22
  CheckCodeWorkflow,
23
23
  DependabotWorkflow,
24
24
  )
25
+ from codex.infra.workflows.lock import CodexLockWorkflow
25
26
 
26
27
 
27
28
  @dataclass(frozen=True)
@@ -140,6 +141,7 @@ class CodexTools:
140
141
  BuildCodeWorkflow(disclaimer=False).sync(self.target, force=force),
141
142
  when=self.target.joinpath("Dockerfile").exists(),
142
143
  )
144
+ .attach(CodexLockWorkflow().sync(self.target, force=force))
143
145
  )
144
146
 
145
147
  def lock(self) -> Executable:
@@ -4,10 +4,25 @@ import typer
4
4
 
5
5
  from codex.infra.reporters import DefaultReporter, SimpleReporter
6
6
  from codex.infra.service import Codex, Git
7
+ from codex.infra.workflows.lock import CodexLockWorkflow
7
8
 
8
9
  cli = typer.Typer(no_args_is_help=True)
9
10
 
10
11
 
12
+ @cli.callback()
13
+ def verify_codex_lock(ctx: typer.Context) -> None:
14
+ if ctx.invoked_subcommand == "sync":
15
+ return
16
+
17
+ if CodexLockWorkflow().verify():
18
+ return
19
+
20
+ typer.echo("Codex is out of sync!")
21
+ typer.echo("Run `codex sync` to bring configuration up to date")
22
+
23
+ raise typer.Exit(1)
24
+
25
+
11
26
  @cli.command(
12
27
  name="version",
13
28
  help="Show the codex version and exit.",
@@ -0,0 +1,33 @@
1
+ from __future__ import annotations
2
+
3
+ import hashlib
4
+ from dataclasses import dataclass
5
+ from pathlib import Path
6
+
7
+ from codex.infra.yamler import Yamler
8
+
9
+ from .base import YamlWorkflow
10
+
11
+
12
+ def hash_of(path: Path) -> str:
13
+ with path.open("rb") as f:
14
+ return hashlib.file_digest(f, hashlib.sha256).hexdigest()
15
+
16
+
17
+ @dataclass(frozen=True, kw_only=True)
18
+ class CodexLockWorkflow(YamlWorkflow):
19
+ name: str = "CodexLock"
20
+ path: Path = Path("codex.lock")
21
+
22
+ @property
23
+ def standards(self) -> Yamler:
24
+ return Yamler.parse(
25
+ {
26
+ "hashes": {
27
+ "pyproject": hash_of(Path("pyproject.toml")),
28
+ },
29
+ }
30
+ )
31
+
32
+ def verify(self) -> bool:
33
+ return self.path.exists() and self.standards == Yamler.read(self.path)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "apexcodexpy"
3
- version = "0.7.1"
3
+ version = "0.7.2"
4
4
  description = "The Non-Destructive Configuration Steward for Python Projects."
5
5
  readme = "README.md"
6
6
  authors = [
File without changes
File without changes
File without changes