ezplog 2.3.2__tar.gz → 2.3.4__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.
- ezplog-2.3.4/.github/dependabot.yml +16 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/.github/workflows/00-install-deps.yml +3 -3
- ezplog-2.3.4/.github/workflows/01-ci.yml +115 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/.github/workflows/02-tag-sync.yml +30 -12
- {ezplog-2.3.2 → ezplog-2.3.4}/.github/workflows/03-publish.yml +47 -23
- ezplog-2.3.4/.github/workflows/04-docs.yml +151 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/.github/workflows/README.md +7 -2
- ezplog-2.3.4/.python-version +1 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/PKG-INFO +2 -2
- {ezplog-2.3.2 → ezplog-2.3.4}/pyproject.toml +3 -2
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/_version.py +1 -1
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/cli/commands/_logs.py +202 -134
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/cli/utils/_env_manager.py +1 -1
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/cli/utils/_log_parser.py +6 -2
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/ezpl.py +19 -17
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/handlers/wizard/_progress.py +23 -20
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/handlers/wizard/dynamic.py +3 -3
- {ezplog-2.3.2 → ezplog-2.3.4}/uv.lock +10 -10
- ezplog-2.3.2/.github/workflows/01-ci.yml +0 -108
- ezplog-2.3.2/.github/workflows/04-docs.yml +0 -134
- {ezplog-2.3.2 → ezplog-2.3.4}/.gitignore +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/.markdownlint.yaml +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/.pre-commit-config.yaml +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/.scripts/build/build_package.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/.scripts/build/upload_to_pypi.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/.scripts/dev/check_merge_conflict.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/.scripts/dev/check_toml.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/.scripts/dev/check_yaml.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/.scripts/dev/generate_architecture_graph.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/.scripts/dev/update_version.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/AGENTS.md +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/LICENSE +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/MANIFEST.in +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/README.md +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/cliff.toml +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/herald.config.json +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/mkdocs.yml +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/requirements-dev.in +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/requirements.in +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezpl/__init__.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezpl/py.typed +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/__init__.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/app_mode.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/cli/__init__.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/cli/_console.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/cli/commands/__init__.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/cli/commands/_config.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/cli/commands/_docs.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/cli/commands/_info.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/cli/commands/_version.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/cli/main.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/cli/utils/__init__.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/cli/utils/_log_stats.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/config/__init__.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/config/_defaults.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/config/manager.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/core/__init__.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/core/exceptions.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/core/interfaces.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/handlers/__init__.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/handlers/console.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/handlers/file.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/handlers/wizard/__init__.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/handlers/wizard/_json.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/handlers/wizard/_panels.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/handlers/wizard/_tables.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/handlers/wizard/core.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/lib_mode.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/py.typed +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/types/__init__.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/types/aliases.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/types/enums/__init__.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/types/enums/log_level.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/types/enums/patterns.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/types/protocols/__init__.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/types/protocols/logger_protocol.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/types/protocols/printer_protocol.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/src/ezplog/utils/__init__.py +0 -0
- {ezplog-2.3.2 → ezplog-2.3.4}/uv.toml +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
|
3
|
+
# Please see the documentation for all configuration options:
|
|
4
|
+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
5
|
+
|
|
6
|
+
version: 2
|
|
7
|
+
updates:
|
|
8
|
+
- package-ecosystem: pip
|
|
9
|
+
directory: /
|
|
10
|
+
schedule:
|
|
11
|
+
interval: weekly
|
|
12
|
+
|
|
13
|
+
- package-ecosystem: github-actions
|
|
14
|
+
directory: /
|
|
15
|
+
schedule:
|
|
16
|
+
interval: weekly
|
|
@@ -16,15 +16,15 @@ permissions: {}
|
|
|
16
16
|
|
|
17
17
|
jobs:
|
|
18
18
|
install:
|
|
19
|
-
name:
|
|
19
|
+
name: Install & cache deps
|
|
20
20
|
runs-on: ubuntu-24.04
|
|
21
21
|
timeout-minutes: 10
|
|
22
22
|
permissions:
|
|
23
23
|
contents: read
|
|
24
24
|
steps:
|
|
25
25
|
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
|
|
26
|
-
- uses: astral-sh/setup-uv@
|
|
26
|
+
- uses: astral-sh/setup-uv@18d369b23da25a81e9458561248e1aafff6a70fa # v10.3.1
|
|
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
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
name: 01 · CI
|
|
2
|
+
|
|
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.
|
|
11
|
+
|
|
12
|
+
on:
|
|
13
|
+
pull_request:
|
|
14
|
+
branches: [main]
|
|
15
|
+
workflow_call:
|
|
16
|
+
workflow_dispatch:
|
|
17
|
+
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
|
|
21
|
+
concurrency:
|
|
22
|
+
group: ci-${{ github.ref }}
|
|
23
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
24
|
+
|
|
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
|
+
install-deps:
|
|
29
|
+
name: Install & cache deps
|
|
30
|
+
uses: ./.github/workflows/00-install-deps.yml
|
|
31
|
+
|
|
32
|
+
quality:
|
|
33
|
+
name: Lint & format
|
|
34
|
+
needs: [install-deps]
|
|
35
|
+
runs-on: ubuntu-24.04
|
|
36
|
+
timeout-minutes: 15
|
|
37
|
+
permissions:
|
|
38
|
+
contents: read
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
|
|
41
|
+
- uses: astral-sh/setup-uv@18d369b23da25a81e9458561248e1aafff6a70fa # v10.3.1
|
|
42
|
+
with:
|
|
43
|
+
python-version: "3.13"
|
|
44
|
+
enable-cache: true
|
|
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
|
|
48
|
+
|
|
49
|
+
type-check:
|
|
50
|
+
name: Type check & contracts
|
|
51
|
+
needs: [install-deps]
|
|
52
|
+
runs-on: ubuntu-24.04
|
|
53
|
+
timeout-minutes: 15
|
|
54
|
+
permissions:
|
|
55
|
+
contents: read
|
|
56
|
+
steps:
|
|
57
|
+
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
|
|
58
|
+
- uses: astral-sh/setup-uv@18d369b23da25a81e9458561248e1aafff6a70fa # v10.3.1
|
|
59
|
+
with:
|
|
60
|
+
python-version: "3.13"
|
|
61
|
+
enable-cache: true
|
|
62
|
+
- run: uv sync --frozen --no-build --group dev
|
|
63
|
+
- run: uv run --frozen --no-build poe typecheck
|
|
64
|
+
# The poe task carries PYTHONPATH=src itself (import-linter 2.x needs
|
|
65
|
+
# the package importable).
|
|
66
|
+
- run: uv run --frozen --no-build poe imports
|
|
67
|
+
|
|
68
|
+
security:
|
|
69
|
+
name: Security scan
|
|
70
|
+
needs: [install-deps]
|
|
71
|
+
runs-on: ubuntu-24.04
|
|
72
|
+
timeout-minutes: 15
|
|
73
|
+
permissions:
|
|
74
|
+
contents: read
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
|
|
77
|
+
- uses: astral-sh/setup-uv@18d369b23da25a81e9458561248e1aafff6a70fa # v10.3.1
|
|
78
|
+
with:
|
|
79
|
+
python-version: "3.13"
|
|
80
|
+
enable-cache: true
|
|
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
|
|
86
|
+
|
|
87
|
+
test:
|
|
88
|
+
name: Tests (Python ${{ matrix.python }})
|
|
89
|
+
needs: [quality, type-check]
|
|
90
|
+
runs-on: ubuntu-24.04
|
|
91
|
+
timeout-minutes: 25
|
|
92
|
+
permissions:
|
|
93
|
+
contents: read
|
|
94
|
+
strategy:
|
|
95
|
+
fail-fast: false
|
|
96
|
+
matrix:
|
|
97
|
+
python: ["3.13"]
|
|
98
|
+
steps:
|
|
99
|
+
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
|
|
100
|
+
- uses: astral-sh/setup-uv@18d369b23da25a81e9458561248e1aafff6a70fa # v10.3.1
|
|
101
|
+
with:
|
|
102
|
+
python-version: ${{ matrix.python }}
|
|
103
|
+
enable-cache: true
|
|
104
|
+
- run: uv sync --frozen --no-build --group dev
|
|
105
|
+
# `poe test-ci` carries the coverage threshold, which is deliberately
|
|
106
|
+
# not in addopts: a partial local run must not exit with code 1.
|
|
107
|
+
- run: uv run --frozen --no-build poe test-ci
|
|
108
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
109
|
+
if: always()
|
|
110
|
+
with:
|
|
111
|
+
name: coverage-report
|
|
112
|
+
path: |
|
|
113
|
+
coverage.xml
|
|
114
|
+
htmlcov/
|
|
115
|
+
retention-days: 7
|
|
@@ -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:
|
|
28
|
+
name: CI gate
|
|
25
29
|
uses: ./.github/workflows/01-ci.yml
|
|
26
30
|
|
|
27
31
|
tag-sync:
|
|
28
|
-
name:
|
|
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
|
-
-
|
|
48
|
+
- uses: astral-sh/setup-uv@18d369b23da25a81e9458561248e1aafff6a70fa # v10.3.1
|
|
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=$(
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
121
|
+
docs:
|
|
106
122
|
name: Docs
|
|
107
|
-
needs: [tag-sync,
|
|
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' ||
|
|
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
|
|
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
|
|
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 &
|
|
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@18d369b23da25a81e9458561248e1aafff6a70fa # v10.3.1
|
|
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
|
-
|
|
59
|
-
|
|
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
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
@@ -121,18 +138,25 @@ jobs:
|
|
|
121
138
|
url: https://pypi.org/project/${{ env.PACKAGE_NAME }}/${{ needs.validate.outputs.version }}/
|
|
122
139
|
|
|
123
140
|
steps:
|
|
124
|
-
- uses: actions/download-artifact@
|
|
141
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
125
142
|
with:
|
|
126
143
|
name: dist
|
|
127
144
|
path: dist/
|
|
128
145
|
|
|
129
|
-
-
|
|
146
|
+
- name: Publish (OIDC)
|
|
147
|
+
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
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@18d369b23da25a81e9458561248e1aafff6a70fa # v10.3.1
|
|
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@18d369b23da25a81e9458561248e1aafff6a70fa # v10.3.1
|
|
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@a9a95522b26fe6403f7bb24031f21fb573d0f5ff # 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 ←
|
|
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
|
|
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**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.14.10
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: ezplog
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.4
|
|
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/
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# Hatchling 1.32+ emits Metadata-Version 2.5, which is rejected by the
|
|
8
8
|
# twine bundled in pypa/gh-action-pypi-publish. Keep 1.31.x until that action
|
|
9
9
|
# accepts the newer metadata version.
|
|
10
|
-
requires = ["hatchling>=1.27,<1.
|
|
10
|
+
requires = ["hatchling>=1.27,<1.33"]
|
|
11
11
|
build-backend = "hatchling.build"
|
|
12
12
|
|
|
13
13
|
# ///////////////////////////////////////////////////////////////
|
|
@@ -17,7 +17,7 @@ build-backend = "hatchling.build"
|
|
|
17
17
|
|
|
18
18
|
[project]
|
|
19
19
|
name = "ezplog"
|
|
20
|
-
version = "2.3.
|
|
20
|
+
version = "2.3.4"
|
|
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]
|