Skip to content

Commit 5f8768c

Browse files
authored
Use uv (#14)
1 parent ed73045 commit 5f8768c

File tree

6 files changed

+802
-42
lines changed

6 files changed

+802
-42
lines changed

.github/workflows/publish_release.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,11 @@ jobs:
1010
VERSION: ${{ github.ref_name }}
1111
steps:
1212
- uses: actions/checkout@v4
13+
- uses: astral-sh/setup-uv@v3
14+
with:
15+
enable-cache: true
16+
cache-dependency-glob: "uv.lock"
1317
- uses: actions/setup-python@v5
1418
with:
15-
python-version: "3.12"
16-
cache: "pip"
17-
- run: pip install -e '.[dev]'
18-
- run: python -m build
19-
- run:
20-
twine upload
21-
-u __token__
22-
-p ${{ secrets.PYPI_API_TOKEN }}
23-
dist/*
19+
python-version-file: "pyproject.toml"
20+
- run: uv publish

.github/workflows/tests.yaml

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,55 @@ jobs:
1111
ruff:
1212
runs-on: ubuntu-22.04
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-python@v4
14+
- uses: actions/checkout@v4
15+
- uses: astral-sh/setup-uv@v3
1616
with:
17-
python-version: "3.11"
18-
cache: "pip"
19-
- run: "pip install -e '.[dev]'"
20-
- run: ruff check src/ tests/
17+
enable-cache: true
18+
cache-dependency-glob: "uv.lock"
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version-file: "pyproject.toml"
22+
- run: uv sync --all-extras --dev
23+
- run: uv run ruff check src/ tests/
2124

2225
mypy:
2326
runs-on: ubuntu-22.04
2427
steps:
25-
- uses: actions/checkout@v3
26-
- uses: actions/setup-python@v4
28+
- uses: actions/checkout@v4
29+
- uses: astral-sh/setup-uv@v3
30+
with:
31+
enable-cache: true
32+
cache-dependency-glob: "uv.lock"
33+
- uses: actions/setup-python@v5
2734
with:
28-
python-version: "3.11"
29-
cache: "pip"
30-
- run: "pip install -e '.[dev]'"
31-
- run: mypy src/ tests/
35+
python-version-file: "pyproject.toml"
36+
- run: uv sync --all-extras --dev
37+
- run: uv run mypy src/ tests/
3238

3339
ruff-format:
3440
runs-on: ubuntu-22.04
3541
steps:
36-
- uses: actions/checkout@v3
37-
- uses: actions/setup-python@v4
42+
- uses: actions/checkout@v4
43+
- uses: astral-sh/setup-uv@v3
3844
with:
39-
python-version: "3.11"
40-
cache: "pip"
41-
- run: "pip install -e '.[dev]'"
42-
- run: ruff format --check src/ tests/
45+
enable-cache: true
46+
cache-dependency-glob: "uv.lock"
47+
- uses: actions/setup-python@v5
48+
with:
49+
python-version-file: "pyproject.toml"
50+
- run: uv sync --all-extras --dev
51+
- run: uv run ruff format --check src/ tests/
4352

4453
examples:
4554
runs-on: ubuntu-22.04
4655
steps:
47-
- uses: actions/checkout@v3
48-
- uses: actions/setup-python@v4
56+
- uses: actions/checkout@v4
57+
- uses: astral-sh/setup-uv@v3
58+
with:
59+
enable-cache: true
60+
cache-dependency-glob: "uv.lock"
61+
- uses: actions/setup-python@v5
4962
with:
50-
python-version: "3.11"
51-
cache: "pip"
52-
- run: "pip install -e '.[dev]'"
53-
- run: make -C tests html
63+
python-version-file: "pyproject.toml"
64+
- run: uv sync --all-extras --dev
65+
- run: uv run make -C tests html

justfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ default:
44

55
# Do a dev install.
66
dev:
7-
pip install -e '.[dev]'
7+
uv sync --all-extras --dev
88

99
# Run code checks.
1010
check:
@@ -14,19 +14,19 @@ check:
1414
trap error=1 ERR
1515

1616
echo
17-
(set -x; ruff check src/ tests/ )
17+
(set -x; uv run ruff check src/ tests/ )
1818
test $? = 0
1919

2020
echo
21-
( set -x; ruff format --check src/ tests/ )
21+
( set -x; uv run ruff format --check src/ tests/ )
2222
test $? = 0
2323

2424
echo
25-
( set -x; mypy src/ tests/ )
25+
( set -x; uv run mypy src/ tests/ )
2626
test $? = 0
2727

2828
echo
29-
( set -x; make -C tests html )
29+
( set -x; uv run make -C tests html )
3030
test $? = 0
3131

3232
test $error = 0

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ maintainers = [
1010
dependencies = [
1111
"sphinx",
1212
]
13-
requires-python = ">=3.10"
13+
requires-python = ">=3.12"
1414
dynamic = ["version"]
1515
readme = "README.rst"
1616
description = "Make better chemistry documentation!"
1717

18-
[project.optional-dependencies]
18+
[dependency-groups]
1919
dev = [
2020
"ruff",
2121
"mypy",

src/moldoc/_internal/molecule.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from collections.abc import Iterable
2-
from typing import TypeAlias
32

43

54
class Color:
@@ -162,7 +161,7 @@ def get_flat_shading(self) -> bool | None:
162161
return self._flat_shading
163162

164163

165-
Material: TypeAlias = (
164+
type Material = (
166165
MeshLambertMaterial
167166
| MeshNormalMaterial
168167
| MeshPhongMaterial

0 commit comments

Comments
 (0)