Skip to content

Commit c22140f

Browse files
authored
Check build (#27)
1 parent dd21b4f commit c22140f

File tree

6 files changed

+39
-27
lines changed

6 files changed

+39
-27
lines changed

.github/workflows/pytest.yml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Run tests
22

3-
on: [push, workflow_dispatch]
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
48

59
jobs:
610
test:
@@ -9,12 +13,15 @@ jobs:
913

1014
steps:
1115
- name: Checkout
12-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
17+
with:
18+
filter: blob:none
19+
fetch-depth: 0
1320

1421
- name: Setup Python
15-
uses: actions/setup-python@v4
22+
uses: actions/setup-python@v5
1623
with:
17-
python-version: "3.10"
24+
python-version: "3.12"
1825
cache: pip
1926

2027
- name: Install project and dependencies
@@ -23,14 +30,23 @@ jobs:
2330
- name: Run test suite
2431
run: pytest -v --color=yes
2532

26-
check: # TODO: replace with pre-commit.ci
33+
check:
2734
runs-on: ubuntu-latest
2835
steps:
29-
- uses: actions/checkout@v3
30-
- uses: actions/setup-python@v4
36+
- uses: actions/checkout@v4
3137
with:
32-
python-version: "3.10"
33-
cache: pip
34-
- uses: pre-commit/[email protected]
35-
env:
36-
SKIP: no-commit-to-branch # only for local development
38+
filter: blob:none
39+
fetch-depth: 0
40+
41+
- uses: actions/setup-python@v5
42+
with:
43+
python-version: "3.12"
44+
# cache: pip # TODO: cache tools
45+
46+
- name: Install tools
47+
run: pip install twine build
48+
49+
- name: Build and check
50+
run: |
51+
python -m build
52+
twine check dist/*.whl

.pre-commit-config.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@ repos:
1212
- id: detect-private-key
1313
- id: no-commit-to-branch
1414
args: ["--branch=main"]
15-
- repo: https://github.com/psf/black
16-
rev: "23.12.0"
17-
hooks:
18-
- id: black
19-
- repo: https://github.com/charliermarsh/ruff-pre-commit
20-
rev: v0.1.7
15+
- repo: https://github.com/astral-sh/ruff-pre-commit
16+
rev: v0.3.2
2117
hooks:
2218
- id: ruff
2319
args: ["--fix"]
20+
- id: ruff-format
2421
- repo: https://github.com/pre-commit/mirrors-prettier
25-
rev: v4.0.0-alpha.4
22+
rev: v4.0.0-alpha.8
2623
hooks:
2724
- id: prettier

README.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
.. -*- mode: rst -*-
22
3-
|ReadTheDocs|_
3+
|PyPI|_ |ReadTheDocs|_
4+
5+
.. |PyPI| image:: https://img.shields.io/pypi/v/sklearn-ann
6+
.. _PyPI: https://pypi.org/project/sklearn-ann/
47

58
.. |ReadTheDocs| image:: https://readthedocs.org/projects/sklearn-ann/badge/?version=latest
69
.. _ReadTheDocs: https://sklearn-ann.readthedocs.io/en/latest/?badge=latest

examples/rnn_dbscan_big.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
Tests RnnDBSCAN on a large dataset. Requires pandas.
77
88
"""
9-
print(__doc__)
109

1110
import numpy as np
1211
from joblib import Memory

examples/rnn_dbscan_simple.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
Mostly copypasted from sklearn's DBSCAN example.
99
1010
"""
11-
print(__doc__)
1211

1312
import numpy as np
1413
from sklearn import metrics

pyproject.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ addopts = [
5555
# this will notify us when a test considered broken starts succeeding.
5656
xfail_strict = true
5757

58-
[tool.ruff]
59-
# TODO: remove `target-version` when switching to PEP 621
60-
target-version = "py39"
58+
[tool.ruff.lint]
6159
select = [
6260
"F", # Pyflakes
6361
"E", # Pycodestyle errors
@@ -72,9 +70,9 @@ ignore = [
7270
# Don’t complain about “confusables”
7371
"RUF001", "RUF002", "RUF003"
7472
]
75-
[tool.ruff.per-file-ignores]
73+
[tool.ruff.lint.per-file-ignores]
7674
"examples/*.py" = ["E402"]
77-
[tool.ruff.isort]
75+
[tool.ruff.lint.isort]
7876
known-first-party = ["sklearn_ann"]
7977

8078
[tool.hatch.envs.default]

0 commit comments

Comments
 (0)