yb-observability 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 (28) hide show
  1. yb_observability-0.1.0/.github/CODEOWNERS +2 -0
  2. yb_observability-0.1.0/.github/dependabot.yml +14 -0
  3. yb_observability-0.1.0/.github/pull_request_template.md +21 -0
  4. yb_observability-0.1.0/.github/workflows/ci.yml +42 -0
  5. yb_observability-0.1.0/.github/workflows/release.yml +60 -0
  6. yb_observability-0.1.0/.gitignore +50 -0
  7. yb_observability-0.1.0/CHANGELOG.md +31 -0
  8. yb_observability-0.1.0/CODE_OF_CONDUCT.md +54 -0
  9. yb_observability-0.1.0/CONTRIBUTING.md +238 -0
  10. yb_observability-0.1.0/LICENSE +0 -0
  11. yb_observability-0.1.0/PKG-INFO +203 -0
  12. yb_observability-0.1.0/README.md +192 -0
  13. yb_observability-0.1.0/SECURITY.md +21 -0
  14. yb_observability-0.1.0/pyproject.toml +57 -0
  15. yb_observability-0.1.0/src/yb_observability/__init__.py +0 -0
  16. yb_observability-0.1.0/src/yb_observability/config/__init__.py +13 -0
  17. yb_observability-0.1.0/src/yb_observability/config/exceptions.py +10 -0
  18. yb_observability-0.1.0/src/yb_observability/config/loader.py +72 -0
  19. yb_observability-0.1.0/src/yb_observability/logging/__init__.py +3 -0
  20. yb_observability-0.1.0/src/yb_observability/logging/manager.py +51 -0
  21. yb_observability-0.1.0/tests/config/fixtures/environment.yml +3 -0
  22. yb_observability-0.1.0/tests/config/fixtures/invalid.yml +4 -0
  23. yb_observability-0.1.0/tests/config/fixtures/nested_environment.yml +4 -0
  24. yb_observability-0.1.0/tests/config/fixtures/scalar.yml +1 -0
  25. yb_observability-0.1.0/tests/config/fixtures/valid.yml +9 -0
  26. yb_observability-0.1.0/tests/config/test_loader.py +170 -0
  27. yb_observability-0.1.0/tests/logging/test_manager.py +155 -0
  28. yb_observability-0.1.0/uv.lock +211 -0
@@ -0,0 +1,2 @@
1
+ /*
2
+ @Ybouali
@@ -0,0 +1,14 @@
1
+ version: 2
2
+
3
+ updates:
4
+ - package-ecosystem: pip
5
+ directory: /
6
+ schedule:
7
+ interval: weekly
8
+ open-pull-requests-limit: 5
9
+
10
+ - package-ecosystem: github-actions
11
+ directory: /
12
+ schedule:
13
+ interval: weekly
14
+ open-pull-requests-limit: 5
@@ -0,0 +1,21 @@
1
+ ## Description
2
+
3
+ <!-- Describe what this pull request changes and why. -->
4
+
5
+ ## Changes
6
+
7
+ -
8
+
9
+ ## Testing
10
+
11
+ - [ ] `uv run pytest`
12
+ - [ ] `uv run ruff check .`
13
+ - [ ] `uv run ruff format --check .`
14
+ - [ ] `uv run pyright`
15
+
16
+ ## Checklist
17
+
18
+ - [ ] Tests added or updated where necessary
19
+ - [ ] Documentation updated where necessary
20
+ - [ ] No secrets or sensitive information added
21
+ - [ ] Public API changes are intentional
@@ -0,0 +1,42 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ quality:
13
+ name: Quality checks
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Checkout repository
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v6
22
+ with:
23
+ version: "0.12.5"
24
+ enable-cache: true
25
+
26
+ - name: Set up Python
27
+ run: uv python install 3.14
28
+
29
+ - name: Install dependencies
30
+ run: uv sync --locked
31
+
32
+ - name: Run tests
33
+ run: uv run pytest
34
+
35
+ - name: Check linting
36
+ run: uv run ruff check .
37
+
38
+ - name: Check formatting
39
+ run: uv run ruff format --check .
40
+
41
+ - name: Run type checking
42
+ run: uv run pyright
@@ -0,0 +1,60 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ name: Build distribution
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Checkout repository
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v6
22
+ with:
23
+ version: "0.12.5"
24
+ enable-cache: true
25
+
26
+ - name: Set up Python
27
+ run: uv python install 3.14
28
+
29
+ - name: Install dependencies
30
+ run: uv sync --locked
31
+
32
+ - name: Run tests
33
+ run: uv run pytest
34
+
35
+ - name: Build package
36
+ run: uv build
37
+
38
+ - name: Upload distribution artifacts
39
+ uses: actions/upload-artifact@v4
40
+ with:
41
+ name: distributions
42
+ path: dist/
43
+
44
+ publish:
45
+ name: Publish to PyPI
46
+ needs: build
47
+ runs-on: ubuntu-latest
48
+
49
+ permissions:
50
+ id-token: write
51
+
52
+ steps:
53
+ - name: Download distribution artifacts
54
+ uses: actions/download-artifact@v4
55
+ with:
56
+ name: distributions
57
+ path: dist/
58
+
59
+ - name: Publish package to PyPI
60
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,50 @@
1
+ # Byte-compiled / optimized Python files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Python environments
7
+ .venv/
8
+ venv/
9
+ env/
10
+ ENV/
11
+
12
+ # Distribution / packaging
13
+ build/
14
+ dist/
15
+ *.egg-info/
16
+ .eggs/
17
+
18
+ # Pytest
19
+ .pytest_cache/
20
+
21
+ # Coverage
22
+ .coverage
23
+ .coverage.*
24
+ htmlcov/
25
+ coverage.xml
26
+
27
+ # Ruff
28
+ .ruff_cache/
29
+
30
+ # Pyright
31
+ .pyright/
32
+
33
+ # IDEs
34
+ .vscode/
35
+ .idea/
36
+
37
+ # macOS
38
+ .DS_Store
39
+
40
+ # Environment files
41
+ .env
42
+ .env.*
43
+ !.env.example
44
+
45
+ # Logs
46
+ logs/
47
+
48
+ # Local tooling / temporary files
49
+ *.tmp
50
+ *.temp
@@ -0,0 +1,31 @@
1
+ # Changelog
2
+
3
+ All notable changes to `yb-observability` are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project follows Semantic Versioning.
6
+
7
+ ## [Unreleased]
8
+
9
+ Changes that are planned or currently under development.
10
+
11
+ ## [0.1.0] - 2026-09-13
12
+
13
+ ### Added
14
+
15
+ * Initial project structure.
16
+ * Python 3.14 support.
17
+ * YAML configuration loading.
18
+ * Environment variable resolution for configuration values.
19
+ * Loguru-based logging infrastructure.
20
+ * Service-aware logging.
21
+ * Console logging.
22
+ * File logging.
23
+ * Daily log rotation.
24
+ * Configurable log retention.
25
+ * Automated testing infrastructure.
26
+ * Ruff configuration.
27
+ * Pyright configuration.
28
+ * Pytest configuration.
29
+
30
+ [Unreleased]: https://github.com/Ybouali/yb-observability/compare/v0.1.0...HEAD
31
+ [0.1.0]: https://github.com/Ybouali/yb-observability/releases/tag/v0.1.0
@@ -0,0 +1,54 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ Security fixes are generally applied to actively maintained versions of `yb-observability`.
6
+
7
+ | Version | Supported |
8
+ | -------------------- | ----------- |
9
+ | Latest minor release | Yes |
10
+ | Older releases | Best effort |
11
+ | Unsupported releases | No |
12
+
13
+ Users should keep `yb-observability` up to date whenever possible.
14
+
15
+ ## Reporting a Vulnerability
16
+
17
+ Please do **not** report security vulnerabilities through public GitHub issues.
18
+
19
+ If you believe you have found a security vulnerability, report it privately through the repository's GitHub security reporting mechanism.
20
+
21
+ When reporting a vulnerability, include:
22
+
23
+ * A clear description of the vulnerability.
24
+ * The affected version.
25
+ * Steps required to reproduce the issue.
26
+ * The potential security impact.
27
+ * Any relevant logs, stack traces, or proof of concept that can safely be shared.
28
+
29
+ Please do not include secrets, credentials, API keys, personal data, or other sensitive information in the report.
30
+
31
+ ## Responsible Disclosure
32
+
33
+ Please allow reasonable time for the vulnerability to be investigated and addressed before publicly disclosing technical details.
34
+
35
+ Security fixes may be released as a patch, minor release, or major release depending on the impact and whether the change affects the public API.
36
+
37
+ ## Dependency Security
38
+
39
+ The project depends on third-party Python packages.
40
+
41
+ Dependencies should be kept reasonably up to date, and security-related dependency updates should be addressed promptly when practical.
42
+
43
+ Contributors should avoid introducing dependencies when the functionality can be implemented safely without adding unnecessary project complexity.
44
+
45
+ ## Scope
46
+
47
+ This policy covers security vulnerabilities in:
48
+
49
+ * `yb-observability` source code.
50
+ * Build and packaging configuration.
51
+ * Project infrastructure that can affect users of the published package.
52
+ * Dependencies introduced directly by the project where the project configuration is responsible for the vulnerability.
53
+
54
+ Application-specific security issues in software that uses `yb-observability` should be reported to the maintainers of that application.
@@ -0,0 +1,238 @@
1
+ # Contributing to yb-observability
2
+
3
+ Thank you for contributing to `yb-observability`.
4
+
5
+ The project is designed as a reusable Python library, so contributions should prioritize clear APIs, minimal coupling, backwards compatibility, and strong test coverage.
6
+
7
+ ## Development Requirements
8
+
9
+ The project currently uses:
10
+
11
+ * Python 3.14
12
+ * uv
13
+ * Pytest
14
+ * Ruff
15
+ * Pyright
16
+
17
+ Clone the repository and enter the project:
18
+
19
+ ```bash
20
+ git clone <repository-url>
21
+ cd yb-observability
22
+ ```
23
+
24
+ Install the development environment:
25
+
26
+ ```bash
27
+ uv sync
28
+ ```
29
+
30
+ ## Project Structure
31
+
32
+ ```text
33
+ src/yb_observability/
34
+ ├── config/
35
+ └── logging/
36
+
37
+ tests/
38
+ ├── config/
39
+ └── logging/
40
+ ```
41
+
42
+ Implementation code belongs under `src/yb_observability/`.
43
+
44
+ Tests belong under the corresponding directory in `tests/`.
45
+
46
+ For example:
47
+
48
+ ```text
49
+ src/yb_observability/config/loader.py
50
+ tests/config/test_loader.py
51
+ ```
52
+
53
+ ## Development Workflow
54
+
55
+ Create a branch for your work:
56
+
57
+ ```bash
58
+ git switch -c feature/my-feature
59
+ ```
60
+
61
+ Make the changes and add tests where appropriate.
62
+
63
+ Run the complete test suite:
64
+
65
+ ```bash
66
+ uv run pytest
67
+ ```
68
+
69
+ Run Ruff:
70
+
71
+ ```bash
72
+ uv run ruff check .
73
+ ```
74
+
75
+ Check formatting:
76
+
77
+ ```bash
78
+ uv run ruff format --check .
79
+ ```
80
+
81
+ Run Pyright:
82
+
83
+ ```bash
84
+ uv run pyright
85
+ ```
86
+
87
+ All checks should pass before opening a pull request.
88
+
89
+ ## Code Style
90
+
91
+ Follow the project's Ruff configuration.
92
+
93
+ The project uses:
94
+
95
+ * 88-character line length.
96
+ * Double quotes.
97
+ * Four spaces for indentation.
98
+ * Python 3.14 syntax and typing features where appropriate.
99
+
100
+ Prefer simple and explicit implementations over unnecessary abstractions.
101
+
102
+ ## Public API
103
+
104
+ Changes to the public API should be made carefully.
105
+
106
+ Before adding a public class, function, or module, consider whether it is genuinely useful to library consumers.
107
+
108
+ Avoid exposing implementation details unnecessarily.
109
+
110
+ For example, prefer a stable public API such as:
111
+
112
+ ```python
113
+ from yb_observability.config import ConfigLoader
114
+ ```
115
+
116
+ rather than requiring consumers to import internal implementation modules.
117
+
118
+ ## Tests
119
+
120
+ New functionality should include tests.
121
+
122
+ Tests should verify observable behavior rather than implementation details.
123
+
124
+ For bug fixes, add a regression test whenever practical.
125
+
126
+ The test suite can be run with:
127
+
128
+ ```bash
129
+ uv run pytest
130
+ ```
131
+
132
+ ## Documentation
133
+
134
+ Public functionality should be documented.
135
+
136
+ Documentation should explain:
137
+
138
+ * What the feature does.
139
+ * Why it exists.
140
+ * How to use it.
141
+ * Important configuration or behavioral constraints.
142
+
143
+ Architectural decisions should be documented separately when they affect the design of the library.
144
+
145
+ ## Commit Messages
146
+
147
+ Use clear, descriptive commit messages.
148
+
149
+ The project follows Conventional Commits.
150
+
151
+ Examples:
152
+
153
+ ```text
154
+ feat(config): add environment variable resolution
155
+ fix(config): handle invalid YAML
156
+ feat(logging): add daily file rotation
157
+ test(config): add nested environment tests
158
+ docs(logging): document retention configuration
159
+ refactor(logging): simplify handler configuration
160
+ ```
161
+
162
+ Common commit types include:
163
+
164
+ ```text
165
+ feat
166
+ fix
167
+ docs
168
+ test
169
+ refactor
170
+ chore
171
+ ci
172
+ ```
173
+
174
+ ## Pull Requests
175
+
176
+ Pull requests should:
177
+
178
+ * Explain what changed.
179
+ * Explain why the change was needed.
180
+ * Include tests for new behavior.
181
+ * Keep unrelated changes out of the pull request.
182
+ * Pass all automated checks.
183
+
184
+ Keep pull requests focused. A feature, bug fix, or refactor should normally be submitted separately rather than combining unrelated changes.
185
+
186
+ ## Backwards Compatibility
187
+
188
+ `yb-observability` is a reusable library, so backwards compatibility is important.
189
+
190
+ Breaking changes to public APIs should:
191
+
192
+ 1. Be clearly identified.
193
+ 2. Be documented.
194
+ 3. Include an appropriate version change.
195
+ 4. Explain the migration path when possible.
196
+
197
+ The project follows semantic versioning:
198
+
199
+ ```text
200
+ MAJOR.MINOR.PATCH
201
+ ```
202
+
203
+ For example:
204
+
205
+ ```text
206
+ 0.1.0
207
+ 0.2.0
208
+ 0.2.1
209
+ ```
210
+
211
+ While the project remains below `1.0.0`, the public API may evolve more quickly, but breaking changes should still be intentional and documented.
212
+
213
+ ## Issues
214
+
215
+ Before opening an issue:
216
+
217
+ * Search existing issues.
218
+ * Verify that the behavior is reproducible.
219
+ * Include relevant error messages and environment information.
220
+ * Provide a minimal reproduction when reporting a bug.
221
+
222
+ Do not include secrets, credentials, API keys, or other sensitive information in issues.
223
+
224
+ ## Security Issues
225
+
226
+ Do not report security vulnerabilities through public GitHub issues.
227
+
228
+ See `SECURITY.md` for the security reporting process.
229
+
230
+ ## Code of Conduct
231
+
232
+ All contributors are expected to follow the project's `CODE_OF_CONDUCT.md`.
233
+
234
+ ## License
235
+
236
+ By contributing to this project, you agree that your contributions will be licensed under the same license as the project.
237
+
238
+ `yb-observability` is distributed under the MIT License.
File without changes