@@ -28,60 +28,39 @@ jobs:
28
28
shell : bash -el {0}
29
29
steps :
30
30
- 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
33
33
with :
34
- activate-environment : test-env
35
34
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
52
41
53
42
Upload_to_pypi :
54
43
runs-on : ubuntu-latest
55
44
steps :
56
45
- 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
59
48
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"
69
52
70
53
- name : Publish to test pypi
71
54
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 }}
75
56
run : |
76
- hatch build
77
- hatch publish || exit 0
57
+ uv build
58
+ uv publish --publish-url https://test.pypi.org/legacy/ || exit 0
78
59
79
60
- name : Publish to pypi
80
61
if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
81
62
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 }}
85
64
run : |
86
- hatch build
87
- hatch publish
65
+ uv build
66
+ uv publish
0 commit comments