Skip to content

Commit ae967e9

Browse files
authored
Merge pull request #8 from ciffelia/uv
Ryeからuvに移行
2 parents 4af717f + 4c6544e commit ae967e9

File tree

5 files changed

+37
-41
lines changed

5 files changed

+37
-41
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,20 @@ permissions:
1010
contents: read
1111

1212
env:
13-
RYE_VERSION: 0.31.0
13+
UV_VERSION: 0.5.31
1414

1515
jobs:
1616
run-demo:
1717
runs-on: ubuntu-24.04
1818
steps:
1919
- uses: actions/checkout@v4
2020

21-
- uses: ciffelia/setup-rye-action@v1
21+
- uses: astral-sh/setup-uv@v5
2222
with:
23-
rye-version: ${{ env.RYE_VERSION }}
23+
version: ${{ env.UV_VERSION }}
24+
enable-cache: false
2425

25-
- name: Setup virtualenv
26-
run: rye sync
27-
28-
- run: python demo.py
26+
- run: uv run demo.py
2927

3028
create-snapshot:
3129
name: create-snapshot (py${{ matrix.python_version }}, mpl${{ matrix.matplotlib_version }})
@@ -39,40 +37,37 @@ jobs:
3937
steps:
4038
- uses: actions/checkout@v4
4139

42-
- uses: ciffelia/setup-rye-action@v1
40+
- uses: astral-sh/setup-uv@v5
4341
with:
44-
rye-version: ${{ env.RYE_VERSION }}
42+
version: ${{ env.UV_VERSION }}
43+
enable-cache: false
4544

46-
- name: Generate snapshot path
47-
run: |
48-
echo "SNAPSHOT_DIR=test/snapshot" >> "$GITHUB_ENV"
49-
echo "SNAPSHOT_FILENAME=py${PYTHON_VERSION}_mpl${MATPLOTLIB_VERSION}.png" >> "$GITHUB_ENV"
45+
- name: Generate snapshot filename
46+
run: echo "SNAPSHOT_FILENAME=py${PYTHON_VERSION}_mpl${MATPLOTLIB_VERSION}.png" >> "$GITHUB_ENV"
5047
env:
5148
PYTHON_VERSION: ${{ matrix.python_version }}
5249
MATPLOTLIB_VERSION: ${{ matrix.matplotlib_version }}
5350

5451
- name: Create a snapshot
5552
run: |
56-
mkdir -p "$SNAPSHOT_DIR"
57-
rm -f "$SNAPSHOT_DIR/$SNAPSHOT_FILENAME"
58-
59-
rye pin "$PYTHON_VERSION" --no-update-requires-python
53+
mkdir -p snapshot
54+
rm -f "snapshot/$SNAPSHOT_FILENAME"
6055
61-
rm -f requirements.lock requirements-dev.lock
62-
rye add "matplotlib==$MATPLOTLIB_VERSION.*" 'numpy<2'
63-
rye sync
56+
uv python pin "$PYTHON_VERSION"
57+
uv add "matplotlib==$MATPLOTLIB_VERSION.*" 'numpy<2'
6458
65-
python test/create_snapshot.py "$SNAPSHOT_DIR/$SNAPSHOT_FILENAME"
59+
uv run create_snapshot.py "snapshot/$SNAPSHOT_FILENAME"
6660
env:
6761
PYTHON_VERSION: ${{ matrix.python_version }}
6862
MATPLOTLIB_VERSION: ${{ matrix.matplotlib_version }}
63+
working-directory: test
6964
continue-on-error: true
7065

7166
- name: Upload a snapshot
7267
uses: actions/upload-artifact@v4
7368
with:
7469
name: snapshot-${{ env.SNAPSHOT_FILENAME }}
75-
path: ${{ env.SNAPSHOT_DIR }}/${{ env.SNAPSHOT_FILENAME }}
70+
path: test/snapshot/${{ env.SNAPSHOT_FILENAME }}
7671
if-no-files-found: ignore
7772
compression-level: 0
7873

.github/workflows/publish.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,21 @@ permissions:
88
concurrency: ${{ github.workflow }}
99

1010
env:
11-
RYE_VERSION: 0.31.0
11+
UV_VERSION: 0.5.31
1212

1313
jobs:
1414
build:
1515
runs-on: ubuntu-24.04
1616
steps:
1717
- uses: actions/checkout@v4
1818

19-
- name: Setup Rye
20-
run: |
21-
TEMP_FILE=$(mktemp)
22-
curl -fsSL "https://github.com/mitsuhiko/rye/releases/download/$RYE_VERSION/rye-x86_64-linux.gz" | gunzip > "$TEMP_FILE"
23-
chmod +x "$TEMP_FILE"
24-
"$TEMP_FILE" self install --yes
25-
rm "$TEMP_FILE"
26-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
19+
- uses: astral-sh/setup-uv@v5
20+
with:
21+
version: ${{ env.UV_VERSION }}
22+
enable-cache: false
2723

2824
- name: Build
29-
run: rye build
25+
run: uv build --no-sources
3026

3127
- name: Upload dist
3228
uses: actions/upload-artifact@v4

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ wheels/
77

88
.venv
99

10-
requirements.lock
11-
requirements-dev.lock
10+
uv.lock

pyproject.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ Changelog = "https://github.com/ciffelia/matplotlib-fontja/blob/master/CHANGELOG
2727
requires = ["hatchling"]
2828
build-backend = "hatchling.build"
2929

30-
[tool.rye]
31-
managed = true
32-
dev-dependencies = []
33-
34-
[tool.hatch.metadata]
35-
allow-direct-references = true
36-
3730
[tool.hatch.build.targets.sdist]
3831
include = [
3932
"/src",

test/pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[project]
2+
name = "matplotlib-fontja-test"
3+
version = "0.1.0"
4+
dependencies = [
5+
"matplotlib-fontja"
6+
]
7+
classifiers = ["Private :: Do Not Upload"]
8+
9+
[tool.uv]
10+
package = false
11+
12+
[tool.uv.sources]
13+
matplotlib-fontja = { path = ".." }

0 commit comments

Comments
 (0)