Skip to content

testing PR build on self host #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand Down
42 changes: 12 additions & 30 deletions .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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: |
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 2 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion src/radius_clustering/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
__all__ = ["RadiusClustering"]

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