Skip to content

Commit 0ceb53a

Browse files
committed
added pypi workflow and dynamic tagging
1 parent 724a554 commit 0ceb53a

File tree

5 files changed

+736
-400
lines changed

5 files changed

+736
-400
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write # required for PyPI Trusted Publishers
13+
contents: read
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # required so hatch-vcs can see tags
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.12"
21+
- name: Build sdist/wheel
22+
run: |
23+
python -m pip install -U pip
24+
python -m pip install -U build twine
25+
python -m build
26+
python -m twine check dist/*
27+
- name: Publish to PyPI
28+
uses: pypa/gh-action-pypi-publish@release/v1

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,11 @@ Currently clone and build. TODO: pypi
1414

1515
## Usage
1616

17-
TODO
17+
```python
18+
import mpl_drip
19+
plt.style.use("mpl_drip.custom")
20+
```
21+
22+
## Credit
23+
24+
The colour cycle is from [manim](https://docs.manim.community/en/stable/reference/manim.utils.color.manim_colors.html), and the `red_white_blue` colourmap is from [this repo](https://github.com/c-white/colormaps).

pyproject.toml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
[project]
22
name = "mpl_drip"
3-
version = "1.0.0"
3+
dynamic = ["version"]
44
description = "Make your mpl dripped up."
55
readme = "README.md"
6-
authors = [{ name = "Tom Hilder", email = "tom.hilder.dlhp@gmail.com" }]
7-
requires-python = ">=3.13"
8-
dependencies = ["matplotlib>=3.10.5"]
6+
authors = [{ name = "Tom Hilder", email = "thomas.hilder@monash.edu" }]
7+
requires-python = ">=3.9"
8+
dependencies = ["matplotlib>=3.8"]
9+
license = { file = "LICENSE" }
10+
classifiers = [
11+
"Programming Language :: Python :: 3",
12+
"Typing :: Typed",
13+
"Topic :: Scientific/Engineering :: Visualization",
14+
]
15+
916

1017
[build-system]
1118
requires = ["hatchling"]
1219
build-backend = "hatchling.build"
1320

14-
[dependency-groups]
15-
dev = [
16-
"ipykernel>=6.30.1",
17-
]
21+
[tool.hatch.build]
22+
include = ["src/mpl_drip/custom.mplstyle", "src/mpl_drip/py.typed"]
23+
exclude = ["**/__pycache__/**"]
24+
25+
[tool.hatch.version]
26+
source = "vcs"
27+
28+
[tool.hatch.build.targets.sdist]
29+
include = ["src/**", "README.md", "LICENSE", "examples/**"]
30+
31+
[tool.hatch.build.hooks.vcs]
32+
version-file = "src/mpl_drip/_version.py"

src/mpl_drip/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
from .colors import COLORS, get_color
22

33
__all__ = ["COLORS", "get_color"]
4+
5+
try:
6+
from ._version import __version__
7+
except Exception:
8+
__version__ = "0+unknown"

0 commit comments

Comments
 (0)