pythia-plsql 0.4.3__tar.gz → 0.4.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.
- {pythia_plsql-0.4.3/scripts/pythia_plsql.egg-info → pythia_plsql-0.4.5}/PKG-INFO +2 -2
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/README.md +1 -1
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/pyproject.toml +1 -1
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/scripts/pythia.py +49 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5/scripts/pythia_plsql.egg-info}/PKG-INFO +2 -2
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/tests/test_install.py +52 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/LICENSE +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/queries/compile-errors.sql +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/queries/dependencies.sql +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/queries/impact.sql +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/queries/invalid-objects.sql +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/queries/name-occupants.sql +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/queries/object-source.sql +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/queries/plscope-enabled.sql +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/queries/plscope-statements.sql +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/queries/plscope-usages.sql +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/queries/session-privileges.sql +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/queries/similar-candidates.sql +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/queries/source.sql +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/scripts/pythia_plsql.egg-info/SOURCES.txt +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/scripts/pythia_plsql.egg-info/dependency_links.txt +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/scripts/pythia_plsql.egg-info/entry_points.txt +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/scripts/pythia_plsql.egg-info/requires.txt +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/scripts/pythia_plsql.egg-info/top_level.txt +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/setup.cfg +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/skills/pythia-apply/SKILL.md +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/skills/pythia-explore/SKILL.md +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/skills/pythia-explore/reference/data-dictionary.md +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/skills/pythia-impact/SKILL.md +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/skills/pythia-review/SKILL.md +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/skills/pythia-review/reference/antipatterns.md +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/skills/pythia-setup/SKILL.md +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/skills/pythia-skill-author/SKILL.md +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/skills/pythia-write/SKILL.md +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/skills/pythia-write/reference/patterns.md +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/tests/test_phase1.py +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/tests/test_phase2.py +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/tests/test_phase3.py +0 -0
- {pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/tests/test_phase5.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythia-plsql
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.5
|
|
4
4
|
Summary: PL/SQL development for AI agents on Oracle Database - expert data-dictionary queries, impact analysis, and a snapshot-verified write path with honest rollback.
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/thaildhe172591/pythia
|
|
@@ -75,7 +75,7 @@ Or the same thing piecewise:
|
|
|
75
75
|
|
|
76
76
|
```bash
|
|
77
77
|
pip install pythia-plsql # the CLI (thin driver — no Oracle Instant Client needed)
|
|
78
|
-
pythia install
|
|
78
|
+
python -m pythia install # skills into your agent + .pythia/ scaffold
|
|
79
79
|
pythia check # fill in connections.json first, then verify
|
|
80
80
|
```
|
|
81
81
|
|
|
@@ -61,7 +61,7 @@ Or the same thing piecewise:
|
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
63
|
pip install pythia-plsql # the CLI (thin driver — no Oracle Instant Client needed)
|
|
64
|
-
pythia install
|
|
64
|
+
python -m pythia install # skills into your agent + .pythia/ scaffold
|
|
65
65
|
pythia check # fill in connections.json first, then verify
|
|
66
66
|
```
|
|
67
67
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pythia-plsql"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.5"
|
|
8
8
|
description = "PL/SQL development for AI agents on Oracle Database - expert data-dictionary queries, impact analysis, and a snapshot-verified write path with honest rollback."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -185,6 +185,49 @@ def paint_diff_line(ln, enabled):
|
|
|
185
185
|
return ln
|
|
186
186
|
|
|
187
187
|
|
|
188
|
+
def installed_scripts_dir():
|
|
189
|
+
"""The directory pip put our executable in. The default scheme is wrong
|
|
190
|
+
for `pip install --user` — the common case on Windows — so the candidate
|
|
191
|
+
that actually holds the executable wins."""
|
|
192
|
+
import sysconfig
|
|
193
|
+
candidates = [sysconfig.get_path("scripts")]
|
|
194
|
+
try:
|
|
195
|
+
candidates.append(
|
|
196
|
+
sysconfig.get_path("scripts", sysconfig.get_preferred_scheme("user")))
|
|
197
|
+
except (AttributeError, KeyError): # very old Python: no user scheme
|
|
198
|
+
pass
|
|
199
|
+
exe = "pythia.exe" if os.name == "nt" else "pythia"
|
|
200
|
+
for d in candidates:
|
|
201
|
+
if d and (pathlib.Path(d) / exe).exists():
|
|
202
|
+
return d
|
|
203
|
+
return candidates[-1] if candidates else None
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
def entry_point_hint(found, scripts_dir):
|
|
207
|
+
"""What to say when `pythia` will not resolve as a command. pip installs
|
|
208
|
+
the executable into a scripts directory that is often not on PATH — the
|
|
209
|
+
default for `pip install --user` on Windows — and the shell's
|
|
210
|
+
CommandNotFound names nothing that helps. Seen on a real machine, at the
|
|
211
|
+
step immediately after the install the docs tell you to run."""
|
|
212
|
+
if found:
|
|
213
|
+
return None
|
|
214
|
+
out = ["`pythia` is installed but not on your PATH."]
|
|
215
|
+
if scripts_dir:
|
|
216
|
+
out.append(" It lives in: " + str(scripts_dir))
|
|
217
|
+
if os.name == "nt":
|
|
218
|
+
out.append(" Add it once, in PowerShell, then reopen the terminal:")
|
|
219
|
+
out.append(" [Environment]::SetEnvironmentVariable('PATH',")
|
|
220
|
+
out.append(" \"$env:PATH;" + str(scripts_dir) + "\", 'User')")
|
|
221
|
+
else:
|
|
222
|
+
out.append(" Add it to your shell profile:")
|
|
223
|
+
out.append(" export PATH=\"$PATH:" + str(scripts_dir) + "\"")
|
|
224
|
+
else:
|
|
225
|
+
out.append(" Add pip's scripts directory to PATH.")
|
|
226
|
+
out.append("Either way, this works right now, PATH or no PATH:")
|
|
227
|
+
out.append(" " + pathlib.Path(sys.executable).stem + " -m pythia <command>")
|
|
228
|
+
return "\n".join(out)
|
|
229
|
+
|
|
230
|
+
|
|
188
231
|
def invocation():
|
|
189
232
|
"""How to invoke this tool, exactly as the user actually ran it. Every
|
|
190
233
|
printed command must be paste-able: a bare `pythia ...` is
|
|
@@ -1893,6 +1936,7 @@ def clean_legacy_skills(base_dir):
|
|
|
1893
1936
|
|
|
1894
1937
|
|
|
1895
1938
|
def cmd_install(conn, schema, ns):
|
|
1939
|
+
import shutil
|
|
1896
1940
|
en = getattr(ns, "color", False)
|
|
1897
1941
|
if en:
|
|
1898
1942
|
sys.stdout.write(banner(en))
|
|
@@ -1930,6 +1974,11 @@ def cmd_install(conn, schema, ns):
|
|
|
1930
1974
|
clean_legacy_skills(ns.project_root)
|
|
1931
1975
|
print(f"\nNext: fill in {path}")
|
|
1932
1976
|
print(f"Then: {invocation()} check")
|
|
1977
|
+
hint = entry_point_hint(shutil.which("pythia"),
|
|
1978
|
+
installed_scripts_dir())
|
|
1979
|
+
if hint:
|
|
1980
|
+
print()
|
|
1981
|
+
print(hint)
|
|
1933
1982
|
|
|
1934
1983
|
|
|
1935
1984
|
COMMANDS = {"check": cmd_check, "ls": cmd_ls, "src": cmd_src, "args": cmd_args,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythia-plsql
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.5
|
|
4
4
|
Summary: PL/SQL development for AI agents on Oracle Database - expert data-dictionary queries, impact analysis, and a snapshot-verified write path with honest rollback.
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/thaildhe172591/pythia
|
|
@@ -75,7 +75,7 @@ Or the same thing piecewise:
|
|
|
75
75
|
|
|
76
76
|
```bash
|
|
77
77
|
pip install pythia-plsql # the CLI (thin driver — no Oracle Instant Client needed)
|
|
78
|
-
pythia install
|
|
78
|
+
python -m pythia install # skills into your agent + .pythia/ scaffold
|
|
79
79
|
pythia check # fill in connections.json first, then verify
|
|
80
80
|
```
|
|
81
81
|
|
|
@@ -183,6 +183,58 @@ def test_one_version_across_every_manifest():
|
|
|
183
183
|
assert "oracledb" in pyproject
|
|
184
184
|
|
|
185
185
|
|
|
186
|
+
def test_entry_point_hint_names_the_directory_to_add():
|
|
187
|
+
"""pip install --user on Windows puts pythia.exe in a Scripts directory
|
|
188
|
+
that is not on PATH, so the very next documented command fails with
|
|
189
|
+
CommandNotFound -- naming nothing that helps. Seen on a real machine."""
|
|
190
|
+
hint = pythia.entry_point_hint(found=None, scripts_dir=r"C:\Py\Scripts")
|
|
191
|
+
assert hint is not None
|
|
192
|
+
assert r"C:\Py\Scripts" in hint # the exact directory to add
|
|
193
|
+
assert "-m pythia" in hint # the fallback that works now
|
|
194
|
+
# once the command resolves, say nothing
|
|
195
|
+
assert pythia.entry_point_hint(found="/usr/local/bin/pythia",
|
|
196
|
+
scripts_dir="/usr/local/bin") is None
|
|
197
|
+
# cannot locate the directory: still offer the fallback, claim nothing else
|
|
198
|
+
hint = pythia.entry_point_hint(found=None, scripts_dir=None)
|
|
199
|
+
assert "-m pythia" in hint and "PATH" in hint
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def test_scripts_dir_prefers_where_the_executable_really_is():
|
|
203
|
+
import sysconfig
|
|
204
|
+
user = sysconfig.get_path("scripts", sysconfig.get_preferred_scheme("user"))
|
|
205
|
+
# whichever candidate holds the executable wins; with none holding it the
|
|
206
|
+
# answer is the user scheme, which is where pip --user puts it
|
|
207
|
+
assert pythia.installed_scripts_dir() in (
|
|
208
|
+
sysconfig.get_path("scripts"), user, None)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def test_cmd_install_runs_end_to_end():
|
|
212
|
+
"""The unit tests exercised the hint functions but never cmd_install
|
|
213
|
+
itself, so a missing `import shutil` inside it reached CI. Run the whole
|
|
214
|
+
command against a temp project: it must scaffold and not raise."""
|
|
215
|
+
import argparse
|
|
216
|
+
import contextlib
|
|
217
|
+
import io
|
|
218
|
+
import os
|
|
219
|
+
with tempfile.TemporaryDirectory() as td:
|
|
220
|
+
ns = argparse.Namespace(project_root=td, glob=False, source=None,
|
|
221
|
+
color=False, json=False)
|
|
222
|
+
buf = io.StringIO()
|
|
223
|
+
env = dict(os.environ, PATH="") # no npx: take the bundled path
|
|
224
|
+
old = os.environ.get("PATH")
|
|
225
|
+
os.environ["PATH"] = ""
|
|
226
|
+
try:
|
|
227
|
+
with contextlib.redirect_stdout(buf):
|
|
228
|
+
pythia.cmd_install(None, None, ns)
|
|
229
|
+
finally:
|
|
230
|
+
if old is not None:
|
|
231
|
+
os.environ["PATH"] = old
|
|
232
|
+
out = buf.getvalue()
|
|
233
|
+
assert (pathlib.Path(td) / ".pythia" / "connections.json").is_file()
|
|
234
|
+
assert "Next: fill in" in out
|
|
235
|
+
assert env is not None
|
|
236
|
+
|
|
237
|
+
|
|
186
238
|
def main():
|
|
187
239
|
failed = 0
|
|
188
240
|
for name, fn in sorted(globals().items()):
|
|
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
|
{pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/scripts/pythia_plsql.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pythia_plsql-0.4.3 → pythia_plsql-0.4.5}/skills/pythia-explore/reference/data-dictionary.md
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
|