@@ -9,96 +9,130 @@ name: Python Build
9
9
pull_request :
10
10
11
11
jobs :
12
- from-sdist :
13
- name : python source distribution
12
+ from_uv :
13
+ name : python uv installation
14
14
runs-on : ubuntu-latest
15
15
steps :
16
- - uses : actions/checkout@v2
17
- - name : Set up Python 3.8
18
- uses : actions /setup-python@v2
16
+ - uses : actions/checkout@v4
17
+ - name : Install uv
18
+ uses : astral-sh /setup-uv@v5
19
19
with :
20
- python-version : 3.8
21
-
22
- - name : Install build packages and pytest
23
- run : |
24
- python -m pip install --upgrade pip wheel setuptools
25
- python -m pip install "conan<2" scikit-build pytest cython numpy>=2
26
-
27
- - name : Create sdist
28
- run : python setup.py sdist
20
+ version : " 0.6.5"
21
+ - name : " Set up Python"
22
+ uses : actions/setup-python@v5
23
+ with :
24
+ python-version-file : " pyproject.toml"
29
25
30
26
- name : Install pyssht
31
- run : " pip install dist/pyssht-*.tar.gz "
27
+ run : uv sync --all-extras --dev
32
28
33
29
- name : run pytest
34
- run : pytest tests/test_pyssht.py
30
+ run : uv run pytest
31
+
32
+ from_sdist :
33
+ name : python source distribution
34
+ runs-on : ubuntu-latest
35
+ steps :
36
+ - uses : actions/checkout@v4
37
+ - name : Install uv
38
+ uses : astral-sh/setup-uv@v5
39
+ with :
40
+ version : " 0.6.5"
35
41
36
- - uses : actions/upload-artifact@v2
37
- if : ${{ startsWith(github.ref, 'refs/tags') }}
42
+ - name : " Set up Python "
43
+ uses : actions/setup-python@v5
38
44
with :
39
- path : ./dist/*.tar.gz
40
- name : source-distribution
45
+ python-version-file : " pyproject.toml"
46
+
47
+ - name : Build sdist
48
+ run : uv build --sdist
49
+
50
+ - name : create venv
51
+ run : uv venv
52
+
53
+ - name : install wheel
54
+ run : " uv pip install dist/pyssht-*.tar.gz"
55
+
56
+ - name : run pytests
57
+ run : uv pip install pytest && uv run pytest
41
58
42
59
build_wheels :
43
- name : Build wheels on ${{ matrix.os }}
44
- runs-on : ${{ matrix.os }}
45
- strategy :
46
- matrix :
47
- os : [macos-latest]
48
- python-version : [3.8]
60
+ name : Build wheels
61
+ runs-on : macos-latest
49
62
50
63
steps :
51
- - uses : actions/checkout@v2
52
-
53
- - uses : actions/setup-python@v2
54
- name : Install Python
64
+ - uses : actions/checkout@v4
65
+ - name : Install uv
66
+ uses : astral-sh/setup-uv@v5
55
67
with :
56
- python-version : ${{ matrix.python-version }}
57
-
58
- - name : Setup environment
59
- run : |
60
- python -m pip install --upgrade pip wheel
61
- python -m pip install "conan<2" pytest ducc0
62
- conan profile new default --detect
68
+ version : " 0.6.5"
69
+ - name : " Set up Python"
70
+ uses : actions/setup-python@v5
71
+ with :
72
+ python-version-file : " pyproject.toml"
63
73
64
74
- name : Build wheels
65
- run : pip wheel . --use-pep517 --no-deps -w dist
75
+ run : uv build --wheel
76
+
77
+ - name : create venv
78
+ run : uv venv
66
79
67
80
- name : install wheel
68
- run : " pip install dist/*.whl"
81
+ run : " uv pip install dist/*.whl"
69
82
70
83
- name : run pytests
71
- run : pytest tests
84
+ run : uv pip install pytest && uv run pytest
72
85
73
- - uses : actions/upload-artifact@v2
74
- if : ${{ startsWith(github.ref, 'refs/tags') }}
86
+ publish_wheels :
87
+ name : Build wheels and publish on ${{ matrix.os }}
88
+ if : ${{ startsWith(github.ref, 'refs/tags') }}
89
+ runs-on : ${{ matrix.os }}
90
+ strategy :
91
+ matrix :
92
+ os : [ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-14]
93
+ permissions :
94
+ id-token : write
95
+ steps :
96
+ - uses : actions/checkout@v4
97
+ - name : Install uv
98
+ uses : astral-sh/setup-uv@v5
75
99
with :
76
- path : ./dist/*.whl
77
- name : wheel-${{matrix.os}}-${{matrix.python-version}}
100
+ version : " 0.6.5"
78
101
79
- publication :
80
- name : publish to pypi
102
+ - name : Build wheels
103
+
104
+ env :
105
+ CIBW_SKIP : " cp36-* cp37-* cp38-* pp* *musllinux*"
106
+ CIBW_BUILD_FRONTEND : " build[uv]"
107
+
108
+ - name : Publish distribution 📦 to Test PyPI
109
+ if : ${{ github.ref != 'refs/tags/v1.5.3' }}
110
+ run : " uv publish --publish-url https://test.pypi.org/legacy/ wheelhouse/*.whl"
111
+
112
+ - name : Publish distribution 📦 to PyPI
113
+ if : ${{ github.ref == 'refs/tags/v1.5.3' }}
114
+ run : " uv publish wheelhouse/*.whl"
115
+
116
+ publish_sdist :
117
+ name : Build sdist and publish on ubuntu
81
118
if : ${{ startsWith(github.ref, 'refs/tags') }}
82
119
runs-on : ubuntu-latest
83
- needs : [build_wheels, from-sdist]
120
+ permissions :
121
+ id-token : write
84
122
steps :
85
- - name : Download wheels and sdist
86
- uses : actions/download-artifact@v2
123
+ - uses : actions/checkout@v4
124
+ - name : Install uv
125
+ uses : astral-sh/setup-uv@v5
126
+ with :
127
+ version : " 0.6.5"
87
128
88
- - name : Move wheels and source distribution to dist/
89
- run : |
90
- mkdir -p dist
91
- mv source-distribution/*.tar.gz wheel-*/*.whl dist
129
+ - name : Build sdist
130
+ run : uv build --sdist
92
131
93
132
- name : Publish distribution 📦 to Test PyPI
94
- if : ${{ github.ref != 'refs/tags/v1.5.2' }}
95
- uses : pypa/gh-action-pypi-publish@master
96
- with :
97
- password : ${{ secrets.TEST_PYPI_TOKEN }}
98
- repository_url : https://test.pypi.org/legacy/
133
+ if : ${{ github.ref != 'refs/tags/v1.5.3' }}
134
+ run : " uv publish --publish-url https://test.pypi.org/legacy/ dist/*.tar.gz"
99
135
100
136
- name : Publish distribution 📦 to PyPI
101
- if : ${{ github.ref == 'refs/tags/v1.5.2' }}
102
- uses : pypa/gh-action-pypi-publish@master
103
- with :
104
- password : ${{ secrets.PYPI_TOKEN }}
137
+ if : ${{ github.ref == 'refs/tags/v1.5.3' }}
138
+ run : " uv publish dist/*.tar.gz"
0 commit comments