Skip to content

Commit abd7134

Browse files
committed
adopt workflow to uv
1 parent 295d921 commit abd7134

File tree

1 file changed

+19
-40
lines changed

1 file changed

+19
-40
lines changed

.github/workflows/build.yaml

+19-40
Original file line numberDiff line numberDiff line change
@@ -28,60 +28,39 @@ jobs:
2828
shell: bash -el {0}
2929
steps:
3030
- uses: actions/checkout@v4
31-
- name: Setup Miniconda
32-
uses: conda-incubator/setup-miniconda@v3.0.4
31+
- name: Setup uv
32+
uses: astral-sh/setup-uv@v5
3333
with:
34-
activate-environment: test-env
3534
python-version: ${{ matrix.python-version }}
36-
- name: Test project installation
37-
run: |
38-
python -m pip install --upgrade pip
39-
pip install .[all,dev]
40-
pip install torch torchstain
41-
- name: Install OpenSlide
42-
if: matrix.os != 'windows-latest'
43-
run: |
44-
conda install -c conda-forge openslide-python
45-
- name: Install scyjava
46-
run: |
47-
conda install -c conda-forge scyjava
48-
- name: Test with pytest
49-
run: |
50-
pip install pytest
51-
pytest tests/
35+
enable-cache: true
36+
cache-dependency-glob: "uv.lock"
37+
- name: Install project
38+
run: uv sync --all-extras --dev
39+
- name: Tests
40+
run: uv run task test
5241

5342
Upload_to_pypi:
5443
runs-on: ubuntu-latest
5544
steps:
5645
- uses: actions/checkout@v4
57-
- name: Set up Python
58-
uses: actions/setup-python@v4
46+
- name: Setup uv
47+
uses: astral-sh/setup-uv@v5
5948
with:
60-
python-version: '3.12'
61-
62-
- name: Install dependencies
63-
run: |
64-
python -m pip install --upgrade pip
65-
pip install .
66-
67-
- name: Install Hatch
68-
uses: pypa/hatch@install
49+
python-version: 3.12
50+
enable-cache: true
51+
cache-dependency-glob: "uv.lock"
6952

7053
- name: Publish to test pypi
7154
env:
72-
HATCH_INDEX_REPO: https://test.pypi.org/legacy/
73-
HATCH_INDEX_USER: __token__
74-
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TEST_TOKEN }}
55+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TEST_TOKEN }}
7556
run: |
76-
hatch build
77-
hatch publish || exit 0
57+
uv build
58+
uv publish --publish-url https://test.pypi.org/legacy/ || exit 0
7859
7960
- name: Publish to pypi
8061
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
8162
env:
82-
HATCH_INDEX_REPO: https://upload.pypi.org/legacy/
83-
HATCH_INDEX_USER: __token__
84-
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
63+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
8564
run: |
86-
hatch build
87-
hatch publish
65+
uv build
66+
uv publish

0 commit comments

Comments
 (0)