docwright 0.1.8__tar.gz → 0.1.9__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.
- {docwright-0.1.8 → docwright-0.1.9}/PKG-INFO +1 -1
- {docwright-0.1.8 → docwright-0.1.9}/docwright/cli.py +17 -14
- {docwright-0.1.8 → docwright-0.1.9}/pyproject.toml +1 -1
- {docwright-0.1.8 → docwright-0.1.9}/LICENSE +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/README.md +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/__init__.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/analyzer.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/__init__.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/readme/__init__.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/readme/default.md.j2 +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/__init__.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/adr.md.j2 +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/api-contracts.md.j2 +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/architecture.md.j2 +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/data-model.md.j2 +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/db-schema.md.j2 +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/development-guide.md.j2 +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/home.md.j2 +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/integrations.md.j2 +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/operations.md.j2 +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/security.md.j2 +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/troubleshooting.md.j2 +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/config.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/engine.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/outputs/__init__.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/outputs/base.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/outputs/direct.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/outputs/factory.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/outputs/gitlab_wiki.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/outputs/pull_request.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/providers/__init__.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/providers/base.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/providers/claude.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/providers/factory.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/providers/ollama.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/providers/openai.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/registry.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/renderer.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/reporters/__init__.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/reporters/html.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/reporters/terminal.py +0 -0
- {docwright-0.1.8 → docwright-0.1.9}/docwright/scaffolder.py +0 -0
|
@@ -22,32 +22,33 @@ def get_repo_root() -> Path:
|
|
|
22
22
|
return Path.cwd()
|
|
23
23
|
|
|
24
24
|
|
|
25
|
+
def load_dotenv(repo_root: Path) -> None:
|
|
26
|
+
env_file = repo_root / ".docwright" / ".env"
|
|
27
|
+
if env_file.exists():
|
|
28
|
+
for line in env_file.read_text().splitlines():
|
|
29
|
+
line = line.strip()
|
|
30
|
+
if line and not line.startswith("#") and "=" in line:
|
|
31
|
+
key, _, value = line.partition("=")
|
|
32
|
+
if key not in os.environ:
|
|
33
|
+
os.environ[key] = value
|
|
34
|
+
|
|
35
|
+
|
|
25
36
|
def build_engine(repo_root: Path) -> DocsEngine:
|
|
37
|
+
load_dotenv(repo_root)
|
|
26
38
|
config = Config.load(repo_root)
|
|
27
39
|
provider = build_provider(config.provider)
|
|
28
40
|
output = build_output(config.output, repo_root)
|
|
29
41
|
return DocsEngine(repo_root=repo_root, provider=provider, output=output)
|
|
30
42
|
|
|
31
43
|
|
|
32
|
-
def ensure_gitignore_has_env(repo_root: Path) -> None:
|
|
33
|
-
gitignore = repo_root / ".gitignore"
|
|
34
|
-
if gitignore.exists():
|
|
35
|
-
content = gitignore.read_text()
|
|
36
|
-
if ".env" in content.splitlines():
|
|
37
|
-
return
|
|
38
|
-
gitignore.write_text(content.rstrip("\n") + "\n.env\n")
|
|
39
|
-
else:
|
|
40
|
-
gitignore.write_text(".env\n")
|
|
41
|
-
|
|
42
|
-
|
|
43
44
|
def append_env_var(repo_root: Path, key: str, value: str) -> None:
|
|
44
|
-
env_file = repo_root / ".env"
|
|
45
|
+
env_file = repo_root / ".docwright" / ".env"
|
|
46
|
+
env_file.parent.mkdir(parents=True, exist_ok=True)
|
|
45
47
|
existing = env_file.read_text() if env_file.exists() else ""
|
|
46
48
|
lines = existing.splitlines()
|
|
47
49
|
filtered = [ln for ln in lines if not ln.startswith(f"{key}=")]
|
|
48
50
|
filtered.append(f"{key}={value}")
|
|
49
51
|
env_file.write_text("\n".join(filtered) + "\n")
|
|
50
|
-
ensure_gitignore_has_env(repo_root)
|
|
51
52
|
os.environ[key] = value
|
|
52
53
|
|
|
53
54
|
|
|
@@ -252,7 +253,9 @@ def run(dry_run: bool) -> None:
|
|
|
252
253
|
"""Incrementally update documentation based on recent git diff."""
|
|
253
254
|
repo_root = get_repo_root()
|
|
254
255
|
Config.migrate_if_needed(repo_root)
|
|
255
|
-
base_sha =
|
|
256
|
+
base_sha = (
|
|
257
|
+
os.environ.get("DOCWRIGHT_BASE_SHA") or os.environ.get("CI_COMMIT_BEFORE_SHA") or "HEAD~1"
|
|
258
|
+
)
|
|
256
259
|
try:
|
|
257
260
|
diff_text = subprocess.check_output(
|
|
258
261
|
["git", "diff", f"{base_sha}..HEAD"], cwd=repo_root
|
|
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
|
{docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/development-guide.md.j2
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
|
|
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
|