Skip to content

Commit 3135818

Browse files
committed
Also publish pure python wheel
1 parent 9daea83 commit 3135818

File tree

7 files changed

+48
-50
lines changed

7 files changed

+48
-50
lines changed

.github/workflows/Publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ jobs:
4141
- name: Move files to dist
4242
run: |
4343
mkdir dist
44-
mv sdist/* dist/
44+
mv dists/* dist/
4545
if [[ ! -f dist/multi_mst-${{ steps.version.outputs.version }}.tar.gz ]] ; then exit 1; fi
4646
4747
- name: Create Github Release
4848
env:
4949
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5050
run: |
51-
gh release create -R vda-lab/multi_mst -t "Version ${{ steps.version.outputs.version }}" -n "**Full Changelog**: https://github.com/vda-lab/pyflasc/commits/${{ steps.version.outputs.tag }}" "${{ steps.version.outputs.tag }}" dist/*.tar.gz
51+
gh release create -R vda-lab/multi_mst -t "Version ${{ steps.version.outputs.version }}" -n "**Full Changelog**: https://github.com/vda-lab/pyflasc/commits/${{ steps.version.outputs.tag }}" "${{ steps.version.outputs.tag }}" dist/*.whl dist/*.tar.gz
5252
5353
- name: Publish package to (Test)PyPI
5454
uses: pypa/[email protected]

.github/workflows/Tests.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ on:
2727
workflow_dispatch:
2828

2929
jobs:
30-
build_sdist:
31-
name: Build sdist
30+
build_dists:
31+
name: Build dists
3232
runs-on: ubuntu-20.04
3333
outputs:
34-
SDIST_NAME: ${{ steps.sdist.outputs.SDIST_NAME }}
34+
WHEEL_NAME: ${{ steps.dists.outputs.WHEEL_NAME }}
3535
steps:
3636
- uses: actions/checkout@v4
3737
with:
@@ -47,32 +47,32 @@ jobs:
4747
run: |
4848
python -m pip install --upgrade pip
4949
pip install -r requirements.txt
50-
pip install twine flake8
50+
pip install twine flake8 build
5151
5252
- name: Lint with flake8
5353
run: |
5454
# stop the build if there are Python syntax errors or undefined names
5555
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
5656
57-
- name: Build sdist
58-
id: sdist
57+
- name: Build dists
58+
id: dists
5959
run: |
60-
python setup.py sdist
61-
python ci/export_sdist_name.py
60+
python -m build --sdist --wheel
61+
python ci/export_name.py
6262
6363
- name: Check README rendering for PyPI
6464
run: twine check dist/*
6565

6666
- name: Upload sdist result
6767
uses: actions/upload-artifact@v3
6868
with:
69-
name: sdist
70-
path: dist/*.tar.gz
69+
name: dists
70+
path: dist/*
7171
if-no-files-found: error
7272

7373
test_sdist:
74-
name: Test sdist for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}
75-
needs: build_sdist
74+
name: Test dist for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}
75+
needs: build_dists
7676
runs-on: ${{ matrix.os }}
7777
strategy:
7878
fail-fast: true
@@ -116,7 +116,7 @@ jobs:
116116
- name: Download sdist
117117
uses: actions/download-artifact@v3
118118
with:
119-
name: sdist
119+
name: dists
120120
path: dist/
121121

122122
- name: Setup Python
@@ -131,6 +131,6 @@ jobs:
131131
132132
- name: Run tests
133133
run: |
134-
pip install dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
134+
pip install dist/${{ needs.build_dists.outputs.WHEEL_NAME }}
135135
python -c "from multi_mst.tests import run_tests; run_tests()"
136136

ci/export_name.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python3
2+
3+
"""
4+
Determine the name of the wheel and export to GitHub output named WHEEL_NAME.
5+
6+
To run:
7+
$ python3 -m build --sdist
8+
$ ./ci/determine_name.py
9+
"""
10+
import os
11+
from pathlib import Path
12+
import sys
13+
14+
15+
paths = [p.name for p in Path("dist").glob("*.whl")]
16+
if len(paths) != 1:
17+
sys.exit(f"Only a single wheel is supported, but found: {paths}")
18+
19+
print(paths[0])
20+
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
21+
f.write(f"WHEEL_NAME={paths[0]}\n")

ci/export_sdist_name.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

requirements.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
numpy>=1.21
2-
numba>=0.56
3-
umap-learn>=0.5.4
4-
scikit-learn>=1.1
1+
numpy >= 1.23
2+
scipy >= 1.9
3+
scikit-learn >= 1.1
4+
umap-learn >= 0.5.4
5+
numba >= 0.57.1

setup.cfg

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = multi_mst
3-
version = 0.1.1
3+
version = 0.1.2
44
author = Jelmer Bot
55
author_email = [email protected]
66
maintainer = Jelmer Bot
@@ -28,7 +28,8 @@ packages =
2828
multi_mst.tests
2929
python_requires = >=3.9
3030
install_requires =
31-
numpy>=1.21
32-
numba>=0.56
33-
umap-learn>=0.5.4
34-
scikit-learn>=1.1
31+
numpy >= 1.23
32+
scipy >= 1.9
33+
scikit-learn >= 1.1
34+
umap-learn >= 0.5.4
35+
numba >= 0.57.1

setup.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)