cf-setup 0.1.0__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.
@@ -0,0 +1,70 @@
1
+ Metadata-Version: 2.4
2
+ Name: cf-setup
3
+ Version: 0.1.0
4
+ Summary: Manifest-driven Cogniflow workspace setup orchestration
5
+ Requires-Python: >=3.11
6
+ Description-Content-Type: text/markdown
7
+ Provides-Extra: test
8
+ Requires-Dist: pytest<9.0,>=8.0; extra == "test"
9
+
10
+ # cf-setup
11
+
12
+ `cf-setup` is the first-party setup orchestrator for the Cogniflow Windows workspace.
13
+
14
+ It centralizes:
15
+
16
+ - module and profile definitions
17
+ - deterministic install planning
18
+ - PyPI-first vs editable source decisions
19
+ - Windows prerequisite diagnostics
20
+ - delegated native or frontend build steps
21
+ - post-install hooks
22
+ - structured installation reporting
23
+
24
+ Typical usage:
25
+
26
+ ```powershell
27
+ py -3.14 -m cf_setup plan --profile core --format json
28
+ py -3.14 -m cf_setup diagnose --provider windows --format json
29
+ py -3.14 -m cf_setup install --profile full --editable cf-pipeline-engine
30
+ ```
31
+
32
+ The repository entrypoint remains `scripts/fresh_install_v2.ps1`, but it now acts as a thin Windows wrapper that bootstraps Python and delegates orchestration into `cf_setup`.
33
+
34
+ `cf_setup` now supports two practical modes:
35
+
36
+ - repository mode: used by `scripts/fresh_install_v2.ps1` and local workspace maintainers
37
+ - distribution mode: used when `cf install` runs without a repository checkout and must rely on packaged manifest resources plus published package artifacts
38
+
39
+ ## Publishing
40
+
41
+ `cf-setup` is prepared for the dedicated Windows workflow:
42
+
43
+ - Workflow: `.github/workflows/cf_setup_windows_publish.yml`
44
+ - Package directory: `sandcastle/cf_setup`
45
+ - PyPI tag: `cf-setup-v<version>`
46
+ - TestPyPI tag: `cf-setup-v<version>-test`
47
+ - Release order: publish `cf-core-cli 0.1.5` first, then `cf-setup`, then `cogniflow`
48
+
49
+ Local preflight:
50
+
51
+ ```powershell
52
+ powershell -ExecutionPolicy Bypass -File scripts/mimic_windows_python_publish_workflow.ps1 `
53
+ -WorkflowFile .github/workflows/cf_setup_windows_publish.yml `
54
+ -PackageDir sandcastle/cf_setup `
55
+ -PythonExe py `
56
+ -PythonVersion 3.14
57
+ ```
58
+
59
+ Queue a dry-run dispatch:
60
+
61
+ ```powershell
62
+ powershell -ExecutionPolicy Bypass -File scripts/queue_windows_python_publish_workflow.ps1 `
63
+ -WorkflowFile .github/workflows/cf_setup_windows_publish.yml `
64
+ -PackageDir sandcastle/cf_setup `
65
+ -PublishTarget testpypi `
66
+ -Ref main `
67
+ -RequireLocalPass `
68
+ -DryRun `
69
+ -ReleaseTag cf-setup-v0.1.0-test
70
+ ```
@@ -0,0 +1,61 @@
1
+ # cf-setup
2
+
3
+ `cf-setup` is the first-party setup orchestrator for the Cogniflow Windows workspace.
4
+
5
+ It centralizes:
6
+
7
+ - module and profile definitions
8
+ - deterministic install planning
9
+ - PyPI-first vs editable source decisions
10
+ - Windows prerequisite diagnostics
11
+ - delegated native or frontend build steps
12
+ - post-install hooks
13
+ - structured installation reporting
14
+
15
+ Typical usage:
16
+
17
+ ```powershell
18
+ py -3.14 -m cf_setup plan --profile core --format json
19
+ py -3.14 -m cf_setup diagnose --provider windows --format json
20
+ py -3.14 -m cf_setup install --profile full --editable cf-pipeline-engine
21
+ ```
22
+
23
+ The repository entrypoint remains `scripts/fresh_install_v2.ps1`, but it now acts as a thin Windows wrapper that bootstraps Python and delegates orchestration into `cf_setup`.
24
+
25
+ `cf_setup` now supports two practical modes:
26
+
27
+ - repository mode: used by `scripts/fresh_install_v2.ps1` and local workspace maintainers
28
+ - distribution mode: used when `cf install` runs without a repository checkout and must rely on packaged manifest resources plus published package artifacts
29
+
30
+ ## Publishing
31
+
32
+ `cf-setup` is prepared for the dedicated Windows workflow:
33
+
34
+ - Workflow: `.github/workflows/cf_setup_windows_publish.yml`
35
+ - Package directory: `sandcastle/cf_setup`
36
+ - PyPI tag: `cf-setup-v<version>`
37
+ - TestPyPI tag: `cf-setup-v<version>-test`
38
+ - Release order: publish `cf-core-cli 0.1.5` first, then `cf-setup`, then `cogniflow`
39
+
40
+ Local preflight:
41
+
42
+ ```powershell
43
+ powershell -ExecutionPolicy Bypass -File scripts/mimic_windows_python_publish_workflow.ps1 `
44
+ -WorkflowFile .github/workflows/cf_setup_windows_publish.yml `
45
+ -PackageDir sandcastle/cf_setup `
46
+ -PythonExe py `
47
+ -PythonVersion 3.14
48
+ ```
49
+
50
+ Queue a dry-run dispatch:
51
+
52
+ ```powershell
53
+ powershell -ExecutionPolicy Bypass -File scripts/queue_windows_python_publish_workflow.ps1 `
54
+ -WorkflowFile .github/workflows/cf_setup_windows_publish.yml `
55
+ -PackageDir sandcastle/cf_setup `
56
+ -PublishTarget testpypi `
57
+ -Ref main `
58
+ -RequireLocalPass `
59
+ -DryRun `
60
+ -ReleaseTag cf-setup-v0.1.0-test
61
+ ```
@@ -0,0 +1,33 @@
1
+ [build-system]
2
+ requires = ["setuptools>=70"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "cf-setup"
7
+ version = "0.1.0"
8
+ description = "Manifest-driven Cogniflow workspace setup orchestration"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ dependencies = []
12
+
13
+ [project.optional-dependencies]
14
+ test = [
15
+ "pytest>=8.0,<9.0"
16
+ ]
17
+
18
+ [project.scripts]
19
+ cf-setup = "cf_setup.cli:main"
20
+
21
+ [tool.setuptools]
22
+ package-dir = {"" = "src"}
23
+
24
+ [tool.setuptools.package-data]
25
+ cf_setup = ["install_manifest.toml"]
26
+
27
+ [tool.setuptools.packages.find]
28
+ where = ["src"]
29
+ include = ["cf_setup*"]
30
+
31
+ [tool.pytest.ini_options]
32
+ testpaths = ["tests"]
33
+ addopts = ["--basetemp=.pytest_tmp"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,21 @@
1
+ """Cogniflow setup orchestration package."""
2
+
3
+ from pathlib import Path
4
+
5
+ __version__ = "0.1.0"
6
+ PACKAGE_ROOT = Path(__file__).resolve().parent
7
+ DEFAULT_MANIFEST_PATH = PACKAGE_ROOT / "install_manifest.toml"
8
+
9
+
10
+ def find_repo_root(start: Path | None = None) -> Path | None:
11
+ candidate = (start or Path.cwd()).resolve()
12
+ search_roots = [candidate, *candidate.parents]
13
+ for root in search_roots:
14
+ if (root / "scripts" / "fresh_install_v2.ps1").exists() and (root / "sandcastle").exists():
15
+ return root
16
+ return None
17
+
18
+
19
+ REPO_ROOT = find_repo_root(PACKAGE_ROOT)
20
+
21
+ __all__ = ["__version__", "DEFAULT_MANIFEST_PATH", "REPO_ROOT", "find_repo_root"]
@@ -0,0 +1,5 @@
1
+ from .cli import main
2
+
3
+
4
+ if __name__ == "__main__":
5
+ raise SystemExit(main())
@@ -0,0 +1,117 @@
1
+ from __future__ import annotations
2
+
3
+ import argparse
4
+ import json
5
+ from pathlib import Path
6
+ import sys
7
+
8
+ from . import DEFAULT_MANIFEST_PATH
9
+ from .installer import build_options_from_namespace, detect_execution_mode, execute_install, manifest_path_from_args, output_payload, plan_installation
10
+ from .providers.windows import WindowsProvider
11
+
12
+ def build_parser() -> argparse.ArgumentParser:
13
+ parser = argparse.ArgumentParser(prog="cf_setup", description="Cogniflow setup orchestration CLI")
14
+ subparsers = parser.add_subparsers(dest="command", required=True)
15
+
16
+ plan_parser = subparsers.add_parser("plan", help="Resolve profile modules and source decisions.")
17
+ plan_parser.add_argument("--repo-root")
18
+ plan_parser.add_argument("--manifest", default=str(DEFAULT_MANIFEST_PATH))
19
+ plan_parser.add_argument("--profile", default="full")
20
+ plan_parser.add_argument("--editable", action="append", default=[])
21
+ plan_parser.add_argument("--mode", choices=["auto", "repo", "distribution"], default="auto")
22
+ plan_parser.add_argument("--format", choices=["json"], default="json")
23
+ plan_parser.add_argument("--output")
24
+
25
+ diagnose_parser = subparsers.add_parser("diagnose", help="Report prerequisite diagnostics.")
26
+ diagnose_parser.add_argument("--provider", choices=["windows"], default="windows")
27
+ diagnose_parser.add_argument("--format", choices=["json"], default="json")
28
+ diagnose_parser.add_argument("--output")
29
+
30
+ install_parser = subparsers.add_parser("install", help="Execute the setup plan.")
31
+ install_parser.add_argument("--repo-root")
32
+ install_parser.add_argument("--manifest", default=str(DEFAULT_MANIFEST_PATH))
33
+ install_parser.add_argument("--profile", default="full")
34
+ install_parser.add_argument("--mode", choices=["auto", "repo", "distribution"], default="auto")
35
+ install_parser.add_argument("--python", default=sys.executable)
36
+ install_parser.add_argument("--editable", action="append", default=[])
37
+ install_parser.add_argument("--wheel-only", action=argparse.BooleanOptionalAction, default=True)
38
+ install_parser.add_argument("--clean", action="store_true")
39
+ install_parser.add_argument("--delete-native-deps", action="store_true")
40
+ install_parser.add_argument("--skip-native-deps", action="store_true")
41
+ install_parser.add_argument("--auto-install-missing-prereqs", action="store_true")
42
+ install_parser.add_argument("--skip-engine-build", action="store_true")
43
+ install_parser.add_argument("--skip-web-build", action="store_true")
44
+ install_parser.add_argument("--duckdb-version", default="1.4.2")
45
+ install_parser.add_argument("--native-arch", default="x64-windows-static")
46
+ install_parser.add_argument("--show-details", action="store_true")
47
+ install_parser.add_argument("--run-demo", action="store_true")
48
+ install_parser.add_argument("--dry-run", action="store_true")
49
+ install_parser.add_argument("--output")
50
+
51
+ return parser
52
+
53
+
54
+ def _handle_plan(args: argparse.Namespace) -> int:
55
+ repo_root = Path(args.repo_root).resolve() if args.repo_root else None
56
+ manifest_path = manifest_path_from_args(args.manifest, repo_root or Path.cwd())
57
+ manifest, plan = plan_installation(
58
+ manifest_path=manifest_path,
59
+ repo_root=repo_root,
60
+ profile=args.profile,
61
+ editable_overrides=args.editable,
62
+ execution_mode=args.mode,
63
+ )
64
+ payload = {
65
+ "repo_root": str(repo_root) if repo_root else None,
66
+ "manifest_path": str(manifest.path),
67
+ "execution_mode": detect_execution_mode(repo_root, args.mode),
68
+ "profile": plan.profile,
69
+ "requested_modules": list(plan.requested_modules),
70
+ "ordered_modules": [
71
+ {
72
+ "package_name": item.package_name,
73
+ "path": item.module.path,
74
+ "source": item.source,
75
+ "reason": item.reason,
76
+ "local_version": item.local_version,
77
+ "pypi_version": item.pypi_version,
78
+ "depends_on": list(item.module.depends_on),
79
+ }
80
+ for item in plan.ordered_modules
81
+ ],
82
+ "hooks": [{"hook_id": hook.hook_id, "action": hook.action} for hook in plan.hooks],
83
+ }
84
+ output_payload(payload, Path(args.output).resolve() if args.output else None)
85
+ return 0
86
+
87
+
88
+ def _handle_diagnose(args: argparse.Namespace) -> int:
89
+ provider = WindowsProvider()
90
+ payload = {"provider": provider.name, "tools": [item.to_dict() for item in provider.diagnose()]}
91
+ output_payload(payload, Path(args.output).resolve() if args.output else None)
92
+ return 0
93
+
94
+
95
+ def _handle_install(args: argparse.Namespace) -> int:
96
+ options = build_options_from_namespace(args)
97
+ payload = execute_install(options)
98
+ if not args.output:
99
+ print(json.dumps(payload, indent=2))
100
+ return 0
101
+
102
+
103
+ def main(argv: list[str] | None = None) -> int:
104
+ parser = build_parser()
105
+ args = parser.parse_args(argv)
106
+ try:
107
+ if args.command == "plan":
108
+ return _handle_plan(args)
109
+ if args.command == "diagnose":
110
+ return _handle_diagnose(args)
111
+ if args.command == "install":
112
+ return _handle_install(args)
113
+ parser.error(f"Unsupported command: {args.command}")
114
+ return 2
115
+ except Exception as exc:
116
+ print(f"cf_setup error: {exc}", file=sys.stderr)
117
+ return 1
@@ -0,0 +1,148 @@
1
+ [profiles]
2
+ core = [
3
+ "cf-ontology",
4
+ "cf-datahive",
5
+ "cf-opcua-server",
6
+ "cf-pipeline-cert",
7
+ "cf-pipeline-report",
8
+ "cf-pipeline-sdk",
9
+ "cf-pipeline-engine",
10
+ "cf-core-cli",
11
+ ]
12
+ steps = [
13
+ "cf-basic-dev",
14
+ "cf-basic-io",
15
+ "cf-basic-signal",
16
+ "cf-basic-sinks",
17
+ ]
18
+ web = [
19
+ "cf-web",
20
+ ]
21
+ full = [
22
+ "profile:core",
23
+ "profile:steps",
24
+ "profile:web",
25
+ ]
26
+
27
+ [modules.cf-ontology]
28
+ path = "sandcastle/cf_ontology"
29
+ aliases = ["cf_ontology", "ontology"]
30
+ editable = true
31
+ native_prereqs = false
32
+ engine_build = false
33
+ web_build = false
34
+ depends_on = []
35
+
36
+ [modules.cf-datahive]
37
+ path = "sandcastle/cf_datahive"
38
+ aliases = ["cf_datahive", "datahive"]
39
+ editable = true
40
+ native_prereqs = true
41
+ engine_build = false
42
+ web_build = false
43
+ depends_on = []
44
+
45
+ [modules.cf-opcua-server]
46
+ path = "sandcastle/cf_opcua_server"
47
+ aliases = ["cf_opcua_server", "opcua-server"]
48
+ editable = true
49
+ native_prereqs = false
50
+ engine_build = false
51
+ web_build = false
52
+ depends_on = []
53
+
54
+ [modules.cf-pipeline-cert]
55
+ path = "sandcastle/cf_pipeline/cf_pipeline_cert"
56
+ aliases = ["cf_pipeline_cert", "pipeline-cert"]
57
+ editable = true
58
+ native_prereqs = false
59
+ engine_build = false
60
+ web_build = false
61
+ depends_on = []
62
+
63
+ [modules.cf-pipeline-report]
64
+ path = "sandcastle/cf_pipeline/cf_pipeline_report"
65
+ aliases = ["cf_pipeline_report", "pipeline-report", "report"]
66
+ editable = true
67
+ native_prereqs = false
68
+ engine_build = false
69
+ web_build = false
70
+ depends_on = []
71
+
72
+ [modules.cf-pipeline-sdk]
73
+ path = "sandcastle/cf_pipeline/cf_pipeline_sdk"
74
+ aliases = ["cf_pipeline_sdk", "pipeline-sdk", "sdk"]
75
+ editable = true
76
+ native_prereqs = true
77
+ engine_build = false
78
+ web_build = false
79
+ depends_on = ["cf-ontology"]
80
+
81
+ [modules.cf-pipeline-engine]
82
+ path = "sandcastle/cf_pipeline/cf_pipeline_engine"
83
+ aliases = ["cf_pipeline_engine", "pipeline-engine", "engine"]
84
+ editable = true
85
+ native_prereqs = true
86
+ engine_build = true
87
+ web_build = false
88
+ depends_on = ["cf-datahive", "cf-opcua-server", "cf-pipeline-sdk", "cf-ontology"]
89
+
90
+ [modules.cf-core-cli]
91
+ path = "sandcastle/cf_cli"
92
+ aliases = ["cf-cli", "cf_core_cli", "cli"]
93
+ editable = true
94
+ native_prereqs = false
95
+ engine_build = false
96
+ web_build = false
97
+ depends_on = []
98
+
99
+ [modules.cf-basic-dev]
100
+ path = "sandcastle/cf_basic_steps/cf_basic_dev"
101
+ aliases = ["cf_basic_dev", "basic-dev"]
102
+ editable = true
103
+ native_prereqs = false
104
+ engine_build = false
105
+ web_build = false
106
+ depends_on = ["cf-ontology"]
107
+
108
+ [modules.cf-basic-io]
109
+ path = "sandcastle/cf_basic_steps/cf_basic_io"
110
+ aliases = ["cf_basic_io", "basic-io"]
111
+ editable = true
112
+ native_prereqs = true
113
+ engine_build = false
114
+ web_build = false
115
+ depends_on = ["cf-ontology"]
116
+
117
+ [modules.cf-basic-signal]
118
+ path = "sandcastle/cf_basic_steps/cf_basic_signal"
119
+ aliases = ["cf_basic_signal", "basic-signal"]
120
+ editable = true
121
+ native_prereqs = true
122
+ engine_build = false
123
+ web_build = false
124
+ depends_on = ["cf-ontology"]
125
+
126
+ [modules.cf-basic-sinks]
127
+ path = "sandcastle/cf_basic_steps/cf_basic_sinks"
128
+ aliases = ["cf_basic_sinks", "basic-sinks"]
129
+ editable = true
130
+ native_prereqs = false
131
+ engine_build = false
132
+ web_build = false
133
+ depends_on = []
134
+
135
+ [modules.cf-web]
136
+ path = "sandcastle/cf_web"
137
+ aliases = ["cf_web", "web"]
138
+ editable = true
139
+ native_prereqs = false
140
+ engine_build = false
141
+ web_build = true
142
+ depends_on = ["cf-ontology", "cf-pipeline-engine"]
143
+
144
+ [[hooks]]
145
+ id = "ingest-installed-steps"
146
+ when = "post_install"
147
+ action = "cf_ontology_ingest_installed_steps"
148
+ requires_modules = ["cf-ontology"]