irminsul 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.
Files changed (121) hide show
  1. irminsul-0.1.0/.github/workflows/ci.yml +74 -0
  2. irminsul-0.1.0/.github/workflows/release.yml +90 -0
  3. irminsul-0.1.0/.gitignore +68 -0
  4. irminsul-0.1.0/.pre-commit-config.yaml +35 -0
  5. irminsul-0.1.0/Dockerfile +33 -0
  6. irminsul-0.1.0/LICENSE +661 -0
  7. irminsul-0.1.0/PKG-INFO +96 -0
  8. irminsul-0.1.0/README.md +50 -0
  9. irminsul-0.1.0/action.yml +40 -0
  10. irminsul-0.1.0/docs/00-foundation/principles.md +33 -0
  11. irminsul-0.1.0/docs/10-architecture/overview.md +46 -0
  12. irminsul-0.1.0/docs/20-components/INDEX.md +23 -0
  13. irminsul-0.1.0/docs/20-components/checks.md +27 -0
  14. irminsul-0.1.0/docs/20-components/cli.md +24 -0
  15. irminsul-0.1.0/docs/20-components/config.md +19 -0
  16. irminsul-0.1.0/docs/20-components/docgraph.md +25 -0
  17. irminsul-0.1.0/docs/20-components/frontmatter.md +21 -0
  18. irminsul-0.1.0/docs/20-components/init.md +21 -0
  19. irminsul-0.1.0/docs/20-components/languages.md +23 -0
  20. irminsul-0.1.0/docs/20-components/render.md +21 -0
  21. irminsul-0.1.0/docs/30-workflows/INDEX.md +14 -0
  22. irminsul-0.1.0/docs/40-reference/INDEX.md +14 -0
  23. irminsul-0.1.0/docs/50-decisions/0001-adopt-irminsul.md +38 -0
  24. irminsul-0.1.0/docs/50-decisions/INDEX.md +14 -0
  25. irminsul-0.1.0/docs/60-operations/INDEX.md +14 -0
  26. irminsul-0.1.0/docs/70-knowledge/INDEX.md +14 -0
  27. irminsul-0.1.0/docs/80-evolution/INDEX.md +14 -0
  28. irminsul-0.1.0/docs/90-meta/INDEX.md +14 -0
  29. irminsul-0.1.0/docs/90-meta/doc-system.md +699 -0
  30. irminsul-0.1.0/docs/CONTRIBUTING.md +12 -0
  31. irminsul-0.1.0/docs/GLOSSARY.md +18 -0
  32. irminsul-0.1.0/docs/README.md +18 -0
  33. irminsul-0.1.0/irminsul.toml +12 -0
  34. irminsul-0.1.0/pyproject.toml +109 -0
  35. irminsul-0.1.0/src/irminsul/__init__.py +10 -0
  36. irminsul-0.1.0/src/irminsul/_version.py +24 -0
  37. irminsul-0.1.0/src/irminsul/checks/__init__.py +31 -0
  38. irminsul-0.1.0/src/irminsul/checks/base.py +61 -0
  39. irminsul-0.1.0/src/irminsul/checks/frontmatter.py +66 -0
  40. irminsul-0.1.0/src/irminsul/checks/globs.py +76 -0
  41. irminsul-0.1.0/src/irminsul/checks/links.py +100 -0
  42. irminsul-0.1.0/src/irminsul/checks/schema_leak.py +98 -0
  43. irminsul-0.1.0/src/irminsul/checks/uniqueness.py +146 -0
  44. irminsul-0.1.0/src/irminsul/cli.py +230 -0
  45. irminsul-0.1.0/src/irminsul/config.py +124 -0
  46. irminsul-0.1.0/src/irminsul/docgraph.py +92 -0
  47. irminsul-0.1.0/src/irminsul/frontmatter.py +123 -0
  48. irminsul-0.1.0/src/irminsul/init/__init__.py +0 -0
  49. irminsul-0.1.0/src/irminsul/init/command.py +145 -0
  50. irminsul-0.1.0/src/irminsul/init/detector.py +65 -0
  51. irminsul-0.1.0/src/irminsul/init/scaffolds/docs/00-foundation/principles.md.j2 +28 -0
  52. irminsul-0.1.0/src/irminsul/init/scaffolds/docs/10-architecture/overview.md.j2 +26 -0
  53. irminsul-0.1.0/src/irminsul/init/scaffolds/docs/20-components/INDEX.md.j2 +16 -0
  54. irminsul-0.1.0/src/irminsul/init/scaffolds/docs/30-workflows/INDEX.md.j2 +14 -0
  55. irminsul-0.1.0/src/irminsul/init/scaffolds/docs/40-reference/INDEX.md.j2 +14 -0
  56. irminsul-0.1.0/src/irminsul/init/scaffolds/docs/50-decisions/0001-adopt-irminsul.md.j2 +35 -0
  57. irminsul-0.1.0/src/irminsul/init/scaffolds/docs/50-decisions/INDEX.md.j2 +14 -0
  58. irminsul-0.1.0/src/irminsul/init/scaffolds/docs/60-operations/INDEX.md.j2 +14 -0
  59. irminsul-0.1.0/src/irminsul/init/scaffolds/docs/70-knowledge/INDEX.md.j2 +14 -0
  60. irminsul-0.1.0/src/irminsul/init/scaffolds/docs/80-evolution/INDEX.md.j2 +14 -0
  61. irminsul-0.1.0/src/irminsul/init/scaffolds/docs/90-meta/INDEX.md.j2 +14 -0
  62. irminsul-0.1.0/src/irminsul/init/scaffolds/docs/CONTRIBUTING.md.j2 +12 -0
  63. irminsul-0.1.0/src/irminsul/init/scaffolds/docs/GLOSSARY.md.j2 +13 -0
  64. irminsul-0.1.0/src/irminsul/init/scaffolds/docs/README.md.j2 +18 -0
  65. irminsul-0.1.0/src/irminsul/init/scaffolds/irminsul.toml.j2 +12 -0
  66. irminsul-0.1.0/src/irminsul/init/workflows/docs-nightly.yml.j2 +23 -0
  67. irminsul-0.1.0/src/irminsul/init/workflows/docs-pr.yml.j2 +20 -0
  68. irminsul-0.1.0/src/irminsul/languages/__init__.py +23 -0
  69. irminsul-0.1.0/src/irminsul/languages/base.py +20 -0
  70. irminsul-0.1.0/src/irminsul/languages/python.py +25 -0
  71. irminsul-0.1.0/src/irminsul/languages/typescript.py +21 -0
  72. irminsul-0.1.0/src/irminsul/render/__init__.py +8 -0
  73. irminsul-0.1.0/src/irminsul/render/base.py +15 -0
  74. irminsul-0.1.0/src/irminsul/render/mkdocs.py +127 -0
  75. irminsul-0.1.0/tests/__init__.py +0 -0
  76. irminsul-0.1.0/tests/conftest.py +29 -0
  77. irminsul-0.1.0/tests/fixtures/repos/bad-frontmatter/app/.gitkeep +0 -0
  78. irminsul-0.1.0/tests/fixtures/repos/bad-frontmatter/docs/20-components/bad-tier.md +13 -0
  79. irminsul-0.1.0/tests/fixtures/repos/bad-frontmatter/docs/20-components/missing-audience.md +12 -0
  80. irminsul-0.1.0/tests/fixtures/repos/bad-frontmatter/docs/20-components/no-frontmatter.md +3 -0
  81. irminsul-0.1.0/tests/fixtures/repos/bad-frontmatter/docs/20-components/renamed.md +13 -0
  82. irminsul-0.1.0/tests/fixtures/repos/bad-frontmatter/irminsul.toml +5 -0
  83. irminsul-0.1.0/tests/fixtures/repos/bad-globs/app/real.py +2 -0
  84. irminsul-0.1.0/tests/fixtures/repos/bad-globs/docs/20-components/dead-glob.md +17 -0
  85. irminsul-0.1.0/tests/fixtures/repos/bad-globs/irminsul.toml +5 -0
  86. irminsul-0.1.0/tests/fixtures/repos/bad-links/app/thing.py +2 -0
  87. irminsul-0.1.0/tests/fixtures/repos/bad-links/docs/20-components/linker.md +23 -0
  88. irminsul-0.1.0/tests/fixtures/repos/bad-links/docs/20-components/neighbor.md +14 -0
  89. irminsul-0.1.0/tests/fixtures/repos/bad-links/irminsul.toml +5 -0
  90. irminsul-0.1.0/tests/fixtures/repos/bad-schema-leak/app/thing.py +2 -0
  91. irminsul-0.1.0/tests/fixtures/repos/bad-schema-leak/docs/20-components/leaky.md +37 -0
  92. irminsul-0.1.0/tests/fixtures/repos/bad-schema-leak/docs/40-reference/schema/thing.md +19 -0
  93. irminsul-0.1.0/tests/fixtures/repos/bad-schema-leak/irminsul.toml +8 -0
  94. irminsul-0.1.0/tests/fixtures/repos/bad-uniqueness/app/__init__.py +0 -0
  95. irminsul-0.1.0/tests/fixtures/repos/bad-uniqueness/app/composer.py +2 -0
  96. irminsul-0.1.0/tests/fixtures/repos/bad-uniqueness/app/stranger.py +2 -0
  97. irminsul-0.1.0/tests/fixtures/repos/bad-uniqueness/docs/20-components/composer-a.md +15 -0
  98. irminsul-0.1.0/tests/fixtures/repos/bad-uniqueness/docs/20-components/composer-b.md +15 -0
  99. irminsul-0.1.0/tests/fixtures/repos/bad-uniqueness/irminsul.toml +5 -0
  100. irminsul-0.1.0/tests/fixtures/repos/good/app/composer.py +5 -0
  101. irminsul-0.1.0/tests/fixtures/repos/good/docs/20-components/composer.md +15 -0
  102. irminsul-0.1.0/tests/fixtures/repos/good/irminsul.toml +5 -0
  103. irminsul-0.1.0/tests/fixtures/repos/specificity/app/planner/handler.py +2 -0
  104. irminsul-0.1.0/tests/fixtures/repos/specificity/app/planner/routing/router.py +2 -0
  105. irminsul-0.1.0/tests/fixtures/repos/specificity/docs/20-components/planner/INDEX.md +17 -0
  106. irminsul-0.1.0/tests/fixtures/repos/specificity/docs/20-components/planner/routing.md +15 -0
  107. irminsul-0.1.0/tests/fixtures/repos/specificity/irminsul.toml +5 -0
  108. irminsul-0.1.0/tests/test_checks_frontmatter.py +42 -0
  109. irminsul-0.1.0/tests/test_checks_globs.py +63 -0
  110. irminsul-0.1.0/tests/test_checks_links.py +59 -0
  111. irminsul-0.1.0/tests/test_checks_schema_leak.py +62 -0
  112. irminsul-0.1.0/tests/test_checks_uniqueness.py +70 -0
  113. irminsul-0.1.0/tests/test_cli.py +28 -0
  114. irminsul-0.1.0/tests/test_cli_check.py +48 -0
  115. irminsul-0.1.0/tests/test_config.py +84 -0
  116. irminsul-0.1.0/tests/test_docgraph.py +61 -0
  117. irminsul-0.1.0/tests/test_frontmatter.py +116 -0
  118. irminsul-0.1.0/tests/test_init.py +85 -0
  119. irminsul-0.1.0/tests/test_init_detector.py +47 -0
  120. irminsul-0.1.0/tests/test_languages.py +46 -0
  121. irminsul-0.1.0/tests/test_render_mkdocs.py +52 -0
@@ -0,0 +1,74 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ lint:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: "3.12"
16
+ - name: Install
17
+ run: |
18
+ python -m pip install --upgrade pip
19
+ pip install -e ".[dev]"
20
+ - name: Ruff
21
+ run: ruff check .
22
+ - name: Ruff format
23
+ run: ruff format --check .
24
+
25
+ type:
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - uses: actions/setup-python@v5
30
+ with:
31
+ python-version: "3.12"
32
+ - name: Install
33
+ run: |
34
+ python -m pip install --upgrade pip
35
+ pip install -e ".[dev]"
36
+ - name: Mypy
37
+ run: mypy
38
+
39
+ test:
40
+ runs-on: ${{ matrix.os }}
41
+ strategy:
42
+ fail-fast: false
43
+ matrix:
44
+ os: [ubuntu-latest, macos-latest, windows-latest]
45
+ python-version: ["3.12", "3.13"]
46
+ steps:
47
+ - uses: actions/checkout@v4
48
+ - uses: actions/setup-python@v5
49
+ with:
50
+ python-version: ${{ matrix.python-version }}
51
+ - name: Install
52
+ run: |
53
+ python -m pip install --upgrade pip
54
+ pip install -e ".[dev]"
55
+ - name: Pytest
56
+ run: pytest -q --cov=irminsul --cov-report=term-missing
57
+
58
+ dogfood:
59
+ runs-on: ubuntu-latest
60
+ steps:
61
+ - uses: actions/checkout@v4
62
+ with:
63
+ fetch-depth: 0
64
+ - uses: actions/setup-python@v5
65
+ with:
66
+ python-version: "3.12"
67
+ - name: Install
68
+ run: |
69
+ python -m pip install --upgrade pip
70
+ pip install -e ".[mkdocs]"
71
+ - name: irminsul check (self)
72
+ run: irminsul check --scope=hard
73
+ - name: irminsul render (self)
74
+ run: irminsul render
@@ -0,0 +1,90 @@
1
+ # Release workflow.
2
+ #
3
+ # Triggers only on `v*.*.*` tag pushes. Three jobs run in parallel: PyPI
4
+ # publish via OIDC trusted publisher, ghcr.io image push, and a Homebrew tap
5
+ # bump via repository_dispatch.
6
+ #
7
+ # One-time setup before the first release:
8
+ # 1. PyPI: at https://pypi.org/manage/account/publishing/, add a trusted
9
+ # publisher for this repo and the `release.yml` workflow.
10
+ # 2. Homebrew: create a separate repo at <github-user>/homebrew-irminsul.
11
+ # Generate a fine-grained PAT with contents:write on that repo and add
12
+ # it here as the secret HOMEBREW_TAP_TOKEN.
13
+ # 3. ghcr.io: nothing — `GITHUB_TOKEN` already has the right scopes.
14
+
15
+ name: release
16
+
17
+ on:
18
+ push:
19
+ tags:
20
+ - 'v*.*.*'
21
+
22
+ permissions:
23
+ contents: read
24
+
25
+ jobs:
26
+ pypi:
27
+ name: Publish to PyPI
28
+ runs-on: ubuntu-latest
29
+ permissions:
30
+ id-token: write
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ - uses: actions/setup-python@v5
34
+ with:
35
+ python-version: '3.12'
36
+ - name: Install build tools
37
+ run: pip install --upgrade build
38
+ - name: Build wheel and sdist
39
+ run: python -m build
40
+ - name: Publish via OIDC
41
+ uses: pypa/gh-action-pypi-publish@release/v1
42
+ with:
43
+ skip-existing: true
44
+
45
+ docker:
46
+ name: Push image to ghcr.io
47
+ runs-on: ubuntu-latest
48
+ permissions:
49
+ contents: read
50
+ packages: write
51
+ steps:
52
+ - uses: actions/checkout@v4
53
+ - uses: docker/setup-buildx-action@v3
54
+ - name: Log in to ghcr.io
55
+ uses: docker/login-action@v3
56
+ with:
57
+ registry: ghcr.io
58
+ username: ${{ github.actor }}
59
+ password: ${{ secrets.GITHUB_TOKEN }}
60
+ - name: Resolve version
61
+ id: ver
62
+ run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
63
+ - name: Build and push
64
+ uses: docker/build-push-action@v6
65
+ with:
66
+ context: .
67
+ push: true
68
+ tags: |
69
+ ghcr.io/${{ github.repository_owner }}/irminsul:${{ steps.ver.outputs.version }}
70
+ ghcr.io/${{ github.repository_owner }}/irminsul:latest
71
+
72
+ homebrew:
73
+ name: Bump Homebrew tap
74
+ runs-on: ubuntu-latest
75
+ needs: pypi
76
+ steps:
77
+ - name: Resolve version
78
+ id: ver
79
+ run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
80
+ - name: Dispatch tap update
81
+ uses: peter-evans/repository-dispatch@v3
82
+ with:
83
+ token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
84
+ repository: ${{ github.repository_owner }}/homebrew-irminsul
85
+ event-type: irminsul-release
86
+ client-payload: |
87
+ {
88
+ "version": "${{ steps.ver.outputs.version }}",
89
+ "tag": "${{ github.ref_name }}"
90
+ }
@@ -0,0 +1,68 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+ MANIFEST
23
+
24
+ # Virtual environments
25
+ .venv/
26
+ venv/
27
+ env/
28
+ ENV/
29
+
30
+ # Testing & coverage
31
+ .pytest_cache/
32
+ .coverage
33
+ .coverage.*
34
+ htmlcov/
35
+ .tox/
36
+ .nox/
37
+ coverage.xml
38
+ *.cover
39
+
40
+ # Type checking
41
+ .mypy_cache/
42
+ .ruff_cache/
43
+
44
+ # Editors
45
+ .vscode/
46
+ .idea/
47
+ *.swp
48
+ *.swo
49
+ *~
50
+
51
+ # OS
52
+ .DS_Store
53
+ Thumbs.db
54
+
55
+ # Irminsul
56
+ site/
57
+ .irminsul-cache/
58
+ # mkdocs.yml is auto-generated by `irminsul render`; do not commit.
59
+ /mkdocs.yml
60
+ # _version.py is generated by hatch-vcs at build/install time; do not commit.
61
+ src/irminsul/_version.py
62
+
63
+ # Build artifacts
64
+ *.whl
65
+
66
+ .env
67
+ .env.local
68
+ .env.*.local
@@ -0,0 +1,35 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.5.7
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix]
7
+ - id: ruff-format
8
+
9
+ - repo: https://github.com/pre-commit/pre-commit-hooks
10
+ rev: v4.6.0
11
+ hooks:
12
+ - id: check-yaml
13
+ - id: check-toml
14
+ - id: check-added-large-files
15
+ - id: end-of-file-fixer
16
+ - id: trailing-whitespace
17
+
18
+ - repo: https://github.com/pre-commit/mirrors-mypy
19
+ rev: v1.11.2
20
+ hooks:
21
+ - id: mypy
22
+ additional_dependencies:
23
+ - pydantic>=2.7
24
+ - types-requests
25
+ files: ^src/
26
+
27
+ # Dogfood: run irminsul against its own docs once they exist.
28
+ # Enabled in Week 4 after seed docs are written.
29
+ # - repo: local
30
+ # hooks:
31
+ # - id: irminsul-check
32
+ # name: irminsul check
33
+ # entry: irminsul check --scope=hard
34
+ # language: system
35
+ # pass_filenames: false
@@ -0,0 +1,33 @@
1
+ # syntax=docker/dockerfile:1.7
2
+
3
+ FROM python:3.12-slim AS builder
4
+
5
+ WORKDIR /build
6
+
7
+ RUN pip install --no-cache-dir --upgrade pip build
8
+
9
+ COPY pyproject.toml README.md LICENSE ./
10
+ COPY src ./src
11
+
12
+ RUN python -m build --wheel --outdir /wheels
13
+
14
+
15
+ FROM python:3.12-slim AS runtime
16
+
17
+ LABEL org.opencontainers.image.title="irminsul"
18
+ LABEL org.opencontainers.image.description="A documentation system for complex codebases."
19
+ LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later"
20
+ LABEL org.opencontainers.image.source="https://github.com/huajie-zhong/irminsul"
21
+
22
+ RUN useradd --create-home --shell /bin/bash irminsul
23
+ WORKDIR /home/irminsul
24
+
25
+ COPY --from=builder /wheels /wheels
26
+ RUN pip install --no-cache-dir --no-index --find-links=/wheels irminsul \
27
+ && rm -rf /wheels
28
+
29
+ USER irminsul
30
+ WORKDIR /workspace
31
+
32
+ ENTRYPOINT ["irminsul"]
33
+ CMD ["--help"]