Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added skeleton docs #6

Merged
merged 10 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
fail-fast: false
env:
PYTHONDEVMODE: 1
steps:
Expand All @@ -36,3 +36,5 @@ jobs:
- run: poetry run mypy
# Run tests.
- run: poetry run pytest
# Build docs.
- run: poetry run sphinx-build -W docs docs/_build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/.mypy_cache
/.venv
/dist
/docs/_build
36 changes: 36 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from __future__ import annotations

from datetime import date
from pathlib import Path

import tomli

_root = Path(__file__).parent.parent
_poetry = tomli.loads((_root / "pyproject.toml").read_text())["tool"]["poetry"]

project = _poetry["name"]
release = version = _poetry["version"]
author = ", ".join(author[0] for author in _poetry["authors"])
copyright = f"{date.today().year} Dave Hall"

exclude_patterns = ["_build"]

html_theme = "furo"
html_title = _poetry["name"]

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
]

autoclass_content = "both"
autodoc_default_options = {
"members": True,
"undoc-members": True,
}
autodoc_member_order = "groupwise"
autodoc_typehints = "both"

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
}
13 changes: 13 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Log-based testing
=================

.. automodule:: logot

.. toctree::
:caption: Contents
:hidden:
:maxdepth: 1

self
match
util
4 changes: 4 additions & 0 deletions docs/match.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Matching logs
=============

.. automodule:: logot.match
4 changes: 4 additions & 0 deletions docs/util.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Utilities
=========

.. automodule:: logot.util
612 changes: 610 additions & 2 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,21 @@ keywords = ["test", "unittest", "pytest", "logging"]
packages = [{ include = "logot" }]

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
pytest = { version = "^7.4.4", optional = true }

[tool.poetry.extras]
pytest = ["pytest"]

[tool.poetry.group.dev.dependencies]
furo = "*"
mypy = "^1.8.0"
ruff = "^0.1.11"
pytest = "*"
pytest-cov = "^4.1.0"
sphinx = "*"
sphinx-autobuild = "*"
tomli = "^2.0.1"

[tool.coverage.run]
source = ["logot", "tests"]
Expand All @@ -41,7 +45,7 @@ exclude_lines = [
]

[tool.mypy]
files = ["logot/**/*.py", "tests/**/*.py"]
files = ["docs/**/*.py", "logot/**/*.py", "tests/**/*.py"]
allow_redefinition = true
explicit_package_bases = true
show_column_numbers = true
Expand All @@ -53,7 +57,7 @@ console_output_style = "classic"
addopts = "--tb=native --cov"

[tool.ruff]
include = ["logot/**/*.py", "tests/**/*.py"]
include = ["docs/**/*.py", "logot/**/*.py", "tests/**/*.py"]
line-length = 120
select = ["E", "F", "W", "I", "UP"]

Expand Down