Skip to content

Commit b2e8d86

Browse files
authored
Merge pull request #154 from stared/make-it-glow-with-uv
Make it glow with uv
2 parents 713a79b + 3d03dfb commit b2e8d86

19 files changed

Lines changed: 3028 additions & 233 deletions

.github/workflows/docs.yml

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
1-
# This workflow will build docs and push it to branch gh-pages
2-
# For more information see: https://github.com/marketplace/actions/deploy-to-github-pages-python
1+
name: Docs
32

4-
name: Generate pdoc3 documentation
53
on:
64
push:
7-
branches:
8-
- main
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
916

1017
jobs:
11-
build-and-deploy:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: astral-sh/setup-uv@v4
23+
with:
24+
enable-cache: true
25+
- run: uv sync --group docs
26+
- run: uv run pdoc -o site livelossplot '!livelossplot.inputs'
27+
- uses: actions/upload-pages-artifact@v3
28+
with:
29+
path: site
30+
31+
deploy:
32+
needs: build
1233
runs-on: ubuntu-latest
34+
environment:
35+
name: github-pages
36+
url: ${{ steps.deployment.outputs.page_url }}
1337
steps:
14-
- uses: actions/checkout@v4
15-
- name: Set up Python 3.11
16-
uses: actions/setup-python@v5
17-
with:
18-
python-version: "3.11"
19-
- name: Install livelossplot with dependencies
20-
run: |
21-
pip install -e .
22-
- name: Install pdoc3
23-
run: |
24-
pip install pdoc3
25-
- name: Checkout
26-
uses: actions/checkout@master
27-
- name: Generate docs
28-
run: |
29-
pdoc3 --html livelossplot --force --output-dir docs --skip-errors
30-
- name: Deploy
31-
uses: peaceiris/actions-gh-pages@v3
32-
with:
33-
github_token: ${{ secrets.GITHUB_TOKEN }}
34-
publish_dir: ./docs/livelossplot/
38+
- id: deployment
39+
uses: actions/deploy-pages@v4
Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,27 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
4-
name: Python package with external dependencies
1+
name: External integrations
52

63
on:
74
push:
8-
branches: [ main ]
5+
branches: [main]
96
pull_request:
10-
branches: [ main ]
7+
branches: [main]
118

129
jobs:
13-
build:
14-
10+
external:
1511
runs-on: ubuntu-latest
1612
steps:
17-
- uses: actions/checkout@v4
18-
- name: Set up Python
19-
uses: actions/setup-python@v5
20-
with:
21-
python-version: "3.11"
22-
- name: Install package and dev dependencies
23-
run: |
24-
python -m pip install --upgrade pip
25-
pip install -e .
26-
pip install -r requirements-dev.txt
27-
- name: Test TensorBoard output
28-
run: |
29-
pip install tensorflow tensorboard
30-
pytest tests/external_test_tensorboard.py
31-
- name: Test Keras input
32-
run: |
33-
pip install keras
34-
pytest tests/external_test_keras.py
35-
- name: Test PyTorch Ignite input
36-
run: |
37-
pip install pytorch-ignite
38-
pytest tests/external_test_pytorch_ignite.py
39-
- name: Test Poutyne input
40-
run: |
41-
pip install poutyne
42-
pytest tests/external_test_poutyne.py
43-
- name: Test Jupyter Notebook matplotlib output
44-
run: |
45-
pytest tests/external_test_examples.py
13+
- uses: actions/checkout@v4
14+
- uses: astral-sh/setup-uv@v4
15+
with:
16+
enable-cache: true
17+
- run: uv sync --group dev
18+
- name: TensorBoard
19+
run: uv run --with tensorflow --with tensorboard pytest tests/external_test_tensorboard.py
20+
- name: Keras
21+
run: uv run --with keras --with tensorflow pytest tests/external_test_keras.py
22+
- name: PyTorch Ignite
23+
run: uv run --with pytorch-ignite pytest tests/external_test_pytorch_ignite.py
24+
- name: Poutyne
25+
run: uv run --with poutyne pytest tests/external_test_poutyne.py
26+
- name: Notebook examples
27+
run: uv run pytest tests/external_test_examples.py

.github/workflows/flake8_yapf.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: astral-sh/setup-uv@v4
15+
with:
16+
enable-cache: true
17+
- run: uv sync --group dev
18+
- name: Ruff
19+
run: uv run ruff check .
20+
- name: Ty (informational)
21+
run: uv run ty check livelossplot
22+
continue-on-error: true

.github/workflows/pythonpackage.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Required: PYPI_API_TOKEN — generate at https://pypi.org/manage/account/token/
2+
3+
name: Release
4+
5+
on:
6+
push:
7+
tags:
8+
- 'v*'
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: astral-sh/setup-uv@v4
19+
20+
- name: Verify tag matches package version
21+
run: |
22+
TAG_VERSION="${GITHUB_REF_NAME#v}"
23+
PKG_VERSION="$(uv run --no-project python -c 'import tomllib, pathlib; print(tomllib.loads(pathlib.Path("pyproject.toml").read_text())["project"]["version"])')"
24+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
25+
echo "Tag $GITHUB_REF_NAME does not match pyproject version $PKG_VERSION" >&2
26+
exit 1
27+
fi
28+
29+
- name: Build sdist + wheel
30+
run: uv build
31+
32+
- name: Publish to PyPI
33+
env:
34+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
35+
run: uv publish
36+
37+
- name: Extract changelog section
38+
run: |
39+
VERSION="${GITHUB_REF_NAME#v}"
40+
awk -v ver="$VERSION" '
41+
/^## \[/ {
42+
if (in_section) { exit }
43+
if (index($0, "[" ver "]") > 0) { in_section = 1; next }
44+
}
45+
in_section { print }
46+
' CHANGELOG.md > release_notes.md
47+
if [ ! -s release_notes.md ]; then
48+
echo "No changelog section found for version $VERSION" >&2
49+
exit 1
50+
fi
51+
52+
- name: Create GitHub Release
53+
env:
54+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
run: |
56+
gh release create "$GITHUB_REF_NAME" \
57+
--title "$GITHUB_REF_NAME" \
58+
--notes-file release_notes.md \
59+
dist/*

.github/workflows/tests.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ['3.10', '3.11', '3.12', '3.13']
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: astral-sh/setup-uv@v4
19+
with:
20+
enable-cache: true
21+
- run: uv sync --group dev --python ${{ matrix.python-version }}
22+
- run: uv run --python ${{ matrix.python-version }} pytest

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ build/
99
tensorboard_logs/
1010
examples/_test*
1111
.mypy_cache/
12+
.pytest_cache/
13+
.ruff_cache/
14+
.ty_cache/
15+
16+
# uv
17+
.venv/
1218

1319
# OS / editor cruft
1420
.DS_Store

.yapfignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
## [0.5.7] - 2026-05-04
10+
## [0.6.0] - 2026-05-04
1111

12-
### Fixed
12+
### Changed
1313

14-
- `BokehPlot` now renders and live-updates inside Google Colab. Colab blocks Jupyter Comms, so `push_notebook` was silently dead; the plot is now embedded via `<iframe srcdoc>` and refreshed through an IPython `display_id` handle ([issue #109](https://github.com/stared/livelossplot/issues/109)).
15-
- `Plot2d` works again as a `PlotLosses` output. Removed buggy `super().__init__(self)` in `LossSubplot`/`Plot1D` and reworked `Plot2d.send` to manage its own figure/axes and use the configured `predict` callback ([issue #137](https://github.com/stared/livelossplot/issues/137), PR #138).
16-
- `MatplotlibPlot` no longer errors when `max_cols=1` (PR #147).
17-
- Groups whose metrics start at different steps now plot correctly (PR #149).
18-
- CI: install `tensorboard` explicitly — TensorFlow 2.16+ no longer bundles it, which broke `external_test_tensorboard.py`.
14+
- Minimum Python is now 3.10.
1915

2016
### Removed
2117

22-
- Neptune.AI support (`NeptuneLogger`, `to_neptune`, and the related example/test) — Neptune is no longer maintained.
18+
- Neptune.AI integration — Neptune is no longer maintained.
2319

24-
### Chore
20+
### Fixed
2521

26-
- Default branch renamed `master``main`; build badges updated.
22+
- `BokehPlot` now works in Google Colab ([issue #109](https://github.com/stared/livelossplot/issues/109)).
23+
- `Plot2d` works again as a `PlotLosses` output ([issue #137](https://github.com/stared/livelossplot/issues/137)).
24+
- `MatplotlibPlot` no longer errors when `max_cols=1` (PR #147).
25+
- Groups whose metrics start at different steps now plot correctly (PR #149).
2726

2827
## [0.5.6] - 2025-01-03
2928

0 commit comments

Comments
 (0)