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.
Files changed (42) hide show
  1. {docwright-0.1.8 → docwright-0.1.9}/PKG-INFO +1 -1
  2. {docwright-0.1.8 → docwright-0.1.9}/docwright/cli.py +17 -14
  3. {docwright-0.1.8 → docwright-0.1.9}/pyproject.toml +1 -1
  4. {docwright-0.1.8 → docwright-0.1.9}/LICENSE +0 -0
  5. {docwright-0.1.8 → docwright-0.1.9}/README.md +0 -0
  6. {docwright-0.1.8 → docwright-0.1.9}/docwright/__init__.py +0 -0
  7. {docwright-0.1.8 → docwright-0.1.9}/docwright/analyzer.py +0 -0
  8. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/__init__.py +0 -0
  9. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/readme/__init__.py +0 -0
  10. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/readme/default.md.j2 +0 -0
  11. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/__init__.py +0 -0
  12. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/adr.md.j2 +0 -0
  13. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/api-contracts.md.j2 +0 -0
  14. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/architecture.md.j2 +0 -0
  15. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/data-model.md.j2 +0 -0
  16. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/db-schema.md.j2 +0 -0
  17. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/development-guide.md.j2 +0 -0
  18. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/home.md.j2 +0 -0
  19. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/integrations.md.j2 +0 -0
  20. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/operations.md.j2 +0 -0
  21. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/security.md.j2 +0 -0
  22. {docwright-0.1.8 → docwright-0.1.9}/docwright/built_in_templates/wiki/troubleshooting.md.j2 +0 -0
  23. {docwright-0.1.8 → docwright-0.1.9}/docwright/config.py +0 -0
  24. {docwright-0.1.8 → docwright-0.1.9}/docwright/engine.py +0 -0
  25. {docwright-0.1.8 → docwright-0.1.9}/docwright/outputs/__init__.py +0 -0
  26. {docwright-0.1.8 → docwright-0.1.9}/docwright/outputs/base.py +0 -0
  27. {docwright-0.1.8 → docwright-0.1.9}/docwright/outputs/direct.py +0 -0
  28. {docwright-0.1.8 → docwright-0.1.9}/docwright/outputs/factory.py +0 -0
  29. {docwright-0.1.8 → docwright-0.1.9}/docwright/outputs/gitlab_wiki.py +0 -0
  30. {docwright-0.1.8 → docwright-0.1.9}/docwright/outputs/pull_request.py +0 -0
  31. {docwright-0.1.8 → docwright-0.1.9}/docwright/providers/__init__.py +0 -0
  32. {docwright-0.1.8 → docwright-0.1.9}/docwright/providers/base.py +0 -0
  33. {docwright-0.1.8 → docwright-0.1.9}/docwright/providers/claude.py +0 -0
  34. {docwright-0.1.8 → docwright-0.1.9}/docwright/providers/factory.py +0 -0
  35. {docwright-0.1.8 → docwright-0.1.9}/docwright/providers/ollama.py +0 -0
  36. {docwright-0.1.8 → docwright-0.1.9}/docwright/providers/openai.py +0 -0
  37. {docwright-0.1.8 → docwright-0.1.9}/docwright/registry.py +0 -0
  38. {docwright-0.1.8 → docwright-0.1.9}/docwright/renderer.py +0 -0
  39. {docwright-0.1.8 → docwright-0.1.9}/docwright/reporters/__init__.py +0 -0
  40. {docwright-0.1.8 → docwright-0.1.9}/docwright/reporters/html.py +0 -0
  41. {docwright-0.1.8 → docwright-0.1.9}/docwright/reporters/terminal.py +0 -0
  42. {docwright-0.1.8 → docwright-0.1.9}/docwright/scaffolder.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: docwright
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: AI-powered documentation agent: auto-generates and maintains README & wiki on every commit
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -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 = os.environ.get("AI_DOCGEN_BASE_SHA", "HEAD~1")
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
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "docwright"
3
- version = "0.1.8"
3
+ version = "0.1.9"
4
4
  description = "AI-powered documentation agent: auto-generates and maintains README & wiki on every commit"
5
5
  authors = ["Artem Gotlib <gotlib.artem.m@gmail.com>"]
6
6
  license = "MIT"
File without changes
File without changes
File without changes
File without changes