Skip to content

Commit a72591e

Browse files
committed
CI add github actions
1 parent 642283e commit a72591e

File tree

3 files changed

+111
-4
lines changed

3 files changed

+111
-4
lines changed

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions as recommended in SPEC8:
4+
# https://github.com/scientific-python/specs/pull/325
5+
# At the time of writing, release critical workflows such as
6+
# pypa/gh-action-pypi-publish should use hash-based versioning for security
7+
# reasons. This strategy may be generalized to all other github actions
8+
# in the future.
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"
13+
groups:
14+
actions:
15+
patterns:
16+
- "*"
17+
reviewers:
18+
- "glemaitre"

.github/workflows/tests.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: 'tests'
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
test:
13+
strategy:
14+
matrix:
15+
os: [windows-latest, ubuntu-latest, macos-latest]
16+
environment: [
17+
ci-py310-min-dependencies,
18+
ci-py310-min-optional-dependencies,
19+
ci-py310-min-keras,
20+
ci-py310-min-tensorflow,
21+
ci-py311-sklearn-1-3,
22+
ci-py311-sklearn-1-4,
23+
ci-py312-latest-dependencies,
24+
ci-py312-latest-optional-dependencies
25+
]
26+
runs-on: ${{ matrix.os }}
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: prefix-dev/[email protected]
30+
with:
31+
pixi-version: v0.31.0
32+
environments: ${{ matrix.environment }}
33+
# we can freeze the environment and manually bump the dependencies to the
34+
# latest version time to time.
35+
frozen: true
36+
37+
- name: Run tests
38+
run: pixi run -e ${{ matrix.environment }} test -n 3
39+
40+
- name: Upload coverage reports to Codecov
41+
uses: codecov/[email protected]
42+
with:
43+
token: ${{ secrets.CODECOV_TOKEN }}
44+
slug: scikit-learn-contrib/imbalanced-learn

pyproject.toml

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ channels = ["conda-forge"]
8484
platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"]
8585

8686
[tool.pixi.dependencies]
87-
numpy = ">=1.23.5,<2"
88-
scipy = ">=1.9.3,<2"
89-
scikit-learn = ">=1.0.2,<2"
87+
numpy = ">=1.24.3,<2"
88+
scipy = ">=1.10.1,<2"
89+
scikit-learn = ">=1.2.2,<2"
9090
joblib = ">=1.1.1,<2"
9191
threadpoolctl = ">=2.0.0,<4"
9292

@@ -113,7 +113,7 @@ ruff = "==0.4.8"
113113
pre-commit = "*"
114114

115115
[tool.pixi.feature.optional.dependencies]
116-
keras = ">=2.9.1,<4"
116+
keras = ">=11.1,<4"
117117
pandas = ">=1.4.4,<3"
118118

119119
[tool.pixi.feature.tensorflow]
@@ -122,6 +122,40 @@ platforms = ["linux-64", "osx-arm64", "osx-64"]
122122
[tool.pixi.feature.tensorflow.dependencies]
123123
tensorflow = ">=2.11.1,<3"
124124

125+
[tool.pixi.feature.min-dependencies.dependencies]
126+
numpy = "==1.24.3"
127+
scipy = "==1.10.1"
128+
scikit-learn = "==1.2.2"
129+
joblib = "==1.1.1"
130+
threadpoolctl = "==2.0.0"
131+
132+
[tool.pixi.feature.min-optional-dependencies.dependencies]
133+
pandas = "==1.4.4"
134+
135+
[tool.pixi.feature.min-keras.dependencies]
136+
keras = "==2.11.1"
137+
138+
[tool.pixi.feature.min-tensorflow]
139+
platforms = ["linux-64", "osx-arm64", "osx-64"]
140+
141+
[tool.pixi.feature.min-tensorflow.dependencies]
142+
tensorflow = "==2.11.1"
143+
144+
[tool.pixi.feature.sklearn-1-3.dependencies]
145+
scikit-learn = "~=1.3.0"
146+
147+
[tool.pixi.feature.sklearn-1-4.dependencies]
148+
scikit-learn = "~=1.4.0"
149+
150+
[tool.pixi.feature.py310.dependencies]
151+
python = "~=3.10.0"
152+
153+
[tool.pixi.feature.py311.dependencies]
154+
python = "~=3.11.0"
155+
156+
[tool.pixi.feature.py312.dependencies]
157+
python = "~=3.12.0"
158+
125159
[tool.pixi.feature.tests.dependencies]
126160
pytest = ">=7.2.2,<9"
127161
pytest-cov = ">=4.1.0,<6"
@@ -136,6 +170,17 @@ docs = ["optional", "docs", "tensorflow"]
136170
tests = ["optional", "tests", "tensorflow"]
137171
dev = ["dev", "optional", "docs", "linters", "tests", "tensorflow"]
138172

173+
ci-py310-min-dependencies = ["py310", "min-dependencies", "tests"]
174+
ci-py310-min-optional-dependencies = ["py310", "min-optional-dependencies", "tests"]
175+
ci-py310-min-keras = ["py310", "min-keras", "tests"]
176+
ci-py310-min-tensorflow = ["py310", "min-tensorflow", "tests"]
177+
178+
ci-py311-sklearn-1-3 = ["py311", "sklearn-1-3", "tests"]
179+
ci-py311-sklearn-1-4 = ["py311", "sklearn-1-4", "tests"]
180+
181+
ci-py312-latest-dependencies = ["py312", "tests"]
182+
ci-py312-latest-optional-dependencies = ["py312", "optional", "tests"]
183+
139184
[tool.black]
140185
line-length = 88
141186
target_version = ['py310', 'py311']

0 commit comments

Comments
 (0)