Skip to content

Commit 1541236

Browse files
committed
mkdocs added
1 parent ecc5e73 commit 1541236

8 files changed

Lines changed: 183 additions & 5 deletions

File tree

.github/workflows/docs.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ on:
44
push:
55
paths:
66
- "docs/**"
7+
- "mkdocs.yml"
78
- "README.md"
9+
- "pyproject.toml"
810
- ".github/workflows/docs.yml"
911
pull_request:
1012
paths:
1113
- "docs/**"
14+
- "mkdocs.yml"
1215
- "README.md"
16+
- "pyproject.toml"
1317
- ".github/workflows/docs.yml"
1418

1519
jobs:
@@ -19,7 +23,17 @@ jobs:
1923
- name: Checkout
2024
uses: actions/checkout@v4
2125

22-
- name: Verify docs layout
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.12"
30+
cache: "pip"
31+
32+
- name: Install docs dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
python -m pip install -e ".[docs]"
36+
37+
- name: Build docs
2338
run: |
24-
test -f README.md
25-
test -d docs
39+
mkdocs build --strict

.github/workflows/tests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,11 @@ jobs:
3838

3939
- name: Run tests via tox
4040
run: tox -e ${{ matrix.toxenv }}
41+
42+
- name: Upload coverage artifact
43+
if: always()
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: coverage-${{ matrix.python-version }}
47+
path: coverage.xml
48+
if-no-files-found: ignore

README.md

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,75 @@
11
# fastapi-observer
2-
FastApi Logs visualization
2+
3+
FastAPI Observer provides structured logging and observability helpers for FastAPI applications.
4+
5+
## Python compatibility
6+
7+
- Supported Python versions: `3.10`, `3.11`, `3.12`, `3.13`, `3.14`
8+
- Enforced in CI with tox matrix: `py310`, `py311`, `py312`, `py313`, `py314`
9+
10+
## Package versions
11+
12+
### Runtime
13+
14+
- `pydantic>=2.0,<3.0`
15+
16+
### Testing
17+
18+
- `pytest>=8.0`
19+
- `pytest-cov>=5.0`
20+
21+
### Documentation
22+
23+
- `mkdocs>=1.6`
24+
- `mkdocs-material>=9.5`
25+
26+
### Development
27+
28+
- `pre-commit>=3.7`
29+
- `black>=24.10`
30+
31+
## Install
32+
33+
```bash
34+
pip install fastapi-observer
35+
```
36+
37+
For development:
38+
39+
```bash
40+
pip install -e ".[test,docs,dev]"
41+
```
42+
43+
## Tests and coverage
44+
45+
Run tests:
46+
47+
```bash
48+
pytest -q
49+
```
50+
51+
Run tests with coverage:
52+
53+
```bash
54+
pytest -q --cov=fastapi_observer --cov-report=term-missing --cov-report=xml
55+
```
56+
57+
Run full Python version matrix locally:
58+
59+
```bash
60+
tox
61+
```
62+
63+
## Docs
64+
65+
Build docs:
66+
67+
```bash
68+
mkdocs build --strict
69+
```
70+
71+
Serve docs locally:
72+
73+
```bash
74+
mkdocs serve
75+
```

docs/index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# FastAPI Observer
2+
3+
FastAPI Observer provides structured logging building blocks for FastAPI projects.
4+
5+
## Current scope
6+
7+
- Typed and validated configuration via `ObserverConfig`
8+
- Structured event model via `LogEvent`
9+
- Logger factory with console/file handlers and JSON/text formatting
10+
11+
## Compatibility
12+
13+
- Python: `3.10` to `3.14`
14+
- Test matrix: `py310`, `py311`, `py312`, `py313`, `py314` via `tox` and GitHub Actions
15+
16+
## Quick start
17+
18+
```bash
19+
pip install fastapi-observer
20+
```
21+
22+
See [Installation](installation.md) for development, docs, and test commands.

docs/installation.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Installation
2+
3+
## Runtime install
4+
5+
```bash
6+
pip install fastapi-observer
7+
```
8+
9+
## Development install
10+
11+
```bash
12+
pip install -e ".[test,docs,dev]"
13+
```
14+
15+
## Run tests locally
16+
17+
```bash
18+
pytest -q --cov=fastapi_observer --cov-report=term-missing --cov-report=xml
19+
```
20+
21+
## Run multi-version tests with tox
22+
23+
```bash
24+
tox
25+
```
26+
27+
## Build docs
28+
29+
```bash
30+
mkdocs build --strict
31+
mkdocs serve
32+
```

mkdocs.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
site_name: FastAPI Observer
2+
site_description: Logging and observability helpers for FastAPI applications.
3+
repo_name: fastapi-observer
4+
5+
theme:
6+
name: material
7+
8+
nav:
9+
- Home: index.md
10+
- Installation: installation.md
11+
12+
markdown_extensions:
13+
- admonition
14+
- codehilite
15+
- toc:
16+
permalink: true

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ dependencies = [
1717
[project.optional-dependencies]
1818
test = [
1919
"pytest>=8.0",
20+
"pytest-cov>=5.0",
21+
]
22+
docs = [
23+
"mkdocs>=1.6",
24+
"mkdocs-material>=9.5",
2025
]
2126
dev = [
2227
"pre-commit>=3.7",
@@ -33,3 +38,11 @@ testpaths = ["tests"]
3338
[tool.black]
3439
line-length = 88
3540
target-version = ["py310"]
41+
42+
[tool.coverage.run]
43+
source = ["fastapi_observer"]
44+
branch = true
45+
46+
[tool.coverage.report]
47+
show_missing = true
48+
skip_covered = false

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ skip_missing_interpreters = true
66
[testenv]
77
description = Run test suite
88
extras = test
9-
commands = pytest -q {posargs}
9+
commands = pytest -q --cov=fastapi_observer --cov-report=term-missing --cov-report=xml {posargs}

0 commit comments

Comments
 (0)