Skip to content

Commit 642283e

Browse files
committed
MAINT switch CI to use pixi
1 parent 980cc94 commit 642283e

File tree

12 files changed

+16017
-206
lines changed

12 files changed

+16017
-206
lines changed

.flake8

Lines changed: 0 additions & 8 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,6 @@ doc/min_dependency_table.rst
127127

128128
# MacOS
129129
.DS_Store
130+
131+
# Pixi folder
132+
.pixi/

.pre-commit-config.yaml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,13 @@ repos:
55
- id: check-yaml
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
8-
- repo: https://github.com/psf/black
9-
rev: 23.3.0
10-
hooks:
11-
- id: black
128
- repo: https://github.com/astral-sh/ruff-pre-commit
139
# Ruff version.
14-
rev: v0.0.272
10+
rev: v0.4.8
1511
hooks:
1612
- id: ruff
17-
args: ["--fix", "--show-source"]
18-
- repo: https://github.com/pre-commit/mirrors-mypy
19-
rev: v1.3.0
13+
args: ["--fix", "--output-format=full"]
14+
- repo: https://github.com/psf/black
15+
rev: 23.3.0
2016
hooks:
21-
- id: mypy
22-
files: imblearn/
23-
additional_dependencies: [pytest==6.2.4]
17+
- id: black

Makefile

Lines changed: 0 additions & 35 deletions
This file was deleted.

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
versionSpec: '3.9'
4646
- bash: |
4747
# Include pytest compatibility with mypy
48-
pip install flake8 pytest mypy==1.3.0 black==23.3 ruff==0.0.272
48+
pip install pytest mypy==1.3.0 black==23.3 ruff==0.0.272
4949
displayName: Install linters
5050
- bash: |
5151
black --check --diff .

imblearn/VERSION.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.13.0.dev0

imblearn/_min_dependencies.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
"""All minimum dependencies for imbalanced-learn."""
22
import argparse
33

4-
NUMPY_MIN_VERSION = "1.17.3"
5-
SCIPY_MIN_VERSION = "1.5.0"
6-
PANDAS_MIN_VERSION = "1.0.5"
7-
SKLEARN_MIN_VERSION = "1.0.2"
8-
TENSORFLOW_MIN_VERSION = "2.4.3"
9-
KERAS_MIN_VERSION = "2.4.3"
4+
NUMPY_MIN_VERSION = "1.24.3"
5+
SCIPY_MIN_VERSION = "1.10.1"
6+
PANDAS_MIN_VERSION = "1.5.3"
7+
SKLEARN_MIN_VERSION = "1.2.2"
8+
TENSORFLOW_MIN_VERSION = "2.11.1"
9+
KERAS_MIN_VERSION = "2.1.11"
1010
JOBLIB_MIN_VERSION = "1.1.1"
1111
THREADPOOLCTL_MIN_VERSION = "2.0.0"
12-
PYTEST_MIN_VERSION = "5.0.1"
12+
PYTEST_MIN_VERSION = "7.2.2"
1313

1414
# 'build' and 'install' is included to have structured metadata for CI.
1515
# It will NOT be included in setup's extras_require
@@ -23,21 +23,22 @@
2323
"pandas": (PANDAS_MIN_VERSION, "optional, docs, examples, tests"),
2424
"tensorflow": (TENSORFLOW_MIN_VERSION, "optional, docs, examples, tests"),
2525
"keras": (KERAS_MIN_VERSION, "optional, docs, examples, tests"),
26-
"matplotlib": ("3.1.2", "docs, examples"),
27-
"seaborn": ("0.9.0", "docs, examples"),
28-
"memory_profiler": ("0.57.0", "docs"),
26+
"matplotlib": ("3.7.3", "docs, examples"),
27+
"seaborn": ("0.12.2", "docs, examples"),
28+
"memory_profiler": ("0.61.0", "docs"),
29+
"numpydoc": ("1.5.0", "docs", "tests"),
2930
"pytest": (PYTEST_MIN_VERSION, "tests"),
30-
"pytest-cov": ("2.9.0", "tests"),
31-
"flake8": ("3.8.2", "tests"),
31+
"pytest-cov": ("4.1.0", "tests"),
32+
"pytest-xdist": ("3.5.0", "tests"),
3233
"black": ("23.3.0", "tests"),
34+
"ruff": ("0.4.8", "tests"),
3335
"mypy": ("1.3.0", "tests"),
34-
"sphinx": ("6.0.0", "docs"),
36+
"sphinx": ("8.0.2", "docs"),
3537
"sphinx-gallery": ("0.13.0", "docs"),
3638
"sphinx-copybutton": ("0.5.2", "docs"),
37-
"numpydoc": ("1.5.0", "docs"),
3839
"sphinxcontrib-bibtex": ("2.4.1", "docs"),
39-
"pydata-sphinx-theme": ("0.13.3", "docs"),
40-
"sphinx-design": ("0.5.0", "docs"),
40+
"pydata-sphinx-theme": ("0.15.4", "docs"),
41+
"sphinx-design": ("0.6.1", "docs"),
4142
}
4243

4344

imblearn/_version.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#
2121
# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
2222
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
23-
#
2423

25-
__version__ = "0.13.0.dev0"
24+
from pathlib import Path
25+
26+
with open(Path(__file__).parent / "VERSION.txt") as _fh:
27+
__version__ = _fh.read().strip()

pixi.lock

Lines changed: 15805 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 181 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,195 @@
1-
[tool.black]
2-
target-version = ['py38']
3-
include = '\.pyi?$'
1+
[build-system]
2+
requires = ["setuptools>=64", "setuptools_scm[toml]>=8"]
3+
build-backend = "setuptools.build_meta"
44

5-
[tool.isort]
6-
profile = "black"
5+
[project]
6+
name = "imbalanced-learn"
7+
dynamic = ["version", "readme"]
8+
description = "Toolbox for imbalanced dataset in machine learning"
9+
authors = [
10+
{ name="G. Lemaitre", email="[email protected]"},
11+
{ name="C. Aridas", email="[email protected]"},
12+
]
13+
classifiers = [
14+
"Development Status :: 5 - Production/Stable",
15+
"Environment :: Console",
16+
"Intended Audience :: Science/Research",
17+
"License :: OSI Approved :: MIT License",
18+
"Operating System :: OS Independent",
19+
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
22+
"Topic :: Scientific/Engineering",
23+
"Topic :: Software Development :: Libraries",
24+
]
25+
requires-python = ">=3.10"
26+
dependencies = [
27+
"numpy>=1.24.3,<3",
28+
"scipy>=1.10.1,<2",
29+
"scikit-learn>=1.2.2,<2",
30+
"joblib>=1.1.1,<2",
31+
"threadpoolctl>=2.0.0,<4",
32+
]
733

8-
[tool.ruff]
9-
# all rules can be found here: https://beta.ruff.rs/docs/rules/
10-
select = ["E", "F", "W", "I"]
34+
[tool.setuptools.dynamic]
35+
version = { file = "imblearn/VERSION.txt" }
36+
readme = { file = "README.rst" }
37+
38+
[project.optional-dependencies]
39+
dev = [
40+
"ipykernel",
41+
"ipython",
42+
"jupyterlab",
43+
]
44+
docs = [
45+
"pandas>=1.5.3,<3",
46+
"tensorflow>=2.11.1,<3",
47+
"matplotlib>=3.7.3,<4",
48+
"seaborn>=0.12.2,<1",
49+
"memory_profiler>=0.61.0,<1",
50+
"numpydoc>=1.5.0,<2",
51+
"sphinx>=8.0.2,<9",
52+
"sphinx-gallery>=0.13.0,<1",
53+
"sphinxcontrib-bibtex>=2.6.3,<3",
54+
"sphinx-copybutton>=0.5.2,<1",
55+
"pydata-sphinx-theme>=0.15.4,<1",
56+
"sphinx-design>=0.6.1,<1",
57+
]
58+
linters = [
59+
"black==23.3.0",
60+
"ruff==0.4.8",
61+
"pre-commit",
62+
]
63+
optional = [
64+
"tensorflow>=2.11.1,<3",
65+
"keras>=2.11.1,<4",
66+
"pandas>=1.4.4,<3",
67+
]
68+
tests = [
69+
"pytest>=7.2.2,<9",
70+
"pytest-cov>=4.1.0,<6",
71+
"pytest-xdist>=3.5.0,<4",
72+
]
73+
74+
[project.urls]
75+
Homepage = "https://imbalanced-learn.org/"
76+
Source = "https://github.com/scikit-learn-contrib/imbalanced-learn"
77+
Issues = "https://github.com/scikit-learn-contrib/imbalanced-learn/issues"
78+
79+
[tool.setuptools]
80+
packages = ["imblearn"]
81+
82+
[tool.pixi.project]
83+
channels = ["conda-forge"]
84+
platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"]
85+
86+
[tool.pixi.dependencies]
87+
numpy = ">=1.23.5,<2"
88+
scipy = ">=1.9.3,<2"
89+
scikit-learn = ">=1.0.2,<2"
90+
joblib = ">=1.1.1,<2"
91+
threadpoolctl = ">=2.0.0,<4"
92+
93+
[tool.pixi.feature.dev.dependencies]
94+
ipykernel = "*"
95+
ipython = "*"
96+
jupyterlab = "*"
1197

98+
[tool.pixi.feature.docs.dependencies]
99+
matplotlib = ">=3.7.3,<4"
100+
seaborn = ">=0.12.2,<1"
101+
memory_profiler = ">=0.61.0,<1"
102+
numpydoc = ">=1.5.0,<2"
103+
sphinx = ">=8.0.2,<9"
104+
sphinx-gallery = ">=0.13.0,<1"
105+
sphinxcontrib-bibtex = ">=2.4.1,<3"
106+
sphinx-copybutton = ">=0.5.2,<1"
107+
pydata-sphinx-theme = ">=0.15.4,<1"
108+
sphinx-design = ">=0.6.1,<1"
109+
110+
[tool.pixi.feature.linters.dependencies]
111+
black = "==23.3.0"
112+
ruff = "==0.4.8"
113+
pre-commit = "*"
114+
115+
[tool.pixi.feature.optional.dependencies]
116+
keras = ">=2.9.1,<4"
117+
pandas = ">=1.4.4,<3"
118+
119+
[tool.pixi.feature.tensorflow]
120+
platforms = ["linux-64", "osx-arm64", "osx-64"]
121+
122+
[tool.pixi.feature.tensorflow.dependencies]
123+
tensorflow = ">=2.11.1,<3"
124+
125+
[tool.pixi.feature.tests.dependencies]
126+
pytest = ">=7.2.2,<9"
127+
pytest-cov = ">=4.1.0,<6"
128+
pytest-xdist = ">=3.5.0,<4"
129+
130+
[tool.pixi.pypi-dependencies]
131+
imbalanced-learn = { path = ".", editable = true }
132+
133+
[tool.pixi.environments]
134+
linters = ["linters"]
135+
docs = ["optional", "docs", "tensorflow"]
136+
tests = ["optional", "tests", "tensorflow"]
137+
dev = ["dev", "optional", "docs", "linters", "tests", "tensorflow"]
138+
139+
[tool.black]
140+
line-length = 88
141+
target_version = ['py310', 'py311']
142+
preview = true
143+
# Exclude irrelevant directories for formatting
144+
exclude = '''
145+
/(
146+
\.eggs
147+
| \.git
148+
| \.mypy_cache
149+
| \.vscode
150+
| \.pytest_cache
151+
| \.idea
152+
| build
153+
| dist
154+
)/
155+
'''
156+
157+
[tool.ruff]
12158
# max line length for black
13159
line-length = 88
14-
target-version = "py38"
160+
target-version = "py310"
161+
exclude=[
162+
".git",
163+
"__pycache__",
164+
"dist",
165+
"doc/_build",
166+
"doc/auto_examples",
167+
"build",
168+
]
15169

170+
[tool.ruff.lint]
171+
# all rules can be found here: https://beta.ruff.rs/docs/rules/
172+
select = ["E", "F", "W", "I"]
16173
ignore=[
17174
# space before : (needed for how black formats slicing)
18175
"E203",
19176
# do not assign a lambda expression, use a def
20177
"E731",
21178
# do not use variables named 'l', 'O', or 'I'
22179
"E741",
23-
# Import not on the top of the file
24-
"E402",
25180
]
181+
182+
[tool.ruff.lint.per-file-ignores]
183+
# It's fine not to put the import at the top of the file in the examples
184+
# folder.
185+
"examples/*"=["E402"]
186+
"doc/conf.py"=["E402"]
187+
188+
[tool.pytest.ini_options]
189+
filterwarnings = [
190+
# Turn deprecation warnings into errors
191+
"error::FutureWarning",
192+
"error::DeprecationWarning",
193+
]
194+
addopts = "--doctest-modules --color=yes -rs"
195+
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS"

0 commit comments

Comments
 (0)