diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index c6ad8a3..8adecff 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -10,10 +10,14 @@ jobs: run_pytest: name: Run pytest uses: ./.github/workflows/tests.yml - + build_test_wheels: name: Test build on Ubuntu runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 @@ -23,10 +27,19 @@ jobs: package-dir: . output-dir: ./wheelhouse config-file: "{package}/pyproject.toml" + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} - name: Test import run: | - pip install ./wheelhouse/*.whl + PY_VERSION=$(echo ${{ matrix.python-version }} | sed 's/\.//g') + + ls -la ./wheelhouse/ + + pip install ./wheelhouse/*cp${PY_VERSION}*.whl python -c "import radius_clustering; print(f'Successfully imported version {radius_clustering.__version__}')" build_test_sdist: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d18d816..2ebeb97 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install pytest - python -m pip install -e . + python -m pip install -e ".[dev]" - name: Run tests with pytest run: | diff --git a/pyproject.toml b/pyproject.toml index 098901c..6218a72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,6 +51,7 @@ documentation = "https://lias-laboratory.github.io/radius_clustering/" [project.optional-dependencies] dev = [ "pytest>=8.3.3", + "pandas", "cython>=3.0", "setuptools>= 61.0", "black>=24.3.0", @@ -80,7 +81,7 @@ doc = [ [tool.setuptools] packages.find = {where = ["src"], include = ["radius_clustering", "radius_clustering.*"]} -version = {attr = "radius_clustering.__version__"} +dynamic.version = {attr = "radius_clustering.__version__"} [tool.pytest.ini_options] pythonpath = "src" diff --git a/src/radius_clustering/__init__.py b/src/radius_clustering/__init__.py index 5a8d7af..781aaed 100644 --- a/src/radius_clustering/__init__.py +++ b/src/radius_clustering/__init__.py @@ -4,4 +4,4 @@ __all__ = ["RadiusClustering"] # Optionally, you can set a version number for your package -__version__ = "1.2.0" +__version__ = "1.2.1" diff --git a/src/radius_clustering/utils/mds.pyx b/src/radius_clustering/utils/mds.pyx index 1112db2..488ae90 100644 --- a/src/radius_clustering/utils/mds.pyx +++ b/src/radius_clustering/utils/mds.pyx @@ -39,7 +39,7 @@ cdef extern from "mds_core.cpp": cdef Result iterated_greedy_wrapper(int numNodes, const vector[int]& edges_list, int nb_edges, string name) nogil -def solve_mds(int num_nodes, np.ndarray[np.uint32_t, ndim=1, mode="c"] edges not None, int nb_edges, str name): +def solve_mds(int num_nodes, np.ndarray[int, ndim=1, mode="c"] edges not None, int nb_edges, str name): """ Solve the Minimum Dominating Set problem for a given graph.