Skip to content

Commit 1514020

Browse files
authored
Merge pull request #13 from lias-laboratory/patch-workflow
update version and improve workflows by adding the following : - First try to run Pytest on editable install - Then build dist distribution (tar.gz), install, import and run tests - Then build on all supported python version, install and import Get rid of pushing to PyPI for each PR.
2 parents fd912d3 + c0e9aa3 commit 1514020

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

.github/workflows/pr_build.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ jobs:
1010
run_pytest:
1111
name: Run pytest
1212
uses: ./.github/workflows/tests.yml
13-
13+
1414
build_test_wheels:
1515
name: Test build on Ubuntu
1616
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
1721
steps:
1822
- uses: actions/checkout@v4
1923

@@ -23,10 +27,19 @@ jobs:
2327
package-dir: .
2428
output-dir: ./wheelhouse
2529
config-file: "{package}/pyproject.toml"
30+
31+
- name: Setup Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: ${{ matrix.python-version }}
2635

2736
- name: Test import
2837
run: |
29-
pip install ./wheelhouse/*.whl
38+
PY_VERSION=$(echo ${{ matrix.python-version }} | sed 's/\.//g')
39+
40+
ls -la ./wheelhouse/
41+
42+
pip install ./wheelhouse/*cp${PY_VERSION}*.whl
3043
python -c "import radius_clustering; print(f'Successfully imported version {radius_clustering.__version__}')"
3144
3245
build_test_sdist:

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
run: |
2121
python -m pip install --upgrade pip
2222
python -m pip install pytest
23-
python -m pip install -e .
23+
python -m pip install -e ".[dev]"
2424
2525
- name: Run tests with pytest
2626
run: |

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ documentation = "https://lias-laboratory.github.io/radius_clustering/"
5151
[project.optional-dependencies]
5252
dev = [
5353
"pytest>=8.3.3",
54+
"pandas",
5455
"cython>=3.0",
5556
"setuptools>= 61.0",
5657
"black>=24.3.0",
@@ -80,7 +81,7 @@ doc = [
8081

8182
[tool.setuptools]
8283
packages.find = {where = ["src"], include = ["radius_clustering", "radius_clustering.*"]}
83-
version = {attr = "radius_clustering.__version__"}
84+
dynamic.version = {attr = "radius_clustering.__version__"}
8485

8586
[tool.pytest.ini_options]
8687
pythonpath = "src"

src/radius_clustering/__init__.py

Lines changed: 1 addition & 1 deletion
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.0"
7+
__version__ = "1.2.1"

src/radius_clustering/utils/mds.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cdef extern from "mds_core.cpp":
3939

4040
cdef Result iterated_greedy_wrapper(int numNodes, const vector[int]& edges_list, int nb_edges, string name) nogil
4141

42-
def solve_mds(int num_nodes, np.ndarray[np.uint32_t, ndim=1, mode="c"] edges not None, int nb_edges, str name):
42+
def solve_mds(int num_nodes, np.ndarray[int, ndim=1, mode="c"] edges not None, int nb_edges, str name):
4343
"""
4444
Solve the Minimum Dominating Set problem for a given graph.
4545

0 commit comments

Comments
 (0)