From 51c28cf4197d340c7e65cce9f23236002cb351ba Mon Sep 17 00:00:00 2001 From: Quentin Date: Tue, 11 Mar 2025 11:42:22 +0100 Subject: [PATCH 1/6] testing PR build on self host --- .github/workflows/pr_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index 8adecff..a28cf47 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -13,7 +13,7 @@ jobs: build_test_wheels: name: Test build on Ubuntu - runs-on: ubuntu-latest + runs-on: self-hosted strategy: fail-fast: false matrix: @@ -44,7 +44,7 @@ jobs: build_test_sdist: name: Test source distribution - runs-on: ubuntu-latest + runs-on: self-hosted steps: - uses: actions/checkout@v4 From 30d27fc8322b640e2ad65308265f406da1c31e3c Mon Sep 17 00:00:00 2001 From: Quentin Date: Tue, 11 Mar 2025 11:59:59 +0100 Subject: [PATCH 2/6] changes on runners --- .github/workflows/pr_build.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index a28cf47..8c05b32 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -12,7 +12,7 @@ jobs: uses: ./.github/workflows/tests.yml build_test_wheels: - name: Test build on Ubuntu + name: Test build on Self-Hosted Runner runs-on: self-hosted strategy: fail-fast: false diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ebeb97..0af7946 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ on: jobs: pytest: name: Run pytest - runs-on: ubuntu-latest + runs-on: self-hosted steps: - uses: actions/checkout@v4 From 6598dd850e37a989c80e65b08897e419564cb991 Mon Sep 17 00:00:00 2001 From: Quentin Date: Tue, 11 Mar 2025 15:03:00 +0100 Subject: [PATCH 3/6] modifying workflows for less builds --- .github/workflows/build_wheels.yml | 13 ++++++++++--- .github/workflows/pr_build.yml | 27 ++++++++++++++++++++++----- .github/workflows/tests.yml | 7 +++++-- pyproject.toml | 3 ++- 4 files changed, 39 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 20a30c0..4f24dc5 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -5,6 +5,10 @@ on: push: branches: - main + paths: + - "src/radius_clustering/**" + - "tests/**" + - "pyproject.toml" release: types: - published @@ -32,12 +36,15 @@ jobs: build_sdist: name: Build source distribution - runs-on: ubuntu-latest + runs-on: self-hosted steps: - uses: actions/checkout@v4 - name: Build sdist - run: pipx run build --sdist + run: | + pip install --upgrade pip + pip install --upgrade pipx + pipx run build --sdist - uses: actions/upload-artifact@v4 with: @@ -46,7 +53,7 @@ jobs: upload_pypi: needs: [build_wheels, build_sdist] - runs-on: ubuntu-latest + runs-on: self-hosted environment: name: pypi url: https://pypi.org/p/radius-clustering diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index 8c05b32..c5c5eee 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -14,10 +14,9 @@ jobs: build_test_wheels: name: Test build on Self-Hosted Runner runs-on: self-hosted + needs: run_pytest strategy: - fail-fast: false - matrix: - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + fail-fast: true steps: - uses: actions/checkout@v4 @@ -27,7 +26,18 @@ jobs: package-dir: . output-dir: ./wheelhouse config-file: "{package}/pyproject.toml" - + + test_built_wheels: + name: Test built wheels + needs: build_test_wheels + runs-on: self-hosted + strategy: + fail-fast: true + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + steps: + - uses: actions/checkout@v4 + - name: Setup Python uses: actions/setup-python@v5 with: @@ -45,11 +55,18 @@ jobs: build_test_sdist: name: Test source distribution runs-on: self-hosted + strategy: + fail-fast: true + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 - name: Build sdist - run: pipx run build --sdist + run: | + pip install --upgrade pip + pip install pipx + pipx run build --sdist - name: Test sdist run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0af7946..811dfd1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,18 +8,21 @@ jobs: pytest: name: Run pytest runs-on: self-hosted + strategy: + fail-fast: true + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install pytest python -m pip install -e ".[dev]" - name: Run tests with pytest diff --git a/pyproject.toml b/pyproject.toml index 6218a72..70e4e6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ license = {file = "LICENSE"} classifiers=[ "Intended Audience :: Science/Research", "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: C", "Programming Language :: C++", "Programming Language :: Python", @@ -33,6 +33,7 @@ classifiers=[ "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", + "Operating System :: MacOS", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", From d74f1558e5b08a46ee49ae799982f2bfc1f26e5d Mon Sep 17 00:00:00 2001 From: Quentin Date: Tue, 11 Mar 2025 15:18:02 +0100 Subject: [PATCH 4/6] fixing dependencies, and Pr workflows. also change minor version --- .github/workflows/pr_build.yml | 42 +++---------------------------- pyproject.toml | 9 ------- src/radius_clustering/__init__.py | 2 +- 3 files changed, 4 insertions(+), 49 deletions(-) diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index c5c5eee..ec67e09 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -11,25 +11,8 @@ jobs: name: Run pytest uses: ./.github/workflows/tests.yml - build_test_wheels: - name: Test build on Self-Hosted Runner - runs-on: self-hosted - needs: run_pytest - strategy: - fail-fast: true - steps: - - uses: actions/checkout@v4 - - - name: Build wheels - uses: pypa/cibuildwheel@v2.22.0 - with: - package-dir: . - output-dir: ./wheelhouse - config-file: "{package}/pyproject.toml" - - test_built_wheels: - name: Test built wheels - needs: build_test_wheels + build_test_sdist: + name: Test source distribution runs-on: self-hosted strategy: fail-fast: true @@ -38,30 +21,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Python + - name: Set up Python uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Test import - run: | - 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: - name: Test source distribution - runs-on: self-hosted - strategy: - fail-fast: true - matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] - steps: - - uses: actions/checkout@v4 - - name: Build sdist run: | pip install --upgrade pip diff --git a/pyproject.toml b/pyproject.toml index 70e4e6c..175e565 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,15 +57,6 @@ dev = [ "setuptools>= 61.0", "black>=24.3.0", "ruff>=0.4.8", - "sphinx>=8.1.3", - "sphinx_gallery>=0.18.0", - "sphinx-copybutton>=0.5.2", - "pydata-sphinx-theme>=0.15.3", - "sphinxcontrib-email>=0.3.6", - "sphinx-remove-toctrees>=1.0.0", - "sphinx-prompt>=1.9.0", - "sphinx_design>=0.6.1", - "sphinxcontrib.sass >= 0.3.4", ] doc = [ diff --git a/src/radius_clustering/__init__.py b/src/radius_clustering/__init__.py index 781aaed..3ebc26e 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.1" +__version__ = "1.2.2" From 0d772f9118abe274fb80620abab23b434bf4a8f7 Mon Sep 17 00:00:00 2001 From: Quentin Date: Tue, 11 Mar 2025 15:19:41 +0100 Subject: [PATCH 5/6] change the order of workflow execution --- .github/workflows/pr_build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index ec67e09..f50757e 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -14,6 +14,7 @@ jobs: build_test_sdist: name: Test source distribution runs-on: self-hosted + needs: run_pytest strategy: fail-fast: true matrix: From db4d8001cecab0e8a65e6a581495a2c70d0b35c2 Mon Sep 17 00:00:00 2001 From: Quentin Date: Tue, 11 Mar 2025 15:24:59 +0100 Subject: [PATCH 6/6] adding pytest run before building distribution and binaries on main branch --- .github/workflows/build_wheels.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 4f24dc5..87d6139 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -14,9 +14,34 @@ on: - published jobs: + run_pytest: + name: Run tests on min and max Python versions + runs-on: self-hosted + strategy: + fail-fast: true + matrix: + python-version: ["3.9", "3.13"] + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -e ".[dev]" + + - name: Run tests with pytest + run: | + pytest -v + build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} + needs: run_pytest strategy: fail-fast: false matrix: @@ -37,6 +62,7 @@ jobs: build_sdist: name: Build source distribution runs-on: self-hosted + needs: run_pytest steps: - uses: actions/checkout@v4