Skip to content

Commit 675082c

Browse files
committed
chore: bump version to v1.0.0-beta.2
1 parent b451be1 commit 675082c

File tree

8 files changed

+147
-39
lines changed

8 files changed

+147
-39
lines changed

.github/workflows/docs.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: Build documentation
22

33
on:
4-
workflow_dispatch:
5-
push:
6-
branches: [ main, master ]
4+
workflow_dispatch:
5+
push:
6+
branches: [ main, master ]
77
env:
88
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
99

1010
jobs:
1111
docs:
12-
name: Linux
12+
name: Build documentation
1313
runs-on: ubuntu-latest
1414

1515
env:
@@ -51,4 +51,5 @@ jobs:
5151
- name: 'Build docs'
5252
run: |
5353
git fetch origin gh-pages
54-
mike deploy --push --alias-type=copy --update-aliases $BRANCH_NAME latest
54+
mike delete $BRANCH_NAME
55+
mike deploy --push $BRANCH_NAME

.github/workflows/release.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published]
7+
8+
permissions:
9+
id-token: write
10+
11+
jobs:
12+
publish:
13+
name: Build and Publish Package
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: 'Checkout'
17+
uses: actions/checkout@v4
18+
with:
19+
submodules: 'recursive'
20+
21+
- name: 'Set up Node'
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: "20.x"
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.10"
30+
31+
- name: 'Install hatch'
32+
run: pip install hatch
33+
34+
- name: "Build source distribution"
35+
run: |
36+
hatch build -t sdist
37+
38+
- name: "Build wheel distribution"
39+
run: |
40+
hatch build -t wheel
41+
42+
- name: Publish package
43+
uses: pypa/gh-action-pypi-publish@release/v1
44+
45+
docs:
46+
name: Documentation
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v4
51+
with:
52+
submodules: 'recursive'
53+
54+
- name: 'Set up Node'
55+
uses: actions/setup-node@v4
56+
with:
57+
node-version: "20.x"
58+
59+
- name: 'Install uv'
60+
uses: astral-sh/setup-uv@v6
61+
with:
62+
python-version: "3.10"
63+
enable-cache: true
64+
activate-environment: true
65+
cache-dependency-glob: |
66+
pyproject.toml
67+
uv.lock
68+
69+
- name: 'Set up Git'
70+
run: |
71+
git config user.name ${{ github.actor }}
72+
git config user.email ${{ github.actor }}@users.noreply.github.com
73+
echo Current branch: $BRANCH_NAME
74+
75+
- name: 'Install'
76+
run: |
77+
yarn install
78+
# install setuptools < 81 to fix issue with pkg_resources
79+
uv pip install -e . --group docs "setuptools<81"
80+
81+
- name: Build documentation
82+
run: |
83+
git fetch origin gh-pages
84+
mike deploy --push --no-redirect --update-aliases $GITHUB_REF_NAME latest

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## Unreleased
3+
## v1.0.0.beta2
44

55
- Improved visibility of highlighted spans and layout of boxes with mixed inset/outset nesting
66
- Improved autocompletion experience for table suggestion inputs

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
![Tests](https://img.shields.io/github/actions/workflow/status/percevalw/metanno/tests.yml?branch=main&label=tests&style=flat-square)
2-
[![Documentation](https://img.shields.io/github/actions/workflow/status/percevalw/metanno/docs.yml?branch=main&label=docs&style=flat-square)](https://percevalw.github.io/metanno/latest/)
3-
[![PyPI](https://img.shields.io/pypi/v/metanno?color=blue&style=flat-square)](https://pypi.org/project/metanno/)
4-
51
<h1 align="center">
62
<img alt="Metanno" width="250" src="https://raw.githubusercontent.com/percevalw/metanno/main/docs/assets/images/logo.png" />
73
</h1>
84

5+
![Tests](https://img.shields.io/github/actions/workflow/status/percevalw/metanno/tests.yml?branch=main&label=tests&style=flat-square)
6+
[![Documentation](https://img.shields.io/github/actions/workflow/status/percevalw/metanno/docs.yml?branch=main&label=docs&style=flat-square)](https://percevalw.github.io/metanno/latest/)
7+
[![PyPI](https://img.shields.io/pypi/v/metanno?color=blue&style=flat-square)](https://pypi.org/project/metanno/)
98
[![DOI](https://zenodo.org/badge/244972164.svg)](https://zenodo.org/doi/10.5281/zenodo.10689826)
109

1110
--------------------------------------------------------------------------------
@@ -44,7 +43,7 @@ Develop and test in a notebook. If you prefer, you can also run it as a standalo
4443
### Easy setup
4544

4645
```bash { data-md-color-scheme="slate" }
47-
pip install metanno
46+
pip install metanno==1.0.0-beta.2
4847
```
4948

5049
To use it with Jupyter, if you install the library in a custom environment (conda, venv, or other),

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Develop and test in a notebook. If you prefer, you can also run it as a standalo
3636
### Easy setup
3737

3838
```bash { data-md-color-scheme="slate" }
39-
pip install metanno
39+
pip install metanno==1.0.0-beta.2
4040
```
4141

4242
To use it with Jupyter, if you install the library in a custom environment (conda, venv, or other),

docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
A simple pip installation should be enough to install Metanno *both* as a standalone web app framework and as a JupyterLab extension:
66

77
```bash { data-md-color-scheme="slate" }
8-
pip install metanno
8+
pip install metanno==1.0.0-beta.2
99
```
1010

1111
To use it with Jupyter, if you install the library in a custom environment (conda, venv, or other),

metanno/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.0.0-beta.1"
1+
__version__ = "1.0.0-beta.2"

pret/ui/metanno/__init__.py

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from typing import Any, Union, List, TypedDict, Optional, Dict, Callable
44
from pret.render import stub_component
55
from pret.marshal import js, make_stub_js_module, marshal_as
6+
from metanno import __version__
67

7-
__version__ = "1.0.0-beta.1"
88
_py_package_name = "metanno"
99
_js_package_name = "metanno"
1010
_js_global_name = "Metanno"
@@ -54,6 +54,7 @@ def AnnotatedImage(*children, annotations: Any, annotation_styles: Any, image: s
5454
Examples
5555
--------
5656
57+
<!-- blacken-docs:off -->
5758
```python { .render-with-pret style="height: 300px" }
5859
from pret import component, create_store, use_store_snapshot, use_event_callback
5960
from pret.ui.metanno import AnnotatedImage
@@ -122,6 +123,7 @@ def on_click(shape_idx, modkeys):
122123
123124
MyImage()
124125
```
126+
<!-- blacken-docs:on -->
125127
126128
Parameters
127129
----------
@@ -230,7 +232,7 @@ def Table(
230232
231233
Examples
232234
--------
233-
235+
<!-- blacken-docs:off -->
234236
```python { .render-with-pret style="min-height: 300px" }
235237
from pret import component, create_store, use_store_snapshot, use_event_callback
236238
from pret.ui.metanno import Table
@@ -277,6 +279,7 @@ def on_cell_change(row_idx, col, new_value):
277279
278280
MyTable()
279281
```
282+
<!-- blacken-docs:on -->
280283
281284
Parameters
282285
----------
@@ -392,7 +395,13 @@ def AnnotatedText(
392395
--------
393396
394397
```python { .render-with-pret }
395-
from pret import component, create_store, use_store_snapshot, use_event_callback, use_state
398+
from pret import (
399+
component,
400+
create_store,
401+
use_store_snapshot,
402+
use_event_callback,
403+
use_state,
404+
)
396405
from pret.ui.metanno import AnnotatedText
397406
from pret.ui.joy import Button, Box
398407
@@ -402,20 +411,27 @@ def AnnotatedText(
402411
)
403412
404413
# One span covering the word “Metanno”
405-
spans = create_store([{
406-
"id": f"span-0-7",
407-
"begin": 0,
408-
"end": 7,
409-
"label": "OBJ",
410-
"highlighted": False,
411-
}])
412-
413-
txt_annotation_styles = create_store({
414-
"OBJ": {
415-
"color": "red",
416-
"shape": "underline",
414+
spans = create_store(
415+
[
416+
{
417+
"id": f"span-0-7",
418+
"begin": 0,
419+
"end": 7,
420+
"label": "OBJ",
421+
"highlighted": False,
422+
}
423+
]
424+
)
425+
426+
txt_annotation_styles = create_store(
427+
{
428+
"OBJ": {
429+
"color": "red",
430+
"shape": "underline",
431+
}
417432
}
418-
})
433+
)
434+
419435
420436
@component
421437
def MyText():
@@ -425,14 +441,16 @@ def MyText():
425441
@use_event_callback
426442
def handle_select(ranges, modkeys):
427443
for sp in ranges:
428-
spans.extend([
429-
{
430-
"id": f"span-{sp['begin']}-{sp['end']}",
431-
"begin": sp["begin"],
432-
"end": sp["end"],
433-
"label": "OBJ",
434-
}
435-
])
444+
spans.extend(
445+
[
446+
{
447+
"id": f"span-{sp['begin']}-{sp['end']}",
448+
"begin": sp["begin"],
449+
"end": sp["end"],
450+
"label": "OBJ",
451+
}
452+
]
453+
)
436454
437455
def on_mouse_enter_span(span_id, modkeys):
438456
for i, sp in enumerate(spans):
@@ -461,9 +479,15 @@ def on_span_style_change():
461479
on_mouse_leave_span=on_mouse_leave_span,
462480
style={"gridColumn": "1 / -1"},
463481
),
464-
sx={"p": 1, "display": "grid", "gridTemplateColumns": "repeat(2, auto)", "gap": 1},
482+
sx={
483+
"p": 1,
484+
"display": "grid",
485+
"gridTemplateColumns": "repeat(2, auto)",
486+
"gap": 1,
487+
},
465488
)
466489
490+
467491
MyText()
468492
```
469493

0 commit comments

Comments
 (0)