Skip to content
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
676 changes: 222 additions & 454 deletions .calcipy_packaging.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Answer file maintained by Copier for: https://github.com/KyleKing/calcipy_template
# DO NOT MODIFY THIS FILE. Edit by re-running copier and changing responses to the questions
# Check into version control.
_commit: 1.10.7
_commit: 2.0.3
_src_path: gh:KyleKing/calcipy_template
author_email: [email protected]
author_name: Kyle King
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name: CI Pipeline
- pyproject.toml

env:
COLUMNS: 120
# On Windows, snapshots are skipped because of subtle differences in whitespace
PYTEST_ADDOPTS: "--snapshot-warn-unused"

jobs:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/update_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ jobs:
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v2

# https://github.com/mkdocs/mkdocs/discussions/2369#discussioncomment-625475
- name: Configure git user
Expand Down
15 changes: 4 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ repos:
- id: trailing-whitespace
exclude: __snapshots__/.*\.ambr
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.27.0
rev: v3.29.1
hooks:
- id: commitizen
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies:
- "mdformat-mkdocs[recommended]>=2.1.0"
- "mdformat-mkdocs[recommended]>=3.0.0"
- "mdformat-gfm-alerts>=1.0.1"
args: [--wrap=no]
exclude: _.+\.md|CHANGELOG\.md|CODE_TAG_SUMMARY\.md
Expand All @@ -72,21 +72,14 @@ repos:
exclude: \.copier-answers\.yml|tests/.*/cassettes/.*\.yaml|__snapshots__/.*\.json
types_or: [html, javascript, json, shell, yaml]
stages: ["pre-commit"]
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
exclude: tests/.*/cassettes/.*\.yaml
stages: ["pre-commit"]
- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort-fix
# Don't remove comments and sort order from test files
exclude: poetry\.lock|config_default.toml|demo_config.toml
exclude: poetry\.lock
stages: ["pre-commit"]
- repo: https://github.com/KyleKing/calcipy
rev: 3.0.1
rev: 4.0.0
hooks:
- id: copier-forbidden-files
- id: lint-fix
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python 3.12.0 3.9.13
python 3.12.5 3.9.13
12 changes: 0 additions & 12 deletions .yamllint.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ docker compose logs --follow | awk 'match($0, / \| \{.+/) { print substr($0, RST

## Configuration

Optionally, specify a path to a custom configuration file. See an example configuration file at: [tests/config_default.toml](https://github.com/KyleKing/tail-jsonl/blob/main/tests/config_default.toml)
Optionally, specify a path to a custom configuration file. For an example configuration file see: [./tests/config_default.toml](https://github.com/KyleKing/tail-jsonl/blob/main/tests/config_default.toml)

```sh
echo '...' | tail-jsonl --config-path=~/.tail-jsonl.toml
Expand Down
1 change: 0 additions & 1 deletion docs/docs/Advanced_Documentation.md

This file was deleted.

3 changes: 3 additions & 0 deletions docs/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

### Fix

- and support 'levelname'
- support 'time'
- drop support for Python 3.8
- update dependencies

### Refactor

- update dependencies
- finish pydantic v2 migration

## 1.2.5 (2023-07-23)
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/CODE_TAG_SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Collected Code Tags

| Type | Comment | Last Edit | Source File |
|---------|------------------------------------------------------------------|-------------|------------------------------------------------------------------------------------------------------------------------------------------|
| PLANNED | Add a flag (--debug & store_true) to print debugging information | 2023-02-02 | [tail_jsonl/scripts.py:30](https://github.com/KyleKing/tail-jsonl/blame/fd15e5907afae783ba21bb0f9d310cc6b08008c4/tail_jsonl/main.py#L34) |
| Type | Comment | Last Edit | Source File |
|---------|------------------------------------------------------------------|------------|------------------------------------------------------------------------------------------------------------------------------------------|
| PLANNED | Add a flag (--debug & store_true) to print debugging information | 2023-02-02 | [tail_jsonl/scripts.py:31](https://github.com/KyleKing/tail-jsonl/blame/fd15e5907afae783ba21bb0f9d310cc6b08008c4/tail_jsonl/main.py#L34) |

Found code tags for PLANNED (1)

Expand Down
21 changes: 11 additions & 10 deletions docs/docs/DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ poetry config pypi-token.pypi ...
## Current Status

<!-- {cts} COVERAGE -->
| File | Statements | Missing | Excluded | Coverage |
|-----------------------------------|--------------|-----------|------------|------------|
| `tail_jsonl/__init__.py` | 17 | 0 | 17 | 100.0% |
| `tail_jsonl/_private/__init__.py` | 0 | 0 | 0 | 100.0% |
| `tail_jsonl/_private/core.py` | 49 | 1 | 0 | 92.8% |
| `tail_jsonl/config.py` | 11 | 0 | 0 | 100.0% |
| `tail_jsonl/scripts.py` | 18 | 0 | 11 | 90.9% |
| **Totals** | 95 | 1 | 28 | 94.5% |

Generated on: 2024-04-18
| File | Statements | Missing | Excluded | Coverage |
|-------------------------------------------|------------|---------|----------|----------|
| `tail_jsonl/__init__.py` | 4 | 0 | 0 | 100.0% |
| `tail_jsonl/_private/__init__.py` | 0 | 0 | 0 | 100.0% |
| `tail_jsonl/_private/core.py` | 49 | 1 | 0 | 94.0% |
| `tail_jsonl/_runtime_type_check_setup.py` | 13 | 0 | 33 | 100.0% |
| `tail_jsonl/config.py` | 11 | 0 | 0 | 100.0% |
| `tail_jsonl/scripts.py` | 17 | 0 | 19 | 94.7% |
| **Totals** | 94 | 1 | 52 | 95.9% |

Generated on: 2024-10-04
<!-- {cte} -->
45 changes: 31 additions & 14 deletions docs/gen_ref_nav.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,56 @@
"""Generate the code reference pages and navigation.
"""Generate the code reference pages.

Copied from:
https://github.com/pawamoy/copier-pdm/blob/79135565c4c7f756204a5f460e87129649f8b704/project/docs/gen_ref_nav.py
Adapted without navigation from:
https://github.com/pawamoy/copier-pdm/blob/adff9b64887d0b4c9ec0b42de1698b34858a511e/project/scripts/gen_ref_nav.py

"""

from pathlib import Path

import mkdocs_gen_files
from corallium.tomllib import tomllib

nav = mkdocs_gen_files.Nav()

for path in sorted(Path('tail_jsonl').rglob('*.py')):
def has_public_code(line: str) -> bool:
"""Determine if a given line contains code that will be documented.

Returns:
bool: True if line appears to be a public function, class, or method

"""
for key in ('def', 'async def', 'class'):
starts = line.startswith(f'{key} ')
if starts and not line.startswith(f'{key} _'):
return True
if starts:
break
return False


_config = tomllib.loads(Path('pyproject.toml').read_text(encoding='utf-8'))
_pkg_name = _config['tool']['poetry']['name']
src = Path(_pkg_name)
for path in sorted(src.rglob('*.py')):
for line in path.read_text().split('\n'):
if has_public_code(line):
break
else:
continue # Do not include the file in generated documentation

module_path = path.with_suffix('')
doc_path = path.with_suffix('.md')
full_doc_path = Path('reference', doc_path)

parts = tuple(module_path.parts)

if parts[-1] == '__init__':
parts = parts[:-1]
doc_path = doc_path.with_name('index.md')
full_doc_path = full_doc_path.with_name('index.md')
elif parts[-1] == '__main__':
elif parts[-1].startswith('_'):
continue

nav[parts] = doc_path.as_posix()

with mkdocs_gen_files.open(full_doc_path, 'w') as fd:
ident = '.'.join(parts)
fd.write(f'::: {ident}')

mkdocs_gen_files.set_edit_path(full_doc_path, path)

# FYI, to add pages manually, use: `nav["package", "module"] = "path/to/file.md"`

with mkdocs_gen_files.open('reference/SUMMARY.md', 'w') as nav_file:
nav_file.writelines(nav.build_literate_nav())
17 changes: 0 additions & 17 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,9 @@ watch:
- tail_jsonl

plugins:
- build_plantuml:
render: server # or "local"
bin_path: /usr/local/bin/plantuml # ignored when render: server
server: http://www.plantuml.com/plantuml # official plantuml server
output_format: svg
diagram_root: docs/diagrams
output_folder: out
input_folder: src
input_extensions: puml
- gen-files:
scripts:
- docs/gen_ref_nav.py
- git-revision-date-localized:
enable_creation_date: true
fallback_to_build_date: true
strict: false
type: date
- literate-nav:
nav_file: SUMMARY.md
- mkdocstrings:
handlers:
python:
Expand All @@ -51,7 +35,6 @@ plugins:
separate_signature: true
show_category_heading: true
- search
- section-index

markdown_extensions:
- abbr
Expand Down
Loading