Skip to content

Commit b108950

Browse files
authored
testing PR build on self host (#14) + license and minor upgrade
* testing PR build on self host * changes on runners * modifying workflows for less builds * fixing dependencies, and Pr workflows. also change minor version * change the order of workflow execution * adding pytest run before building distribution and binaries on main branch
1 parent 1514020 commit b108950

File tree

5 files changed

+57
-47
lines changed

5 files changed

+57
-47
lines changed

.github/workflows/build_wheels.yml

+36-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,43 @@ on:
55
push:
66
branches:
77
- main
8+
paths:
9+
- "src/radius_clustering/**"
10+
- "tests/**"
11+
- "pyproject.toml"
812
release:
913
types:
1014
- published
1115

1216
jobs:
17+
run_pytest:
18+
name: Run tests on min and max Python versions
19+
runs-on: self-hosted
20+
strategy:
21+
fail-fast: true
22+
matrix:
23+
python-version: ["3.9", "3.13"]
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
python -m pip install -e ".[dev]"
36+
37+
- name: Run tests with pytest
38+
run: |
39+
pytest -v
40+
1341
build_wheels:
1442
name: Build wheels on ${{ matrix.os }}
1543
runs-on: ${{ matrix.os }}
44+
needs: run_pytest
1645
strategy:
1746
fail-fast: false
1847
matrix:
@@ -32,12 +61,16 @@ jobs:
3261

3362
build_sdist:
3463
name: Build source distribution
35-
runs-on: ubuntu-latest
64+
runs-on: self-hosted
65+
needs: run_pytest
3666
steps:
3767
- uses: actions/checkout@v4
3868

3969
- name: Build sdist
40-
run: pipx run build --sdist
70+
run: |
71+
pip install --upgrade pip
72+
pip install --upgrade pipx
73+
pipx run build --sdist
4174
4275
- uses: actions/upload-artifact@v4
4376
with:
@@ -46,7 +79,7 @@ jobs:
4679

4780
upload_pypi:
4881
needs: [build_wheels, build_sdist]
49-
runs-on: ubuntu-latest
82+
runs-on: self-hosted
5083
environment:
5184
name: pypi
5285
url: https://pypi.org/p/radius-clustering

.github/workflows/pr_build.yml

+12-30
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,27 @@ jobs:
1111
name: Run pytest
1212
uses: ./.github/workflows/tests.yml
1313

14-
build_test_wheels:
15-
name: Test build on Ubuntu
16-
runs-on: ubuntu-latest
14+
build_test_sdist:
15+
name: Test source distribution
16+
runs-on: self-hosted
17+
needs: run_pytest
1718
strategy:
18-
fail-fast: false
19-
matrix:
20-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
19+
fail-fast: true
20+
matrix:
21+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2122
steps:
2223
- uses: actions/checkout@v4
2324

24-
- name: Build wheels
25-
uses: pypa/cibuildwheel@v2.22.0
26-
with:
27-
package-dir: .
28-
output-dir: ./wheelhouse
29-
config-file: "{package}/pyproject.toml"
30-
31-
- name: Setup Python
25+
- name: Set up Python
3226
uses: actions/setup-python@v5
3327
with:
3428
python-version: ${{ matrix.python-version }}
3529

36-
- name: Test import
37-
run: |
38-
PY_VERSION=$(echo ${{ matrix.python-version }} | sed 's/\.//g')
39-
40-
ls -la ./wheelhouse/
41-
42-
pip install ./wheelhouse/*cp${PY_VERSION}*.whl
43-
python -c "import radius_clustering; print(f'Successfully imported version {radius_clustering.__version__}')"
44-
45-
build_test_sdist:
46-
name: Test source distribution
47-
runs-on: ubuntu-latest
48-
steps:
49-
- uses: actions/checkout@v4
50-
5130
- name: Build sdist
52-
run: pipx run build --sdist
31+
run: |
32+
pip install --upgrade pip
33+
pip install pipx
34+
pipx run build --sdist
5335
5436
- name: Test sdist
5537
run: |

.github/workflows/tests.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,22 @@ on:
77
jobs:
88
pytest:
99
name: Run pytest
10-
runs-on: ubuntu-latest
10+
runs-on: self-hosted
11+
strategy:
12+
fail-fast: true
13+
matrix:
14+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1115
steps:
1216
- uses: actions/checkout@v4
1317

1418
- name: Set up Python
1519
uses: actions/setup-python@v5
1620
with:
17-
python-version: '3.10'
21+
python-version: ${{ matrix.python-version }}
1822

1923
- name: Install dependencies
2024
run: |
2125
python -m pip install --upgrade pip
22-
python -m pip install pytest
2326
python -m pip install -e ".[dev]"
2427
2528
- name: Run tests with pytest

pyproject.toml

+2-10
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ license = {file = "LICENSE"}
2424
classifiers=[
2525
"Intended Audience :: Science/Research",
2626
"Intended Audience :: Developers",
27-
"License :: OSI Approved :: MIT License",
27+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
2828
"Programming Language :: C",
2929
"Programming Language :: C++",
3030
"Programming Language :: Python",
@@ -33,6 +33,7 @@ classifiers=[
3333
"Operating System :: Microsoft :: Windows",
3434
"Operating System :: POSIX",
3535
"Operating System :: Unix",
36+
"Operating System :: MacOS",
3637
"Programming Language :: Python :: 3",
3738
"Programming Language :: Python :: 3.9",
3839
"Programming Language :: Python :: 3.10",
@@ -56,15 +57,6 @@ dev = [
5657
"setuptools>= 61.0",
5758
"black>=24.3.0",
5859
"ruff>=0.4.8",
59-
"sphinx>=8.1.3",
60-
"sphinx_gallery>=0.18.0",
61-
"sphinx-copybutton>=0.5.2",
62-
"pydata-sphinx-theme>=0.15.3",
63-
"sphinxcontrib-email>=0.3.6",
64-
"sphinx-remove-toctrees>=1.0.0",
65-
"sphinx-prompt>=1.9.0",
66-
"sphinx_design>=0.6.1",
67-
"sphinxcontrib.sass >= 0.3.4",
6860
]
6961

7062
doc = [

src/radius_clustering/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
__all__ = ["RadiusClustering"]
55

66
# Optionally, you can set a version number for your package
7-
__version__ = "1.2.1"
7+
__version__ = "1.2.2"

0 commit comments

Comments
 (0)