fapilog 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 (172) hide show
  1. fapilog-0.1.0/.coveragerc +23 -0
  2. fapilog-0.1.0/.github/CODEOWNERS +29 -0
  3. fapilog-0.1.0/.github/workflows/ci.yml +90 -0
  4. fapilog-0.1.0/.github/workflows/publish.yml +75 -0
  5. fapilog-0.1.0/.github/workflows/release-guard.yml +28 -0
  6. fapilog-0.1.0/.github/workflows/validate-workflows.yml +69 -0
  7. fapilog-0.1.0/.gitignore +253 -0
  8. fapilog-0.1.0/.pre-commit-config.yaml +35 -0
  9. fapilog-0.1.0/.vulture +65 -0
  10. fapilog-0.1.0/CHANGELOG.md +399 -0
  11. fapilog-0.1.0/CONTRIBUTING.md +352 -0
  12. fapilog-0.1.0/LICENSE +176 -0
  13. fapilog-0.1.0/NOTICE +2 -0
  14. fapilog-0.1.0/PKG-INFO +1842 -0
  15. fapilog-0.1.0/README.md +1785 -0
  16. fapilog-0.1.0/RELEASING.md +348 -0
  17. fapilog-0.1.0/docs/REVIEW.md +215 -0
  18. fapilog-0.1.0/docs/api-reference.md +961 -0
  19. fapilog-0.1.0/docs/architecture-improvements-summary.md +170 -0
  20. fapilog-0.1.0/docs/documentation-structure.md +313 -0
  21. fapilog-0.1.0/docs/epics.md +93 -0
  22. fapilog-0.1.0/docs/error-handling-implementation-summary.md +215 -0
  23. fapilog-0.1.0/docs/prd-phase-1-mvp.md +794 -0
  24. fapilog-0.1.0/docs/sprint-planning-weeks-1-4.md +482 -0
  25. fapilog-0.1.0/docs/stories/story-1.1.md +101 -0
  26. fapilog-0.1.0/docs/stories/story-1.2.md +97 -0
  27. fapilog-0.1.0/docs/stories/story-1.3.md +135 -0
  28. fapilog-0.1.0/docs/stories/story-1.4.md +67 -0
  29. fapilog-0.1.0/docs/stories/story-1.5.md +114 -0
  30. fapilog-0.1.0/docs/stories/story-10.1.md +114 -0
  31. fapilog-0.1.0/docs/stories/story-10.2.md +68 -0
  32. fapilog-0.1.0/docs/stories/story-10.3.md +207 -0
  33. fapilog-0.1.0/docs/stories/story-10.4.md +66 -0
  34. fapilog-0.1.0/docs/stories/story-11.1.md +114 -0
  35. fapilog-0.1.0/docs/stories/story-11.2.md +126 -0
  36. fapilog-0.1.0/docs/stories/story-11.3.md +157 -0
  37. fapilog-0.1.0/docs/stories/story-11.4.md +84 -0
  38. fapilog-0.1.0/docs/stories/story-12.1.md +63 -0
  39. fapilog-0.1.0/docs/stories/story-12.2..md +67 -0
  40. fapilog-0.1.0/docs/stories/story-12.3.md +74 -0
  41. fapilog-0.1.0/docs/stories/story-12.4.md +65 -0
  42. fapilog-0.1.0/docs/stories/story-13.1.md +100 -0
  43. fapilog-0.1.0/docs/stories/story-13.2.md +117 -0
  44. fapilog-0.1.0/docs/stories/story-13.3.md +192 -0
  45. fapilog-0.1.0/docs/stories/story-13.4.md +109 -0
  46. fapilog-0.1.0/docs/stories/story-13.5.md +38 -0
  47. fapilog-0.1.0/docs/stories/story-13.5a.md +96 -0
  48. fapilog-0.1.0/docs/stories/story-13.5b.md +106 -0
  49. fapilog-0.1.0/docs/stories/story-13.5c.md +117 -0
  50. fapilog-0.1.0/docs/stories/story-13.6.md +40 -0
  51. fapilog-0.1.0/docs/stories/story-13.6a.md +108 -0
  52. fapilog-0.1.0/docs/stories/story-13.6b.md +107 -0
  53. fapilog-0.1.0/docs/stories/story-13.6c.md +111 -0
  54. fapilog-0.1.0/docs/stories/story-13.6d.md +121 -0
  55. fapilog-0.1.0/docs/stories/story-13.7.md +38 -0
  56. fapilog-0.1.0/docs/stories/story-13.7a.md +115 -0
  57. fapilog-0.1.0/docs/stories/story-13.7b.md +112 -0
  58. fapilog-0.1.0/docs/stories/story-13.7c.md +113 -0
  59. fapilog-0.1.0/docs/stories/story-13.8.md +38 -0
  60. fapilog-0.1.0/docs/stories/story-13.8a.md +101 -0
  61. fapilog-0.1.0/docs/stories/story-13.8b.md +121 -0
  62. fapilog-0.1.0/docs/stories/story-13.8c.md +121 -0
  63. fapilog-0.1.0/docs/stories/story-2.1.md +161 -0
  64. fapilog-0.1.0/docs/stories/story-2.2.md +217 -0
  65. fapilog-0.1.0/docs/stories/story-2.3.md +109 -0
  66. fapilog-0.1.0/docs/stories/story-2.4.md +69 -0
  67. fapilog-0.1.0/docs/stories/story-3.1.md +178 -0
  68. fapilog-0.1.0/docs/stories/story-3.2.md +178 -0
  69. fapilog-0.1.0/docs/stories/story-3.3.md +139 -0
  70. fapilog-0.1.0/docs/stories/story-3.4.md +138 -0
  71. fapilog-0.1.0/docs/stories/story-4.1.md +115 -0
  72. fapilog-0.1.0/docs/stories/story-4.2.md +187 -0
  73. fapilog-0.1.0/docs/stories/story-4.3.md +108 -0
  74. fapilog-0.1.0/docs/stories/story-4.4.md +128 -0
  75. fapilog-0.1.0/docs/stories/story-5.1.md +70 -0
  76. fapilog-0.1.0/docs/stories/story-5.2.md +137 -0
  77. fapilog-0.1.0/docs/stories/story-5.3.md +166 -0
  78. fapilog-0.1.0/docs/stories/story-5.4.md +237 -0
  79. fapilog-0.1.0/docs/stories/story-6.1.md +153 -0
  80. fapilog-0.1.0/docs/stories/story-6.2.md +172 -0
  81. fapilog-0.1.0/docs/stories/story-6.3.md +225 -0
  82. fapilog-0.1.0/docs/stories/story-7.1.md +132 -0
  83. fapilog-0.1.0/docs/stories/story-7.2.md +134 -0
  84. fapilog-0.1.0/docs/stories/story-7.3.md +154 -0
  85. fapilog-0.1.0/docs/stories/story-8.1.md +70 -0
  86. fapilog-0.1.0/docs/stories/story-8.2.md +73 -0
  87. fapilog-0.1.0/docs/stories/story-8.3.md +67 -0
  88. fapilog-0.1.0/docs/stories/story-8.4.md +67 -0
  89. fapilog-0.1.0/docs/stories/story-9.1.md +109 -0
  90. fapilog-0.1.0/docs/stories/story-9.2.md +121 -0
  91. fapilog-0.1.0/docs/stories/story-9.3.md +57 -0
  92. fapilog-0.1.0/docs/stories/story-9.4.md +66 -0
  93. fapilog-0.1.0/docs/story-13-refactored-summary.md +158 -0
  94. fapilog-0.1.0/docs/user-guide.md +1435 -0
  95. fapilog-0.1.0/examples/01_basic_setup.py +62 -0
  96. fapilog-0.1.0/examples/02_environment_config.py +128 -0
  97. fapilog-0.1.0/examples/03_output_formats.py +218 -0
  98. fapilog-0.1.0/examples/04_logging_levels.py +274 -0
  99. fapilog-0.1.0/examples/05_fastapi_basic.py +215 -0
  100. fapilog-0.1.0/examples/06_fastapi_middleware.py +258 -0
  101. fapilog-0.1.0/examples/07_fastapi_error_handling.py +481 -0
  102. fapilog-0.1.0/examples/08_fastapi_structured_logging.py +499 -0
  103. fapilog-0.1.0/examples/09_queue_configuration.py +55 -0
  104. fapilog-0.1.0/examples/10_overflow_strategies.py +60 -0
  105. fapilog-0.1.0/examples/11_performance_testing.py +47 -0
  106. fapilog-0.1.0/examples/12_batch_processing.py +56 -0
  107. fapilog-0.1.0/examples/13_loki_sink.py +236 -0
  108. fapilog-0.1.0/examples/14_multiple_sinks.py +344 -0
  109. fapilog-0.1.0/examples/15_custom_sink.py +457 -0
  110. fapilog-0.1.0/examples/16_security_logging.py +546 -0
  111. fapilog-0.1.0/examples/17_trace_propagation.py +331 -0
  112. fapilog-0.1.0/examples/18_user_context_enrichment.py +399 -0
  113. fapilog-0.1.0/examples/19_field_redaction.py +336 -0
  114. fapilog-0.1.0/examples/20_automatic_pii_redaction.py +346 -0
  115. fapilog-0.1.0/examples/21_level_aware_redaction.py +283 -0
  116. fapilog-0.1.0/examples/custom_enricher_example.py +92 -0
  117. fapilog-0.1.0/examples/resource_metrics_example.py +60 -0
  118. fapilog-0.1.0/examples/stdout_sink_example.py +80 -0
  119. fapilog-0.1.0/examples/test_corrected_examples.py +184 -0
  120. fapilog-0.1.0/examples/test_fastapi_examples.py +145 -0
  121. fapilog-0.1.0/examples/test_sinks_examples.py +296 -0
  122. fapilog-0.1.0/pyproject.toml +212 -0
  123. fapilog-0.1.0/requirements-example.txt +26 -0
  124. fapilog-0.1.0/scripts/check_release_guardrails.py +133 -0
  125. fapilog-0.1.0/scripts/load_test_log_queue.py +353 -0
  126. fapilog-0.1.0/scripts/publish_to_pypi.py +208 -0
  127. fapilog-0.1.0/src/fapilog/__init__.py +13 -0
  128. fapilog-0.1.0/src/fapilog/_internal/context.py +309 -0
  129. fapilog-0.1.0/src/fapilog/_internal/error_handling.py +435 -0
  130. fapilog-0.1.0/src/fapilog/_internal/pii_patterns.py +131 -0
  131. fapilog-0.1.0/src/fapilog/_internal/queue.py +426 -0
  132. fapilog-0.1.0/src/fapilog/_internal/utils.py +17 -0
  133. fapilog-0.1.0/src/fapilog/bootstrap.py +353 -0
  134. fapilog-0.1.0/src/fapilog/enrichers.py +407 -0
  135. fapilog-0.1.0/src/fapilog/exceptions.py +227 -0
  136. fapilog-0.1.0/src/fapilog/httpx_patch.py +204 -0
  137. fapilog-0.1.0/src/fapilog/middleware.py +380 -0
  138. fapilog-0.1.0/src/fapilog/pipeline.py +184 -0
  139. fapilog-0.1.0/src/fapilog/redactors.py +212 -0
  140. fapilog-0.1.0/src/fapilog/settings.py +266 -0
  141. fapilog-0.1.0/src/fapilog/sinks/__init__.py +25 -0
  142. fapilog-0.1.0/src/fapilog/sinks/file.py +201 -0
  143. fapilog-0.1.0/src/fapilog/sinks/loki.py +417 -0
  144. fapilog-0.1.0/src/fapilog/sinks/stdout.py +62 -0
  145. fapilog-0.1.0/tests/test_auto_redactor.py +279 -0
  146. fapilog-0.1.0/tests/test_bootstrap.py +205 -0
  147. fapilog-0.1.0/tests/test_context_utils.py +615 -0
  148. fapilog-0.1.0/tests/test_enricher_body_size.py +236 -0
  149. fapilog-0.1.0/tests/test_enricher_host_process.py +162 -0
  150. fapilog-0.1.0/tests/test_enricher_registry.py +344 -0
  151. fapilog-0.1.0/tests/test_enricher_request.py +354 -0
  152. fapilog-0.1.0/tests/test_enricher_resource.py +284 -0
  153. fapilog-0.1.0/tests/test_error_handling.py +750 -0
  154. fapilog-0.1.0/tests/test_file_sink.py +145 -0
  155. fapilog-0.1.0/tests/test_import.py +22 -0
  156. fapilog-0.1.0/tests/test_level_redaction.py +325 -0
  157. fapilog-0.1.0/tests/test_log_queue.py +1039 -0
  158. fapilog-0.1.0/tests/test_loki_sink.py +427 -0
  159. fapilog-0.1.0/tests/test_middleware_imports.py +71 -0
  160. fapilog-0.1.0/tests/test_multi_sink.py +349 -0
  161. fapilog-0.1.0/tests/test_pipeline.py +179 -0
  162. fapilog-0.1.0/tests/test_pipeline_resource.py +92 -0
  163. fapilog-0.1.0/tests/test_pipeline_with_custom_enrichers.py +205 -0
  164. fapilog-0.1.0/tests/test_redactor.py +312 -0
  165. fapilog-0.1.0/tests/test_release_guardrails.py +165 -0
  166. fapilog-0.1.0/tests/test_request_enricher.py +315 -0
  167. fapilog-0.1.0/tests/test_settings.py +166 -0
  168. fapilog-0.1.0/tests/test_stdout_sink.py +237 -0
  169. fapilog-0.1.0/tests/test_trace_middleware.py +510 -0
  170. fapilog-0.1.0/tests/test_trace_propagation.py +245 -0
  171. fapilog-0.1.0/tests/test_user_context.py +423 -0
  172. fapilog-0.1.0/tox.ini +21 -0
@@ -0,0 +1,23 @@
1
+ [run]
2
+ source = src/fapilog
3
+ omit =
4
+ examples/*
5
+ tests/*
6
+ */tests/*
7
+ */test_*
8
+ *_test.py
9
+ setup.py
10
+ conftest.py
11
+
12
+ [report]
13
+ exclude_lines =
14
+ pragma: no cover
15
+ def __repr__
16
+ if self.debug:
17
+ if settings.DEBUG
18
+ raise AssertionError
19
+ raise NotImplementedError
20
+ if 0:
21
+ if __name__ == .__main__.:
22
+ class .*\bProtocol\):
23
+ @(abc\.)?abstractmethod
@@ -0,0 +1,29 @@
1
+ # Global owners - you as the primary maintainer
2
+ * @chris-haste
3
+
4
+ # CI/CD and GitHub configuration files require maintainer review
5
+ .github/ @chris-haste
6
+ .github/workflows/ @chris-haste
7
+ .github/CODEOWNERS @chris-haste
8
+
9
+ # Core library files require maintainer review
10
+ src/fapilog/ @chris-haste
11
+ pyproject.toml @chris-haste
12
+ tox.ini @chris-haste
13
+ setup.py @chris-haste
14
+
15
+ # Documentation and project structure
16
+ README.md @chris-haste
17
+ CHANGELOG.md @chris-haste
18
+ LICENSE @chris-haste
19
+ CONTRIBUTING.md @chris-haste
20
+
21
+ # Tests and examples can be modified by contributors
22
+ tests/
23
+ examples/
24
+
25
+ # Documentation can be improved by contributors
26
+ docs/
27
+
28
+ # Scripts and tools
29
+ scripts/
@@ -0,0 +1,90 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, "feature/**" ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ lint:
11
+ name: Build & Lint
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Set up Python 3.11
17
+ uses: actions/setup-python@v4
18
+ with:
19
+ python-version: "3.11"
20
+
21
+ - name: Install Hatch
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ pip install hatch
25
+
26
+ - name: Run lint
27
+ run: hatch run lint:lint
28
+
29
+ typecheck:
30
+ name: Type Check
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+
35
+ - name: Set up Python 3.11
36
+ uses: actions/setup-python@v4
37
+ with:
38
+ python-version: "3.11"
39
+
40
+ - name: Install Hatch
41
+ run: |
42
+ python -m pip install --upgrade pip
43
+ pip install hatch
44
+
45
+ - name: Run type check
46
+ run: hatch run typecheck:typecheck
47
+
48
+ test:
49
+ name: Test
50
+ runs-on: ubuntu-latest
51
+ strategy:
52
+ matrix:
53
+ python-version: ["3.11"]
54
+ steps:
55
+ - uses: actions/checkout@v4
56
+
57
+ - name: Set up Python ${{ matrix.python-version }}
58
+ uses: actions/setup-python@v4
59
+ with:
60
+ python-version: ${{ matrix.python-version }}
61
+
62
+ - name: Install Hatch
63
+ run: |
64
+ python -m pip install --upgrade pip
65
+ pip install hatch
66
+
67
+ - name: Run tests
68
+ run: hatch run test:test
69
+
70
+ tox:
71
+ name: Tox (Compatibility)
72
+ runs-on: ubuntu-latest
73
+ strategy:
74
+ matrix:
75
+ python-version: ["3.11"]
76
+ steps:
77
+ - uses: actions/checkout@v4
78
+
79
+ - name: Set up Python ${{ matrix.python-version }}
80
+ uses: actions/setup-python@v4
81
+ with:
82
+ python-version: ${{ matrix.python-version }}
83
+
84
+ - name: Install Tox
85
+ run: |
86
+ python -m pip install --upgrade pip
87
+ pip install tox
88
+
89
+ - name: Run tox
90
+ run: tox -q
@@ -0,0 +1,75 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ permissions:
9
+ id-token: write
10
+ contents: read
11
+
12
+ jobs:
13
+ publish:
14
+ name: Publish to PyPI
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: Checkout code
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: '3.11'
24
+
25
+ - name: Install build tools
26
+ run: |
27
+ python -m pip install --upgrade pip
28
+ pip install build
29
+
30
+ - name: Extract version from tag
31
+ id: get_version
32
+ run: |
33
+ TAG_VERSION=${GITHUB_REF#refs/tags/v}
34
+ echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT
35
+
36
+ - name: Verify version consistency
37
+ run: |
38
+ TAG_VERSION="${{ steps.get_version.outputs.tag_version }}"
39
+ PYPROJECT_VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
40
+
41
+ echo "Tag version: $TAG_VERSION"
42
+ echo "pyproject.toml version: $PYPROJECT_VERSION"
43
+
44
+ if [ "$TAG_VERSION" != "$PYPROJECT_VERSION" ]; then
45
+ echo "ERROR: Tag version ($TAG_VERSION) does not match pyproject.toml version ($PYPROJECT_VERSION)"
46
+ exit 1
47
+ fi
48
+
49
+ echo "Version consistency check passed"
50
+
51
+ - name: Build package
52
+ run: python -m build
53
+
54
+ - name: Verify build artifacts
55
+ run: |
56
+ echo "Build artifacts:"
57
+ ls -la dist/
58
+
59
+ # Verify both wheel and sdist were created
60
+ if [ ! -f dist/*.whl ]; then
61
+ echo "ERROR: No wheel file found"
62
+ exit 1
63
+ fi
64
+
65
+ if [ ! -f dist/*.tar.gz ]; then
66
+ echo "ERROR: No source distribution found"
67
+ exit 1
68
+ fi
69
+
70
+ echo "Build verification passed"
71
+
72
+ - name: Publish to PyPI
73
+ uses: pypa/gh-action-pypi-publish@release/v1
74
+ with:
75
+ print-hash: true
@@ -0,0 +1,28 @@
1
+ name: Release Guardrails
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+
7
+ jobs:
8
+ release-guard:
9
+ name: Release Guardrails Check
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ with:
14
+ fetch-depth: 0 # Need full history to check commit messages
15
+
16
+ - name: Set up Python 3.11
17
+ uses: actions/setup-python@v4
18
+ with:
19
+ python-version: "3.11"
20
+
21
+ - name: Set up Python 3.11
22
+ uses: actions/setup-python@v4
23
+ with:
24
+ python-version: "3.11"
25
+
26
+ - name: Run release guardrails check
27
+ run: |
28
+ python scripts/check_release_guardrails.py --verbose
@@ -0,0 +1,69 @@
1
+ name: Validate Workflows
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [ main ]
6
+ push:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ validate:
11
+ name: Validate Workflow Syntax
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v4
18
+ with:
19
+ python-version: "3.11"
20
+
21
+ - name: Install dependencies
22
+ run: |
23
+ pip install PyYAML
24
+
25
+ - name: Validate workflow syntax
26
+ run: |
27
+ echo "🔍 Validating workflow files..."
28
+ for file in .github/workflows/*.yml; do
29
+ echo "Checking $file..."
30
+ python -c "
31
+ import yaml
32
+ import sys
33
+ try:
34
+ with open('$file', 'r') as f:
35
+ yaml.safe_load(f)
36
+ print('✅ $file is valid')
37
+ except Exception as e:
38
+ print(f'❌ $file has syntax errors: {e}')
39
+ sys.exit(1)
40
+ "
41
+ done
42
+ echo "✅ All workflow files are valid!"
43
+
44
+ - name: Check for potential secrets
45
+ run: |
46
+ echo "🔍 Checking for potential secrets in workflows..."
47
+ if grep -r -i "password\|secret\|key\|token" .github/workflows/ --exclude="*.md"; then
48
+ echo "⚠️ Warning: Potential secrets found in workflow files"
49
+ echo "Please review the following files:"
50
+ grep -r -i "password\|secret\|key\|token" .github/workflows/ --exclude="*.md" || true
51
+ echo "This is just a warning - please ensure no actual secrets are committed"
52
+ else
53
+ echo "✅ No potential secrets found in workflow files"
54
+ fi
55
+
56
+ - name: Validate required jobs exist
57
+ run: |
58
+ echo "🔍 Checking for required CI jobs..."
59
+ required_jobs=("lint" "test" "typecheck" "tox")
60
+
61
+ for job in "${required_jobs[@]}"; do
62
+ if grep -q "^ $job:" .github/workflows/ci.yml; then
63
+ echo "✅ Found job: $job"
64
+ else
65
+ echo "❌ Missing required job: $job"
66
+ exit 1
67
+ fi
68
+ done
69
+ echo "✅ All required CI jobs are present!"
@@ -0,0 +1,253 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be added to the global gitignore or merged into this project gitignore. For a PyCharm
158
+ # project, it is recommended to include the following files:
159
+ # .idea/
160
+ # *.iml
161
+ # *.ipr
162
+ # *.iws
163
+ .idea/
164
+
165
+ # VS Code
166
+ .vscode/
167
+
168
+ # macOS
169
+ .DS_Store
170
+ .AppleDouble
171
+ .LSOverride
172
+
173
+ # Icon must end with two \r
174
+ Icon
175
+
176
+ # Thumbnails
177
+ ._*
178
+
179
+ # Files that might appear in the root of a volume
180
+ .DocumentRevisions-V100
181
+ .fseventsd
182
+ .Spotlight-V100
183
+ .TemporaryItems
184
+ .Trashes
185
+ .VolumeIcon.icns
186
+ .com.apple.timemachine.donotpresent
187
+
188
+ # Directories potentially created on remote AFP share
189
+ .AppleDB
190
+ .AppleDesktop
191
+ Network Trash Folder
192
+ Temporary Items
193
+ .apdisk
194
+
195
+ # Windows
196
+ Thumbs.db
197
+ Thumbs.db:encryptable
198
+ ehthumbs.db
199
+ ehthumbs_vista.db
200
+
201
+ # Dump file
202
+ *.stackdump
203
+
204
+ # Folder config file
205
+ [Dd]esktop.ini
206
+
207
+ # Recycle Bin used on file shares
208
+ $RECYCLE.BIN/
209
+
210
+ # Windows Installer files
211
+ *.cab
212
+ *.msi
213
+ *.msix
214
+ *.msm
215
+ *.msp
216
+
217
+ # Windows shortcuts
218
+ *.lnk
219
+
220
+ # Linux
221
+ *~
222
+
223
+ # temporary files which can be created if a process still has a handle open of a deleted file
224
+ .fuse_hidden*
225
+
226
+ # KDE directory preferences
227
+ .directory
228
+
229
+ # Linux trash folder which might appear on any partition or disk
230
+ .Trash-*
231
+
232
+ # .nfs files are created when an open file is removed but is still being accessed
233
+ .nfs*
234
+
235
+ # Project-specific exclusions
236
+ .bmad-core/
237
+ web-bundles/
238
+
239
+ # Log files
240
+ *.log
241
+
242
+ # Temporary files
243
+ *.tmp
244
+ *.temp
245
+
246
+ # Coverage reports
247
+ htmlcov/
248
+ .coverage
249
+ .coverage.*
250
+
251
+ # Test artifacts
252
+ .pytest_cache/
253
+ .tox/
@@ -0,0 +1,35 @@
1
+ repos:
2
+ # Ruff for linting and formatting
3
+ - repo: https://github.com/astral-sh/ruff-pre-commit
4
+ rev: v0.12.4
5
+ hooks:
6
+ - id: ruff
7
+ args: [--fix, --exit-non-zero-on-fix]
8
+ - id: ruff-format
9
+ args: [--exit-non-zero-on-format]
10
+
11
+ # MyPy for type checking
12
+ - repo: https://github.com/pre-commit/mirrors-mypy
13
+ rev: v1.17.0
14
+ hooks:
15
+ - id: mypy
16
+ additional_dependencies: [types-requests, types-PyYAML]
17
+ args: [--ignore-missing-imports]
18
+
19
+ # Vulture for dead code detection
20
+ - repo: https://github.com/jendrikseipp/vulture
21
+ rev: v2.14
22
+ hooks:
23
+ - id: vulture
24
+ args: [src/, tests/, .vulture]
25
+
26
+ # Release guardrails check
27
+ - repo: local
28
+ hooks:
29
+ - id: release-guardrails
30
+ name: Release Guardrails Check
31
+ entry: python scripts/check_release_guardrails.py
32
+ language: system
33
+ stages: [pre-commit]
34
+ description: "Check for proper version bumps and changelog updates on release commits"
35
+ always_run: true
fapilog-0.1.0/.vulture ADDED
@@ -0,0 +1,65 @@
1
+ # Vulture whitelist for fapilog
2
+ # Functions and variables that are legitimate despite appearing unused
3
+
4
+ # Public API functions that are used by consumers
5
+ context_copy
6
+ get_span_id
7
+ get_user_id
8
+ get_user_roles
9
+ get_auth_scheme
10
+ set_trace_context
11
+ reset_trace_context
12
+ set_request_metadata
13
+ set_response_metadata
14
+ reset_request_metadata
15
+ reset_response_metadata
16
+
17
+ # Queue-related functions used by the async system
18
+ stop
19
+ queue_sink_async
20
+
21
+ # Bootstrap functions for library configuration
22
+ reset_logging
23
+
24
+ # Enricher functions used by the pipeline system
25
+ create_user_dependency
26
+ register_enricher
27
+ clear_enrichers
28
+
29
+ # HTTPX patch functions for trace propagation
30
+ disable_httpx_trace_propagation
31
+ is_httpx_trace_propagation_enabled
32
+
33
+ # Middleware functions used by FastAPI
34
+ add_trace_exception_handler
35
+ trace_exception_handler
36
+ dispatch
37
+
38
+ # Pydantic model configuration and validation methods
39
+ model_config
40
+ parse_sinks
41
+ parse_redact_patterns
42
+ parse_redact_fields
43
+ parse_custom_pii_patterns
44
+ validate_redact_level
45
+ validate_level
46
+ validate_json_console
47
+ validate_sampling_rate
48
+ validate_queue_maxsize
49
+ validate_queue_batch_size
50
+ validate_queue_batch_timeout
51
+ validate_queue_retry_delay
52
+ validate_queue_max_retries
53
+ validate_queue_overflow
54
+
55
+ # Loki sink attributes used internally
56
+ _last_flush
57
+ _flush_task
58
+
59
+ # Import and variable declarations for conditional imports
60
+ Response
61
+ FASTAPI_AVAILABLE
62
+ exc
63
+
64
+ # Pydantic validator parameters (required by decorator)
65
+ cls