Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

# Publishing a GitHub release tagged vX.Y.Z builds the package and uploads it to PyPI
# with Trusted Publishing (OIDC), so no API token is stored anywhere.

on:
release:
types: [published]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- run: pip install build twine pytest
- name: Tag matches the package version
run: |
version=$(python -c "import re; print(re.search(r'__version__ = \"(.+)\"', open('src/glyph_cli/__init__.py').read())[1])")
test "v$version" = "$GITHUB_REF_NAME" || { echo "tag $GITHUB_REF_NAME does not match version $version"; exit 1; }
- run: python -m build
- run: twine check --strict dist/*
- name: Test the built wheel
run: |
pip install dist/*.whl
glyph validate
pytest -q # src/ is not on the path, so this tests the installed wheel
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/

publish:
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/glyph-cli/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ build/
site/
.pytest_cache/
.ruff_cache/
.cache/
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The dictionary and toolkit for the **grid script**: how humans write down what R
**Docs:** https://interimm.github.io/glyph-cli/

```sh
uvx --from git+https://github.com/InterImm/glyph-cli glyph show BODY.OTHER STAR.TIME COUNT.137
uvx --from glyph-cli glyph show BODY.OTHER STAR.TIME COUNT.137
```

```text
Expand All @@ -20,7 +20,7 @@ uvx --from git+https://github.com/InterImm/glyph-cli glyph show BODY.OTHER STAR.
## Install

```sh
uv tool install git+https://github.com/InterImm/glyph-cli # or: pipx install git+https://github.com/InterImm/glyph-cli
uv tool install glyph-cli # or: pipx install glyph-cli, or: pip install glyph-cli
```

Python 3.10 or newer, no other dependencies.
Expand All @@ -40,7 +40,7 @@ glyph init my-vocab.json && export GLYPH_VOCAB=$PWD/my-vocab.json
glyph add BODY.STAR "a star-world" --domain Worlds
```

A page file has one band per line, `SYMBOL: node | relation | node`; a blank line starts the next statement. See [`examples/`](examples) and the [docs](https://interimm.github.io/glyph-cli/pages/).
A page file has one band per line, `SYMBOL: node | relation | node`; a blank line starts the next statement. See [`examples/`](https://github.com/InterImm/glyph-cli/tree/main/examples) and the [docs](https://interimm.github.io/glyph-cli/pages/).

## Develop

Expand All @@ -52,10 +52,17 @@ uv run python scripts/gen_docs.py # regenerate docs/vocabulary.md, docs/cli.m
uv run zensical serve # docs at http://localhost:8000
```

The vocabulary ships in [`src/glyph_cli/data/vocab.json`](src/glyph_cli/data/vocab.json). Change it with the tool (`glyph --vocab src/glyph_cli/data/vocab.json add ...`), then run `scripts/gen_docs.py`; the tests fail if the generated docs are stale.
The vocabulary ships in [`src/glyph_cli/data/vocab.json`](https://github.com/InterImm/glyph-cli/blob/main/src/glyph_cli/data/vocab.json). Change it with the tool (`glyph --vocab src/glyph_cli/data/vocab.json add ...`), then run `scripts/gen_docs.py`; the tests fail if the generated docs are stale.

Pushes to `main` publish the docs to GitHub Pages.

## Release

1. Bump `__version__` in `src/glyph_cli/__init__.py` and merge it to `main`.
2. Publish a GitHub release tagged `vX.Y.Z` (the same version).

The release workflow checks the tag matches the version, builds the package, tests the built wheel and uploads it to [PyPI](https://pypi.org/project/glyph-cli/) with Trusted Publishing, so no token is stored.

## License

MIT
8 changes: 5 additions & 3 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@
=== "uv"

```sh
uv tool install git+https://github.com/InterImm/glyph-cli
uv tool install glyph-cli
```

=== "pipx"

```sh
pipx install git+https://github.com/InterImm/glyph-cli
pipx install glyph-cli
```

=== "pip"

```sh
pip install git+https://github.com/InterImm/glyph-cli
pip install glyph-cli
```

The latest code on `main` installs with `uv tool install git+https://github.com/InterImm/glyph-cli`.

Check it works:

```sh
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ It draws words and pages on the lattice, keeps the vocabulary honest, reads a pa
No install needed if you have [uv](https://docs.astral.sh/uv/):

```sh
uvx --from git+https://github.com/InterImm/glyph-cli glyph show BODY.OTHER STAR.TIME COUNT.137
uvx --from glyph-cli glyph show BODY.OTHER STAR.TIME COUNT.137
```

```text
Expand Down
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,26 @@ license-files = ["LICENSE"]
authors = [{ name = "InterImm" }]
requires-python = ">=3.10"
dependencies = []
keywords = ["conlang", "writing system", "knowledge graph", "science fiction", "interimm"]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Other Audience",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Text Processing :: Linguistic",
]

[project.urls]
Homepage = "https://github.com/InterImm/glyph-cli"
Documentation = "https://interimm.github.io/glyph-cli/"
Source = "https://github.com/InterImm/glyph-cli"
Issues = "https://github.com/InterImm/glyph-cli/issues"

[project.scripts]
glyph = "glyph_cli.cli:main"
Expand All @@ -45,3 +56,6 @@ extend-exclude = ["docs"]

[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "B"]

[tool.hatch.build.targets.sdist]
include = ["src/", "tests/", "examples/", "scripts/", "docs/", "zensical.toml", "README.md", "LICENSE"]
Loading