Skip to content

Commit 5462ca2

Browse files
authored
Merge pull request #38 from scikit-learn-contrib/project-pipelines-and-naming
upgrade workflows and add pre-commit configuration. Close some tasks of big issue 29.
2 parents cabc92a + 6a167e0 commit 5462ca2

File tree

5 files changed

+67
-16
lines changed

5 files changed

+67
-16
lines changed

.github/workflows/build_wheels.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,8 @@ name: Build and upload to PyPI
33
on:
44
workflow_dispatch:
55
push:
6-
branches:
7-
- main
8-
paths:
9-
- "src/radius_clustering/**"
10-
- "tests/**"
11-
- "pyproject.toml"
12-
release:
13-
types:
14-
- published
6+
tags:
7+
- "v*"
158

169
jobs:
1710
run_pytest:
@@ -93,7 +86,7 @@ jobs:
9386
attestations: write
9487
#if: github.event_name == 'release' && github.event.action == 'published'
9588
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
96-
#if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
89+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
9790
steps:
9891
- name: Download all dists
9992
uses: actions/download-artifact@v4

.github/workflows/lint.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lint and Format
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
lint-and-format:
9+
name: Run Linters and Formatters
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.11"
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
python -m pip install ".[dev]"
24+
25+
- name: Run ruff linter
26+
run: |
27+
ruff check src/radius_clustering tests --fix
28+
29+
- name: Run black formatter
30+
run: |
31+
black src/radius_clustering tests --check
32+

.github/workflows/sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
sudo apt-get update
2424
sudo apt-get install build-essential
2525
pip install --upgrade pip
26-
pip install -e ".[doc]"
26+
pip install ".[doc]"
2727
pushd docs
2828
make html
2929
popd

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
10+
- repo: https://github.com/psf/black-pre-commit-mirror
11+
rev: 24.8.0
12+
hooks:
13+
- id: black
14+
15+
- repo: https://github.com/astral-sh/ruff-pre-commit
16+
rev: v0.5.5
17+
hooks:
18+
- id: ruff
19+
args: ["--fix", "--show-source"]

pyproject.toml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,21 @@ authors = [
1111
{name = "Quentin Haenn"},
1212
{name = "Lias Laboratory"}
1313
]
14+
maintainers = [
15+
{name = "Quentin Haenn", email = "[email protected]"}
16+
]
1417

1518
dependencies = [
1619
"matplotlib>=3.6.2",
17-
"numpy>=1.23",
20+
"numpy>=2.0",
1821
"scikit-learn>=1.2.2",
1922
"scipy>=1.12.0",
2023
]
2124

2225
requires-python = ">=3.9"
2326
license = {file = "LICENSE"}
2427
classifiers=[
28+
"Development Status :: 5 - Production/Stable",
2529
"Intended Audience :: Science/Research",
2630
"Intended Audience :: Developers",
2731
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
@@ -30,6 +34,8 @@ classifiers=[
3034
"Programming Language :: Python",
3135
"Topic :: Software Development",
3236
"Topic :: Scientific/Engineering",
37+
"Topic :: Scientific/Engineering :: Machine Learning",
38+
"Topic :: Scientific/Engineering :: Mathematics",
3339
"Operating System :: Microsoft :: Windows",
3440
"Operating System :: POSIX",
3541
"Operating System :: Unix",
@@ -42,15 +48,16 @@ classifiers=[
4248
"Programming Language :: Python :: 3.13",
4349
"Programming Language :: Python :: Implementation :: CPython",
4450
]
45-
keywords = ["Unsupervised learning","clustering", "minimum dominating sets","clustering under radius constraint"]
51+
keywords = ["Unsupervised learning", "clustering", "minimum dominating sets","clustering under radius constraint"]
4652

4753
[project.urls]
48-
source = "https://github.com/lias-laboratory/radius_clustering"
49-
tracker = "https://github.com/lias-laboratory/radius_clustering/issues"
50-
documentation = "https://lias-laboratory.github.io/radius_clustering/"
54+
source = "https://github.com/scikit-learn-contrib/radius_clustering"
55+
tracker = "https://github.com/scikit-learn-contrib/radius_clustering/issues"
56+
documentation = "https://contrib.scikit-learn.org/radius_clustering/"
5157

5258
[project.optional-dependencies]
5359
dev = [
60+
"pre-commit>=3.8.0",
5461
"pytest>=8.3.3",
5562
"pytest-cov>=5.0.0",
5663
"pandas",

0 commit comments

Comments
 (0)