datasecops-cli 0.2.3__tar.gz → 0.2.5__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.
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/CHANGELOG.md +13 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/PKG-INFO +1 -1
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/pyproject.toml +1 -1
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/menus/development.py +5 -3
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/menus/downloads.py +1 -1
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/services/bootstrap_service.py +2 -2
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/services/download_service.py +2 -2
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/services/linting_service.py +37 -7
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/.github/workflows/publish-cli.yml +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/.gitignore +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/DEVELOPMENT.md +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/LICENSE +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/README.md +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/docs/getting-started.md +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/docs/legacy.md +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/docs/legacy_plan_of_action.md +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/docs/mcp-server.md +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/mcp-servers.json +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/setup.ps1 +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/setup.sh +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/__init__.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/config.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/main.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/menus/__init__.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/menus/git_operations.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/models/__init__.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/models/git_helpers.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/models/project_config.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/services/__init__.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/services/dbt_runner.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/services/git_service.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/services/skill_service.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/services/snowflake_service.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/utilities/__init__.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/utilities/display.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/utilities/file_utils.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/utilities/yaml_utils.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_mcp/__init__.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_mcp/__main__.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_mcp/connection.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_mcp/server.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/tests/__init__.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/tests/test_config.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/tests/test_file_utils.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/tests/test_models.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/tests/test_version.py +0 -0
- {datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/tests/test_yaml_utils.py +0 -0
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the DataSecOps CLI are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.2.5] - 2026-05-11
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **`.sqlfluff` now written to the dbt project directory** instead of the repo root — `download_sqlfluff_config()` accepts a `dbt_project_dir` parameter and all callers (lint menu, downloads menu, bootstrap) pass the resolved dbt directory so the config lands alongside `dbt_project.yml` where sqlfluff expects it
|
|
10
|
+
|
|
11
|
+
## [0.2.4] - 2026-05-11
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **Use `uv pip` instead of `pip`** for all package operations — `get_installed_versions()`, `install_requirements()`, and bootstrap hints now use `uv pip show` / `uv pip install` to match the framework's `uv`-based toolchain
|
|
16
|
+
- **Pin sqlfluff versions from native app** — the lint menu now fetches the framework-mandated `sqlfluff` and `sqlfluff-templater-dbt` versions from `DBT_VERSIONS` config and installs/upgrades to those exact versions before linting
|
|
17
|
+
|
|
5
18
|
## [0.2.3] - 2026-05-11
|
|
6
19
|
|
|
7
20
|
### Fixed
|
|
@@ -141,16 +141,18 @@ class DevelopmentMenu:
|
|
|
141
141
|
complete_action()
|
|
142
142
|
|
|
143
143
|
def _ensure_sqlfluff_config(self) -> bool:
|
|
144
|
-
"""Download .sqlfluff from the framework if it doesn't exist locally, and ensure
|
|
144
|
+
"""Download .sqlfluff from the framework if it doesn't exist locally, and ensure correct versions are installed."""
|
|
145
145
|
config_path = self.linting.project_dir / ".sqlfluff"
|
|
146
146
|
if not config_path.exists():
|
|
147
147
|
if not self.downloads:
|
|
148
148
|
error_line("No .sqlfluff config found and download service not available")
|
|
149
149
|
return False
|
|
150
150
|
info_line("No .sqlfluff config found — downloading from framework...")
|
|
151
|
-
if not self.downloads.download_sqlfluff_config(profiles_dir=self.profiles_dir):
|
|
151
|
+
if not self.downloads.download_sqlfluff_config(profiles_dir=self.profiles_dir, dbt_project_dir=self.linting.project_dir):
|
|
152
152
|
return False
|
|
153
|
-
|
|
153
|
+
# Fetch pinned versions from the native app and ensure they're installed
|
|
154
|
+
required = self.downloads.get_sqlfluff_requirements() if self.downloads else None
|
|
155
|
+
return self.linting.ensure_templater_installed(required_packages=required or None)
|
|
154
156
|
|
|
155
157
|
def _lint_menu(self) -> None:
|
|
156
158
|
clear()
|
|
@@ -30,7 +30,7 @@ class DownloadsMenu:
|
|
|
30
30
|
if option == 1:
|
|
31
31
|
display_action_header("Download SQLFluff Config")
|
|
32
32
|
profiles_dir = str(Path(self.project_settings.profile_dir).expanduser()) if self.project_settings else None
|
|
33
|
-
self.downloads.download_sqlfluff_config(profiles_dir=profiles_dir)
|
|
33
|
+
self.downloads.download_sqlfluff_config(profiles_dir=profiles_dir, dbt_project_dir=self.dbt_project_dir)
|
|
34
34
|
complete_action()
|
|
35
35
|
elif option == 2:
|
|
36
36
|
display_action_header("Download Pipeline Files")
|
{datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/services/bootstrap_service.py
RENAMED
|
@@ -69,7 +69,7 @@ class BootstrapService:
|
|
|
69
69
|
info_line("")
|
|
70
70
|
info_line("[3] Downloading SQLFluff configuration...")
|
|
71
71
|
profiles_dir = str(Path(self.project_settings.profile_dir).expanduser())
|
|
72
|
-
if self.download_service.download_sqlfluff_config(profiles_dir=profiles_dir):
|
|
72
|
+
if self.download_service.download_sqlfluff_config(profiles_dir=profiles_dir, dbt_project_dir=dbt_project_dir):
|
|
73
73
|
steps_passed += 1
|
|
74
74
|
else:
|
|
75
75
|
info_line(" (skipped - no SQLFluff config in native app)")
|
|
@@ -116,7 +116,7 @@ class BootstrapService:
|
|
|
116
116
|
requirements = self.download_service.get_sqlfluff_requirements()
|
|
117
117
|
if requirements:
|
|
118
118
|
info_line(f" Required: {', '.join(requirements)}")
|
|
119
|
-
info_line(" (install with: pip install " + " ".join(requirements) + ")")
|
|
119
|
+
info_line(" (install with: uv pip install " + " ".join(requirements) + ")")
|
|
120
120
|
steps_passed += 1
|
|
121
121
|
|
|
122
122
|
# Step 8: Install Cortex Code skills
|
{datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/services/download_service.py
RENAMED
|
@@ -95,7 +95,7 @@ class DownloadService:
|
|
|
95
95
|
lines.append(f"{key} = {DownloadService._format_value(val)}")
|
|
96
96
|
lines.append("")
|
|
97
97
|
|
|
98
|
-
def download_sqlfluff_config(self, profiles_dir: str = None) -> bool:
|
|
98
|
+
def download_sqlfluff_config(self, profiles_dir: str = None, dbt_project_dir: Path = None) -> bool:
|
|
99
99
|
info_line("Downloading SQLFluff configuration...")
|
|
100
100
|
raw = self.sf.get_framework_config("SQLFLUFF_RULES")
|
|
101
101
|
if not raw:
|
|
@@ -163,7 +163,7 @@ class DownloadService:
|
|
|
163
163
|
self._emit_section(lines, f"sqlfluff:rules:{section_name}", opts)
|
|
164
164
|
|
|
165
165
|
content = "\n".join(lines)
|
|
166
|
-
dest = self.project_dir / ".sqlfluff"
|
|
166
|
+
dest = (dbt_project_dir or self.project_dir) / ".sqlfluff"
|
|
167
167
|
write_file(dest, content)
|
|
168
168
|
success_line(f"SQLFluff config written to {dest}")
|
|
169
169
|
return True
|
{datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/services/linting_service.py
RENAMED
|
@@ -15,7 +15,7 @@ class LintingService:
|
|
|
15
15
|
versions = {}
|
|
16
16
|
for package in ["sqlfluff", "sqlfluff-templater-dbt"]:
|
|
17
17
|
result = subprocess.run(
|
|
18
|
-
["pip", "show", package],
|
|
18
|
+
["uv", "pip", "show", package],
|
|
19
19
|
capture_output=True, text=True
|
|
20
20
|
)
|
|
21
21
|
if result.returncode == 0:
|
|
@@ -33,20 +33,50 @@ class LintingService:
|
|
|
33
33
|
warning_line("No packages to install")
|
|
34
34
|
return False
|
|
35
35
|
|
|
36
|
-
cmd = ["pip", "install"] + packages
|
|
36
|
+
cmd = ["uv", "pip", "install"] + packages
|
|
37
37
|
info_line(f"Installing: {', '.join(packages)}")
|
|
38
38
|
result = subprocess.run(cmd, capture_output=False)
|
|
39
39
|
if result.returncode == 0:
|
|
40
40
|
success_line("SQLFluff requirements installed successfully")
|
|
41
41
|
return True
|
|
42
42
|
else:
|
|
43
|
-
error_line(f"pip install failed with exit code {result.returncode}")
|
|
43
|
+
error_line(f"uv pip install failed with exit code {result.returncode}")
|
|
44
44
|
return False
|
|
45
45
|
|
|
46
|
-
def ensure_templater_installed(self) -> bool:
|
|
47
|
-
"""Check
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
def ensure_templater_installed(self, required_packages: list[str] = None) -> bool:
|
|
47
|
+
"""Check sqlfluff packages are installed at the required versions.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
required_packages: Pinned packages from the framework, e.g. ["sqlfluff==3.4.0", "sqlfluff-templater-dbt==3.4.0"].
|
|
51
|
+
If None, just checks that the packages are present (any version).
|
|
52
|
+
"""
|
|
53
|
+
installed = self.get_installed_versions()
|
|
54
|
+
|
|
55
|
+
if required_packages:
|
|
56
|
+
# Build a map of package -> required version from "pkg==ver" strings
|
|
57
|
+
required: dict[str, str | None] = {}
|
|
58
|
+
for spec in required_packages:
|
|
59
|
+
if "==" in spec:
|
|
60
|
+
name, ver = spec.split("==", 1)
|
|
61
|
+
required[name] = ver
|
|
62
|
+
else:
|
|
63
|
+
required[spec] = None
|
|
64
|
+
|
|
65
|
+
to_install: list[str] = []
|
|
66
|
+
for name, req_ver in required.items():
|
|
67
|
+
cur_ver = installed.get(name)
|
|
68
|
+
if not cur_ver:
|
|
69
|
+
to_install.append(f"{name}=={req_ver}" if req_ver else name)
|
|
70
|
+
elif req_ver and cur_ver != req_ver:
|
|
71
|
+
info_line(f" {name}: installed {cur_ver}, framework requires {req_ver}")
|
|
72
|
+
to_install.append(f"{name}=={req_ver}")
|
|
73
|
+
|
|
74
|
+
if not to_install:
|
|
75
|
+
return True
|
|
76
|
+
return self.install_requirements(to_install)
|
|
77
|
+
|
|
78
|
+
# No pinned versions — just ensure packages are present
|
|
79
|
+
missing = [pkg for pkg in ["sqlfluff", "sqlfluff-templater-dbt"] if not installed.get(pkg)]
|
|
50
80
|
if not missing:
|
|
51
81
|
return True
|
|
52
82
|
warning_line(f"Missing packages: {', '.join(missing)}")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datasecops_cli-0.2.3 → datasecops_cli-0.2.5}/src/datasecops_cli/services/snowflake_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|