diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 20a30c0..87d6139 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -5,14 +5,43 @@ on: push: branches: - main + paths: + - "src/radius_clustering/**" + - "tests/**" + - "pyproject.toml" release: types: - 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: @@ -32,12 +61,16 @@ jobs: build_sdist: name: Build source distribution - runs-on: ubuntu-latest + runs-on: self-hosted + needs: run_pytest 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 +79,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 8adecff..f50757e 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -11,45 +11,27 @@ jobs: name: Run pytest uses: ./.github/workflows/tests.yml - build_test_wheels: - name: Test build on Ubuntu - runs-on: ubuntu-latest + build_test_sdist: + name: Test source distribution + 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 + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] 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" - - - 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: ubuntu-latest - 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 2ebeb97..811dfd1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,19 +7,22 @@ on: jobs: pytest: name: Run pytest - runs-on: ubuntu-latest + 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..175e565 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", @@ -56,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"