Move build system from setuptools to uv, wire uv into CI/CD
Convert both pyproject.toml files to the uv_build backend and turn the repo into a proper uv workspace (plotstyle moved to src layout, since uv_build requires the module in its own subdirectory). Dev tooling moves from an optional-dependencies extra to a dependency-group, and plotstyle's matplotlib dependency is now its own rather than a gallery "plotting" extra. Gitea Actions workflows and the Dockerfile now use astral-sh/setup-uv, uv sync, uv run, uv build, and uv publish throughout instead of pip, build, and twine. Also fixes .dockerignore, which was excluding uv.lock, deploy/, and README.md and would have broken even the previous Dockerfile's COPY of deploy/entrypoint.sh. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+9
-6
@@ -21,15 +21,18 @@ produces. Everything below is the reference; the notebook is the demo.
|
||||
|
||||
## Install
|
||||
|
||||
`plotstyle` is its own project (`plotstyle/pyproject.toml`, `uv_build`
|
||||
backend, code under `plotstyle/src/plotstyle/`) and a member of this repo's
|
||||
uv workspace (`[tool.uv.workspace]` in the root `pyproject.toml`) — not a
|
||||
`gallery` extra.
|
||||
|
||||
```bash
|
||||
uv sync --extra plotting # this repo's uv workflow
|
||||
# or
|
||||
pip install -e ".[plotting]"
|
||||
uv sync --all-packages # this repo's uv workflow — installs gallery + plotstyle together
|
||||
```
|
||||
|
||||
`plotstyle` is an optional extra (`matplotlib>=3.7`) so core `gallery`
|
||||
installs stay lightweight — don't add matplotlib to `gallery`'s own
|
||||
unconditional dependencies to support this package.
|
||||
`matplotlib>=3.7` is `plotstyle`'s own direct dependency — don't add it to
|
||||
`gallery`'s dependencies to support this package; `gallery` should stay
|
||||
installable without ever pulling in matplotlib.
|
||||
|
||||
**Hard requirement: a working local LaTeX toolchain (`latex` + `dvipng`).**
|
||||
`plotstyle.use()` sets `text.usetex = True` unconditionally — there is no
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# plotstyle
|
||||
|
||||
A KIT (Karlsruhe Institute of Technology) corporate-design matplotlib
|
||||
styling toolkit — a validated color palette, consistent spines/ticks/
|
||||
gridlines, LaTeX text in a modern sans font, and a few building-block
|
||||
functions (figure titles with a parameters subtitle, a same-size colorbar
|
||||
helper, an outside-axes legend, panel labels) for producing figures that
|
||||
look consistent across a thesis and a slide deck.
|
||||
|
||||
Requires a local LaTeX toolchain (`latex` + `dvipng`) — `plotstyle` always
|
||||
renders text through real LaTeX, there's no fallback.
|
||||
|
||||
```python
|
||||
import numpy as np
|
||||
import plotstyle as ps
|
||||
|
||||
ps.use() # once, before creating any figure
|
||||
|
||||
fig, ax = ps.new_figure(
|
||||
"thesis-single",
|
||||
title="Measured signal",
|
||||
params={"N": 512, "seed": 42},
|
||||
)
|
||||
x = np.linspace(0, 10, 200)
|
||||
ax.plot(x, np.sin(x), label="signal")
|
||||
ax.set_xlabel("Time (s)")
|
||||
ax.set_ylabel(r"Amplitude $A(t)$")
|
||||
ps.style_legend(ax, title="Series")
|
||||
|
||||
ps.savefig(fig, "plots/measured_signal", formats=("pdf",))
|
||||
```
|
||||
|
||||
This package is developed as part of the
|
||||
[ETPlot](https://git.larsbogner.de/lars/ETPlot) monorepo, where it is paired
|
||||
with `gallery`, a static HTML gallery generator that turns directories of
|
||||
plot PDFs into a browsable website — `plotstyle` has no code dependency on
|
||||
`gallery`, the two only meet on disk via the PDF (and optional
|
||||
`metadata.yaml`) files a `plotstyle` script writes out. See that repo's
|
||||
`examples/plotstyle_showcase.ipynb` for a fully rendered tour of every
|
||||
function, and `plotstyle/CLAUDE.md` for the full API reference.
|
||||
@@ -0,0 +1,37 @@
|
||||
[build-system]
|
||||
requires = ["uv_build>=0.11.19,<0.12.0"]
|
||||
build-backend = "uv_build"
|
||||
|
||||
[project]
|
||||
name = "plotstyle"
|
||||
version = "0.1.0"
|
||||
description = "KIT corporate-design matplotlib styling toolkit for consistent scientific figures"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.8"
|
||||
license = {text = "MIT"}
|
||||
authors = [
|
||||
{name = "K. Schmidt"},
|
||||
]
|
||||
keywords = [
|
||||
"matplotlib",
|
||||
"plotting",
|
||||
"scientific-computing",
|
||||
"styling",
|
||||
]
|
||||
classifiers = [
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Intended Audience :: Science/Research",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Topic :: Scientific/Engineering :: Visualization",
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
"matplotlib>=3.7",
|
||||
]
|
||||
Reference in New Issue
Block a user