ezplog 2.3.2__tar.gz → 2.3.3__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 (76) hide show
  1. {ezplog-2.3.2 → ezplog-2.3.3}/.github/workflows/00-install-deps.yml +2 -2
  2. {ezplog-2.3.2 → ezplog-2.3.3}/.github/workflows/01-ci.yml +32 -25
  3. {ezplog-2.3.2 → ezplog-2.3.3}/.github/workflows/02-tag-sync.yml +30 -12
  4. {ezplog-2.3.2 → ezplog-2.3.3}/.github/workflows/03-publish.yml +46 -22
  5. ezplog-2.3.3/.github/workflows/04-docs.yml +151 -0
  6. {ezplog-2.3.2 → ezplog-2.3.3}/.github/workflows/README.md +7 -2
  7. {ezplog-2.3.2 → ezplog-2.3.3}/PKG-INFO +1 -1
  8. {ezplog-2.3.2 → ezplog-2.3.3}/pyproject.toml +2 -1
  9. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/_version.py +1 -1
  10. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/cli/commands/_logs.py +202 -134
  11. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/cli/utils/_env_manager.py +1 -1
  12. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/cli/utils/_log_parser.py +6 -2
  13. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/ezpl.py +19 -17
  14. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/handlers/wizard/_progress.py +23 -20
  15. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/handlers/wizard/dynamic.py +3 -3
  16. {ezplog-2.3.2 → ezplog-2.3.3}/uv.lock +1 -1
  17. ezplog-2.3.2/.github/workflows/04-docs.yml +0 -134
  18. {ezplog-2.3.2 → ezplog-2.3.3}/.gitignore +0 -0
  19. {ezplog-2.3.2 → ezplog-2.3.3}/.markdownlint.yaml +0 -0
  20. {ezplog-2.3.2 → ezplog-2.3.3}/.pre-commit-config.yaml +0 -0
  21. {ezplog-2.3.2 → ezplog-2.3.3}/.scripts/build/build_package.py +0 -0
  22. {ezplog-2.3.2 → ezplog-2.3.3}/.scripts/build/upload_to_pypi.py +0 -0
  23. {ezplog-2.3.2 → ezplog-2.3.3}/.scripts/dev/check_merge_conflict.py +0 -0
  24. {ezplog-2.3.2 → ezplog-2.3.3}/.scripts/dev/check_toml.py +0 -0
  25. {ezplog-2.3.2 → ezplog-2.3.3}/.scripts/dev/check_yaml.py +0 -0
  26. {ezplog-2.3.2 → ezplog-2.3.3}/.scripts/dev/generate_architecture_graph.py +0 -0
  27. {ezplog-2.3.2 → ezplog-2.3.3}/.scripts/dev/update_version.py +0 -0
  28. {ezplog-2.3.2 → ezplog-2.3.3}/AGENTS.md +0 -0
  29. {ezplog-2.3.2 → ezplog-2.3.3}/LICENSE +0 -0
  30. {ezplog-2.3.2 → ezplog-2.3.3}/MANIFEST.in +0 -0
  31. {ezplog-2.3.2 → ezplog-2.3.3}/README.md +0 -0
  32. {ezplog-2.3.2 → ezplog-2.3.3}/cliff.toml +0 -0
  33. {ezplog-2.3.2 → ezplog-2.3.3}/herald.config.json +0 -0
  34. {ezplog-2.3.2 → ezplog-2.3.3}/mkdocs.yml +0 -0
  35. {ezplog-2.3.2 → ezplog-2.3.3}/requirements-dev.in +0 -0
  36. {ezplog-2.3.2 → ezplog-2.3.3}/requirements.in +0 -0
  37. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezpl/__init__.py +0 -0
  38. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezpl/py.typed +0 -0
  39. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/__init__.py +0 -0
  40. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/app_mode.py +0 -0
  41. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/cli/__init__.py +0 -0
  42. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/cli/_console.py +0 -0
  43. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/cli/commands/__init__.py +0 -0
  44. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/cli/commands/_config.py +0 -0
  45. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/cli/commands/_docs.py +0 -0
  46. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/cli/commands/_info.py +0 -0
  47. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/cli/commands/_version.py +0 -0
  48. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/cli/main.py +0 -0
  49. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/cli/utils/__init__.py +0 -0
  50. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/cli/utils/_log_stats.py +0 -0
  51. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/config/__init__.py +0 -0
  52. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/config/_defaults.py +0 -0
  53. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/config/manager.py +0 -0
  54. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/core/__init__.py +0 -0
  55. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/core/exceptions.py +0 -0
  56. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/core/interfaces.py +0 -0
  57. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/handlers/__init__.py +0 -0
  58. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/handlers/console.py +0 -0
  59. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/handlers/file.py +0 -0
  60. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/handlers/wizard/__init__.py +0 -0
  61. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/handlers/wizard/_json.py +0 -0
  62. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/handlers/wizard/_panels.py +0 -0
  63. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/handlers/wizard/_tables.py +0 -0
  64. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/handlers/wizard/core.py +0 -0
  65. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/lib_mode.py +0 -0
  66. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/py.typed +0 -0
  67. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/types/__init__.py +0 -0
  68. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/types/aliases.py +0 -0
  69. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/types/enums/__init__.py +0 -0
  70. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/types/enums/log_level.py +0 -0
  71. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/types/enums/patterns.py +0 -0
  72. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/types/protocols/__init__.py +0 -0
  73. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/types/protocols/logger_protocol.py +0 -0
  74. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/types/protocols/printer_protocol.py +0 -0
  75. {ezplog-2.3.2 → ezplog-2.3.3}/src/ezplog/utils/__init__.py +0 -0
  76. {ezplog-2.3.2 → ezplog-2.3.3}/uv.toml +0 -0
@@ -16,7 +16,7 @@ permissions: {}
16
16
 
17
17
  jobs:
18
18
  install:
19
- name: Prime uv cache
19
+ name: Install & cache deps
20
20
  runs-on: ubuntu-24.04
21
21
  timeout-minutes: 10
22
22
  permissions:
@@ -27,4 +27,4 @@ jobs:
27
27
  with:
28
28
  python-version: ${{ inputs.python-version }}
29
29
  enable-cache: true
30
- - run: uv sync --frozen --all-groups
30
+ - run: uv sync --frozen --no-build --all-groups
@@ -1,19 +1,17 @@
1
1
  name: 01 · CI
2
2
 
3
- # Quality gate: lint/format and type-check/import-contracts run first and block
4
- # the test matrix. Runs on PRs, and as the release gate via workflow_call from
5
- # 02-tag-sync (no bare `push` trigger → one CI run per change, no double runs).
3
+ # Quality gate: quality/type-check run first and block the test matrix; security
4
+ # runs in parallel and deliberately gates nothing (it reads an external advisory
5
+ # feed, so it can turn red without the code changing). Runs on PRs, and as the
6
+ # release gate via workflow_call from 02-tag-sync (no bare `push` trigger → one
7
+ # CI run per change, no double runs).
8
+ #
9
+ # No `paths:` filter: the fleet pipeline reads the same in every repo, and a
10
+ # filtered trigger would hide a break the moment a check grows past src/tests.
6
11
 
7
12
  on:
8
13
  pull_request:
9
14
  branches: [main]
10
- paths:
11
- - "src/**"
12
- - "tests/**"
13
- - "pyproject.toml"
14
- - "uv.lock"
15
- - ".github/workflows/00-install-deps.yml"
16
- - ".github/workflows/01-ci.yml"
17
15
  workflow_call:
18
16
  workflow_dispatch:
19
17
 
@@ -25,11 +23,14 @@ concurrency:
25
23
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}
26
24
 
27
25
  jobs:
26
+ # Four consumers (quality, type-check, security, test): all four install,
27
+ # so the primer is above the ~3-consumer heuristic on its own merits.
28
28
  install-deps:
29
+ name: Install & cache deps
29
30
  uses: ./.github/workflows/00-install-deps.yml
30
31
 
31
- lint:
32
- name: Lint & Format Check
32
+ quality:
33
+ name: Lint & format
33
34
  needs: [install-deps]
34
35
  runs-on: ubuntu-24.04
35
36
  timeout-minutes: 15
@@ -39,13 +40,14 @@ jobs:
39
40
  - uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
40
41
  - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
41
42
  with:
43
+ python-version: "3.13"
42
44
  enable-cache: true
43
- - run: uv sync --frozen --group dev
44
- - run: uv run --frozen poe lint
45
- - run: uv run --frozen poe format-check
45
+ - run: uv sync --frozen --no-build --group dev
46
+ - run: uv run --frozen --no-build poe lint
47
+ - run: uv run --frozen --no-build poe format-check
46
48
 
47
49
  type-check:
48
- name: Type Check & Import Contracts
50
+ name: Type check & contracts
49
51
  needs: [install-deps]
50
52
  runs-on: ubuntu-24.04
51
53
  timeout-minutes: 15
@@ -55,15 +57,16 @@ jobs:
55
57
  - uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
56
58
  - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
57
59
  with:
60
+ python-version: "3.13"
58
61
  enable-cache: true
59
- - run: uv sync --frozen --group dev
60
- - run: uv run --frozen poe typecheck
62
+ - run: uv sync --frozen --no-build --group dev
63
+ - run: uv run --frozen --no-build poe typecheck
61
64
  # The poe task carries PYTHONPATH=src itself (import-linter 2.x needs
62
65
  # the package importable).
63
- - run: uv run --frozen poe imports
66
+ - run: uv run --frozen --no-build poe imports
64
67
 
65
68
  security:
66
- name: Security (bandit + pip-audit)
69
+ name: Security scan
67
70
  needs: [install-deps]
68
71
  runs-on: ubuntu-24.04
69
72
  timeout-minutes: 15
@@ -73,13 +76,17 @@ jobs:
73
76
  - uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
74
77
  - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
75
78
  with:
79
+ python-version: "3.13"
76
80
  enable-cache: true
77
- - run: uv sync --frozen --group dev
78
- - run: uv run --frozen poe security
81
+ - run: uv sync --frozen --no-build --group dev
82
+ # `poe security` chains bandit (SAST of the package's own code) and
83
+ # pip-audit (CVEs in the locked dependencies). No advisory is ignored
84
+ # here — if one ever has to be, document impact and exit condition.
85
+ - run: uv run --frozen --no-build poe security
79
86
 
80
87
  test:
81
88
  name: Tests (Python ${{ matrix.python }})
82
- needs: [lint, type-check, security]
89
+ needs: [quality, type-check]
83
90
  runs-on: ubuntu-24.04
84
91
  timeout-minutes: 25
85
92
  permissions:
@@ -94,10 +101,10 @@ jobs:
94
101
  with:
95
102
  python-version: ${{ matrix.python }}
96
103
  enable-cache: true
97
- - run: uv sync --frozen --group dev
104
+ - run: uv sync --frozen --no-build --group dev
98
105
  # `poe test-ci` carries the coverage threshold, which is deliberately
99
106
  # not in addopts: a partial local run must not exit with code 1.
100
- - run: uv run --frozen poe test-ci
107
+ - run: uv run --frozen --no-build poe test-ci
101
108
  - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
102
109
  if: always()
103
110
  with:
@@ -6,6 +6,10 @@ name: 02 · Tag Sync
6
6
  #
7
7
  # A single orchestrator is required because a tag pushed by GITHUB_TOKEN does not
8
8
  # trigger another workflow (loop protection): we call 03/04 directly.
9
+ #
10
+ # The tag is created BEFORE publish runs, so a release whose upload failed shows
11
+ # `skip` on a re-run of this workflow. Recovery is a manual dispatch of
12
+ # 03-publish with `tag_action: create` — the upload is replay-safe.
9
13
 
10
14
  on:
11
15
  push:
@@ -21,13 +25,14 @@ concurrency:
21
25
 
22
26
  jobs:
23
27
  ci:
24
- name: Release gate (CI)
28
+ name: CI gate
25
29
  uses: ./.github/workflows/01-ci.yml
26
30
 
27
31
  tag-sync:
28
- name: Determine action & sync tags
32
+ name: Tag sync
29
33
  needs: ci
30
34
  runs-on: ubuntu-24.04
35
+ timeout-minutes: 15
31
36
  permissions:
32
37
  contents: write # push tags
33
38
  outputs:
@@ -40,10 +45,17 @@ jobs:
40
45
  with:
41
46
  fetch-depth: 0 # full history: need every tag
42
47
 
43
- - name: Extract version from pyproject.toml
48
+ - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
49
+ with:
50
+ python-version: "3.13"
51
+ enable-cache: true
52
+
53
+ # `poe -q read-version` is the single source: 03 and 04 read the version
54
+ # the same way instead of each re-implementing a grep/sed.
55
+ - name: Resolve version
44
56
  id: version
45
57
  run: |
46
- VERSION=$(grep -E '^version\s*=\s*"' pyproject.toml | head -1 | sed 's/.*version\s*=\s*"\([^"]*\)".*/\1/')
58
+ VERSION=$(uv run --frozen --no-build poe -q read-version)
47
59
  if [ -z "$VERSION" ]; then
48
60
  echo "::error::No version found in pyproject.toml"
49
61
  exit 1
@@ -67,14 +79,18 @@ jobs:
67
79
  echo "✅ New version → create $TAG_NAME"
68
80
  fi
69
81
 
70
- - name: Create immutable tag + move floating alias
82
+ - name: Configure git
83
+ if: steps.gate.outputs.tag_action == 'create'
84
+ run: |
85
+ git config user.name "github-actions[bot]"
86
+ git config user.email "github-actions[bot]@users.noreply.github.com"
87
+
88
+ - name: Create tag & move alias
71
89
  if: steps.gate.outputs.tag_action == 'create'
72
90
  run: |
73
91
  VERSION="${{ steps.version.outputs.version }}"
74
92
  MAJOR="${VERSION%%.*}"
75
93
  LATEST_TAG="v${MAJOR}-latest"
76
- git config user.name "github-actions[bot]"
77
- git config user.email "github-actions[bot]@users.noreply.github.com"
78
94
  git tag "v$VERSION" # immutable: never force-pushed
79
95
  git push origin "v$VERSION"
80
96
  git tag -f "$LATEST_TAG" # only the major alias ever moves
@@ -90,8 +106,8 @@ jobs:
90
106
 
91
107
  # Publish is irreversible → runs before docs. Not called on `skip` (already
92
108
  # published); on `preview` it builds + packages only (no upload).
93
- trigger-publish:
94
- name: Publish
109
+ publish:
110
+ name: Publish (PyPI)
95
111
  needs: tag-sync
96
112
  if: needs.tag-sync.outputs.tag_action != 'skip'
97
113
  permissions:
@@ -102,13 +118,15 @@ jobs:
102
118
  version: ${{ needs.tag-sync.outputs.version }}
103
119
  tag_action: ${{ needs.tag-sync.outputs.tag_action }}
104
120
 
105
- trigger-deploy-docs:
121
+ docs:
106
122
  name: Docs
107
- needs: [tag-sync, trigger-publish]
123
+ needs: [tag-sync, publish]
108
124
  if: |
109
125
  always() &&
110
126
  needs.tag-sync.result == 'success' &&
111
- (needs.tag-sync.outputs.tag_action == 'skip' || needs.trigger-publish.result == 'success')
127
+ ( needs.tag-sync.outputs.tag_action == 'skip' ||
128
+ needs.tag-sync.outputs.tag_action == 'preview' ||
129
+ needs.publish.result == 'success' )
112
130
  permissions:
113
131
  contents: write # mike pushes the built docs to the gh-pages branch
114
132
  uses: ./.github/workflows/04-docs.yml
@@ -1,4 +1,4 @@
1
- name: 03 · Publish to PyPI
1
+ name: 03 · Publish
2
2
 
3
3
  # Build + package on every mode; upload to PyPI only when `tag_action` is
4
4
  # `create` (a real release). Gating is keyed on the `tag_action` INPUT, never on
@@ -7,6 +7,14 @@ name: 03 · Publish to PyPI
7
7
  # and an `event_name == 'workflow_dispatch'` escape hatch would let a manual run
8
8
  # from an arbitrary ref fire the irreversible PyPI upload. A manual dispatch
9
9
  # therefore defaults to `preview` and must opt in explicitly.
10
+ #
11
+ # A dispatch has no upstream CI gate (02-tag-sync runs 01-ci before calling us),
12
+ # so the gate-equivalent step runs under `event_name == 'workflow_dispatch'` —
13
+ # the one place that signal is the right one, since a workflow_call inherits the
14
+ # caller's event and never matches.
15
+ #
16
+ # The FILENAME is what PyPI's Trusted Publisher matches: renaming this file
17
+ # breaks OIDC until the publisher is re-registered.
10
18
 
11
19
  on:
12
20
  workflow_dispatch:
@@ -32,7 +40,7 @@ on:
32
40
  permissions: {}
33
41
 
34
42
  concurrency:
35
- group: publish-${{ github.ref }}
43
+ group: publish
36
44
  cancel-in-progress: false
37
45
 
38
46
  env:
@@ -40,8 +48,9 @@ env:
40
48
 
41
49
  jobs:
42
50
  validate:
43
- name: Validate & Build
51
+ name: Validate & build
44
52
  runs-on: ubuntu-24.04
53
+ timeout-minutes: 20
45
54
  permissions:
46
55
  contents: read
47
56
  outputs:
@@ -50,43 +59,50 @@ jobs:
50
59
  steps:
51
60
  - uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
52
61
 
62
+ - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
63
+ with:
64
+ python-version: "3.13"
65
+ enable-cache: true
66
+
67
+ - run: uv sync --frozen --no-build --group dev
68
+
69
+ # The caller's input must agree with pyproject.toml, or the artifact would
70
+ # be published under a number that is not the one the tag points at.
53
71
  - name: Resolve version
54
72
  id: version
55
73
  env:
56
74
  INPUT_VERSION: ${{ inputs.version || '' }}
57
75
  run: |
58
- VERSION="$INPUT_VERSION"
59
- if [ -z "$VERSION" ]; then
60
- VERSION=$(grep -E '^version\s*=\s*"' pyproject.toml | head -1 | sed 's/.*version\s*=\s*"\([^"]*\)".*/\1/')
61
- fi
76
+ FILE_VERSION=$(uv run --frozen --no-build poe -q read-version)
77
+ VERSION="${INPUT_VERSION:-$FILE_VERSION}"
62
78
  if [ -z "$VERSION" ]; then
63
79
  echo "::error::No version found in pyproject.toml"
64
80
  exit 1
65
81
  fi
82
+ if [ "$VERSION" != "$FILE_VERSION" ]; then
83
+ echo "::error::Version mismatch: input $VERSION vs pyproject.toml $FILE_VERSION"
84
+ exit 1
85
+ fi
66
86
  echo "version=$VERSION" >> "$GITHUB_OUTPUT"
67
87
  echo "Version: $VERSION"
68
88
 
69
- - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
70
- with:
71
- enable-cache: true
72
-
73
- - run: uv sync --frozen --group dev
74
-
75
- - name: Enforce import contracts
76
- run: uv run --frozen poe imports
89
+ # Gate-equivalent for a manual dispatch only: on the cascade path 01-ci
90
+ # already proved this exact commit, so re-running it would be waste.
91
+ - name: Verify the dispatch gate passes
92
+ if: github.event_name == 'workflow_dispatch'
93
+ run: uv run --frozen --no-build poe check
77
94
 
78
95
  - name: Build package
79
- run: uv run --frozen poe build
96
+ run: uv run --frozen --no-build poe build
80
97
 
81
- - name: Check package
82
- run: uv run --frozen twine check dist/*
98
+ - name: Verify package metadata
99
+ run: uv run --frozen --no-build twine check dist/*
83
100
 
84
- - name: Verify wheel installation
101
+ - name: Verify package contents
85
102
  run: |
86
103
  python -m zipfile -t dist/*.whl
87
104
  python - <<'PY'
88
105
  import glob
89
- import sys
90
106
  import zipfile
91
107
 
92
108
  wheels = glob.glob("dist/*.whl")
@@ -109,10 +125,11 @@ jobs:
109
125
  retention-days: 1
110
126
 
111
127
  publish:
112
- name: Publish to PyPI (OIDC)
128
+ name: Publish (PyPI)
113
129
  needs: validate
114
130
  if: inputs.tag_action == 'create'
115
131
  runs-on: ubuntu-24.04
132
+ timeout-minutes: 15
116
133
  permissions:
117
134
  contents: read
118
135
  id-token: write
@@ -126,13 +143,20 @@ jobs:
126
143
  name: dist
127
144
  path: dist/
128
145
 
129
- - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
146
+ - name: Publish (OIDC)
147
+ uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
130
148
  with:
131
149
  verbose: true
150
+ # Replay-safe: 02-tag-sync creates the tag before this job runs, so a
151
+ # release whose upload failed is recovered by dispatching 03 again.
152
+ # Without this, the replay would 409 on the already-present version.
153
+ skip-existing: true
132
154
  # Attestations disabled: when called as a reusable workflow from
133
155
  # 02-tag-sync.yml, the OIDC token's Build Config URI reflects the
134
156
  # caller rather than this workflow, causing PyPI Trusted Publisher
135
157
  # verification to fail.
158
+ # Exit condition: re-enable once PyPI matches the called workflow's
159
+ # job_workflow_ref rather than the caller's.
136
160
  attestations: false
137
161
 
138
162
  - name: Summary
@@ -0,0 +1,151 @@
1
+ name: 04 · Docs
2
+
3
+ # Two jobs, because the mode decides the command (mike is a branch-push tool —
4
+ # family A: it builds and pushes in one go):
5
+ #
6
+ # build → pull requests only: `mkdocs build --strict`, no write permission.
7
+ # docs → the cascade from 02-tag-sync, keyed on the `tag_action` INPUT:
8
+ # create → mike deploy <version> + move `latest` alias
9
+ # skip → mike deploy `dev` alias (state of main between releases)
10
+ # preview → mike deploy WITHOUT --push (validate the config only)
11
+ #
12
+ # The deploy job is gated on the input alone, so a pull request — which supplies
13
+ # no input — never reaches it, and `contents: write` is never granted to a run
14
+ # executing pull-request code.
15
+
16
+ on:
17
+ pull_request:
18
+ branches: [main]
19
+ paths:
20
+ - "docs/**"
21
+ - "mkdocs.yml"
22
+ - "pyproject.toml"
23
+ - "uv.lock"
24
+ - ".github/workflows/04-docs.yml"
25
+ workflow_dispatch:
26
+ inputs:
27
+ tag_action:
28
+ description: "create = deploy + move `latest` (pushes) | skip = deploy `dev` | preview = build only"
29
+ required: true
30
+ type: choice
31
+ default: preview
32
+ options:
33
+ - preview
34
+ - skip
35
+ - create
36
+ workflow_call:
37
+ inputs:
38
+ version:
39
+ required: false
40
+ type: string
41
+ tag_action:
42
+ description: "create | skip | preview"
43
+ required: false
44
+ type: string
45
+ default: preview
46
+
47
+ permissions: {} # each job grants its own
48
+
49
+ jobs:
50
+ build:
51
+ name: Build docs
52
+ if: github.event_name == 'pull_request'
53
+ runs-on: ubuntu-24.04
54
+ timeout-minutes: 20
55
+ permissions:
56
+ contents: read
57
+ concurrency:
58
+ group: docs-build-${{ github.ref }}
59
+ cancel-in-progress: true
60
+ steps:
61
+ - uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
62
+ - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
63
+ with:
64
+ python-version: "3.13"
65
+ enable-cache: true
66
+ - run: uv sync --frozen --no-build --group docs --group test
67
+ # The mkdocs-coverage plugin crashes on a missing (or empty) htmlcov/, so
68
+ # the report has to exist before the build — it is a docs input here, not
69
+ # a test run.
70
+ - name: Generate coverage report
71
+ run: uv run --frozen --no-build poe docs-coverage
72
+ # --strict: a dead nav entry or a broken reference fails the PR instead of
73
+ # reaching the published site.
74
+ - run: uv run --frozen --no-build poe docs-build
75
+
76
+ docs:
77
+ name: Build & deploy docs
78
+ # Gate on the INPUT, never on github.event_name: a reusable workflow
79
+ # inherits the caller's event (`push`), and a pull request supplies no
80
+ # input at all.
81
+ if: inputs.tag_action == 'create' || inputs.tag_action == 'skip' || inputs.tag_action == 'preview'
82
+ runs-on: ubuntu-24.04
83
+ timeout-minutes: 20
84
+ permissions:
85
+ contents: write # mike pushes the built site to the gh-pages branch
86
+ concurrency:
87
+ group: pages
88
+ cancel-in-progress: false # never interrupt a live docs deploy
89
+
90
+ steps:
91
+ - uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
92
+ with:
93
+ fetch-depth: 0
94
+
95
+ - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
96
+ with:
97
+ python-version: "3.13"
98
+ enable-cache: true
99
+
100
+ - run: uv sync --frozen --no-build --group docs --group test
101
+
102
+ - name: Generate coverage report
103
+ run: uv run --frozen --no-build poe docs-coverage
104
+
105
+ - name: Generate architecture graph
106
+ run: uv run --frozen --no-build poe graph
107
+
108
+ - name: Generate changelog
109
+ uses: orhun/git-cliff-action@f50e11560dce63f7c33227798f90b924471a88b5 # v4
110
+ with:
111
+ config: cliff.toml
112
+ args: --output docs/changelog.md
113
+
114
+ - name: Resolve docs version
115
+ id: docs_version
116
+ env:
117
+ INPUT_VERSION: ${{ inputs.version || '' }}
118
+ run: |
119
+ VERSION="${INPUT_VERSION:-$(uv run --frozen --no-build poe -q read-version)}"
120
+ if [ -z "$VERSION" ]; then
121
+ echo "::error::No version found in pyproject.toml"
122
+ exit 1
123
+ fi
124
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
125
+ echo "Version: $VERSION"
126
+
127
+ - name: Configure git
128
+ run: |
129
+ git config user.name "github-actions[bot]"
130
+ git config user.email "github-actions[bot]@users.noreply.github.com"
131
+
132
+ # create → publish the versioned release + move `latest`.
133
+ - name: Deploy release docs (create)
134
+ if: inputs.tag_action == 'create'
135
+ env:
136
+ DOCS_VERSION: ${{ steps.docs_version.outputs.version }}
137
+ run: |
138
+ uv run --frozen --no-build mike deploy --push --update-aliases "$DOCS_VERSION" latest
139
+ uv run --frozen --no-build mike set-default --push latest
140
+
141
+ # skip → refresh the `dev` alias so main stays visible between releases.
142
+ - name: Deploy dev docs (skip)
143
+ if: inputs.tag_action == 'skip'
144
+ run: uv run --frozen --no-build mike deploy --push --update-aliases dev
145
+
146
+ # preview → build the versioned site WITHOUT pushing, to validate config.
147
+ - name: Validate docs build (preview)
148
+ if: inputs.tag_action == 'preview'
149
+ env:
150
+ DOCS_VERSION: ${{ steps.docs_version.outputs.version }}
151
+ run: uv run --frozen --no-build mike deploy --update-aliases "$DOCS_VERSION" latest
@@ -5,10 +5,10 @@ order. The number sorts them in the file tree and documents the cascade.
5
5
 
6
6
  ```text
7
7
  00-install-deps ← primes the uv cache (keyed on uv.lock)
8
- 01-ci ← lint ∥ type-check ∥ security → test matrix; the quality gate
8
+ 01-ci ← quality ∥ type-check ∥ security → test matrix; the quality gate
9
9
  02-tag-sync ← orchestrator: CI gate → tag_action → cascade 03 then 04
10
10
  03-publish ← build always; upload to PyPI on `create` only (OIDC)
11
- 04-docs ← build always; deploy latest / dev / none by tag_action
11
+ 04-docs ← build (strict) on PRs; deploy latest / dev / none by tag_action
12
12
  ```
13
13
 
14
14
  ## The three-state `tag_action`
@@ -46,6 +46,11 @@ In a reusable workflow the `github` context is **inherited from the caller**, so
46
46
  `github.event_name` inside `03`/`04` is the caller's event (`push`), never
47
47
  `workflow_call`. Publish/deploy steps therefore gate on the `tag_action` input.
48
48
 
49
+ The one legitimate use of `github.event_name` is the opposite question — "was
50
+ there an upstream gate?". A `workflow_dispatch` of `03` runs without `02`'s CI
51
+ gate, so `03` re-runs `poe check` under `event_name == 'workflow_dispatch'`;
52
+ on the cascade path that condition never matches and the gate is not repeated.
53
+
49
54
  ## No `secrets: inherit`
50
55
 
51
56
  The cascade passes typed `with:` inputs only and relies on **OIDC**
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ezplog
3
- Version: 2.3.2
3
+ Version: 2.3.3
4
4
  Summary: Modern Python logging framework with Rich console output and loguru file logging, featuring advanced display capabilities, configuration management, and a simple typed API.
5
5
  Project-URL: Homepage, https://github.com/neuraaak/ezplog
6
6
  Project-URL: Documentation, https://neuraaak.github.io/ezplog/
@@ -17,7 +17,7 @@ build-backend = "hatchling.build"
17
17
 
18
18
  [project]
19
19
  name = "ezplog"
20
- version = "2.3.2"
20
+ version = "2.3.3"
21
21
  description = "Modern Python logging framework with Rich console output and loguru file logging, featuring advanced display capabilities, configuration management, and a simple typed API."
22
22
  readme = "README.md"
23
23
  requires-python = ">=3.13"
@@ -144,6 +144,7 @@ docs-build = "mkdocs build --strict"
144
144
  docs-coverage = "pytest --cov=src/ezplog --cov-report=html --cov-report=xml -q"
145
145
  graph = "python .scripts/dev/generate_architecture_graph.py"
146
146
  version = "python .scripts/dev/update_version.py"
147
+ read-version = '''python -c "import tomllib, pathlib; print(tomllib.loads(pathlib.Path('pyproject.toml').read_text(encoding='utf-8'))['project']['version'])"'''
147
148
  build = "uv build"
148
149
 
149
150
  [tool.poe.tasks.imports]
@@ -7,4 +7,4 @@
7
7
 
8
8
  from __future__ import annotations
9
9
 
10
- __version__ = "2.3.2"
10
+ __version__ = "2.3.3"