Skip to content

Commit 41b7245

Browse files
auguste-probablrcap107GaelVaroquaux
authored
MAINT - Using pixi for nightlies and fixing failing nightly tests (#1664)
Co-authored-by: Riccardo Cappuzzo <riccardo.cappuzzo@gmail.com> Co-authored-by: Riccardo Cappuzzo <7548232+rcap107@users.noreply.github.com> Co-authored-by: Gael Varoquaux <gael.varoquaux@normalesup.org>
1 parent 6ecf8d0 commit 41b7245

21 files changed

Lines changed: 10313 additions & 8151 deletions

.github/workflows/testing.yml

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [windows-latest, ubuntu-latest, macos-latest]
18-
environment: [
19-
ci-py309-min-deps,
20-
ci-py309-min-optional-deps,
21-
ci-py311-transformers,
22-
ci-py313-latest-deps,
23-
ci-py313-latest-optional-deps,
24-
ci-py313-polars-without-pyarrow
25-
]
18+
environment:
19+
- ci-py309-min-deps
20+
- ci-py309-min-optional-deps
21+
- ci-py311-transformers
22+
- ci-py313-latest-deps
23+
- ci-py313-latest-optional-deps
24+
- ci-py313-polars-without-pyarrow
2625
runs-on: ${{ matrix.os }}
2726
steps:
2827
- uses: actions/checkout@v5
@@ -33,13 +32,10 @@ jobs:
3332
# we can freeze the environment and manually bump the dependencies to the
3433
# latest version time to time.
3534
frozen: true
36-
3735
- name: Run tests
3836
run: pixi run -e ${{ matrix.environment }} test -n auto
39-
4037
- name: Run user guide doctests
4138
run: pixi run -e ${{ matrix.environment }} test-user-guide
42-
4339
- name: Upload coverage reports to Codecov
4440
uses: codecov/codecov-action@v5.5.1
4541
with:
@@ -55,28 +51,21 @@ jobs:
5551
with:
5652
ref: ${{ github.event.pull_request.head.sha }}
5753
- id: get_head_commit_message
58-
name: get head commit message
54+
name: Get head commit message
5955
run: echo "COMMIT_MSG=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
6056

6157
test_against_nightly:
6258
needs: check_run_nightly
6359
if: ${{ needs.check_run_nightly.outputs.run == 'true' }}
6460
runs-on: ubuntu-latest
65-
name: test against nighlty dependencies
61+
name: Test against nightly dependencies
6662
steps:
6763
- uses: actions/checkout@v5
68-
- uses: actions/setup-python@v6
64+
- uses: prefix-dev/setup-pixi@v0.9.1
6965
with:
70-
python-version: "3.11"
71-
name: 'Setup python'
72-
- shell: bash {0}
73-
run: |
74-
dev_anaconda_url=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
75-
pip install --pre --upgrade --timeout=60 --extra-index $dev_anaconda_url .
76-
dev_arrow=https://pypi.fury.io/arrow-nightlies/
77-
pip install --extra-index-url $dev_arrow --prefer-binary --pre .[optional]
78-
pip install .[test]
79-
name: 'Install skrub and nightly dependencies'
80-
- shell: bash {0}
81-
run: pytest -vsl --cov=skrub --cov-report=xml skrub -n 3
82-
name: 'Run tests'
66+
pixi-version: v0.41.3
67+
# we can freeze the environment and manually bump the dependencies to the
68+
# latest version time to time.
69+
frozen: true
70+
- name: Run tests
71+
run: pixi run --environment ci-nightly-deps pytest -vsl --cov=skrub --cov-report=xml skrub -n 3

CHANGES.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ Bugfixes
4646
columns with some dtypes (lists, structs) are sorted. It would not indicate
4747
Polars columns sorted in descending order. Fixed in :pr:`1673` by
4848
:user:`Jérôme Dockès <jeromedockes>`.
49-
49+
- Fixed nightly checks and added support for upcoming library versions, including Pandas
50+
v3.0. :pr:`1664` by :user:`Auguste Baum <auguste-probabl>` and
51+
:user:`Riccardo Cappuzzo <rcap107>`.
5052

5153
Release 0.6.2
5254
=============

pixi.lock

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

pyproject.toml

Lines changed: 121 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ dynamic = ["version"]
88
description = "Machine learning with dataframes"
99
readme = "README.rst"
1010
authors = [
11-
{name = "Riccardo Cappuzzo"},
12-
{name = "Jerome Dockes"},
13-
{name = "Guillaume Lemaitre"},
14-
{name = "Vincent Maladiere"},
15-
{name = "Gael Varoquaux"},
11+
{ name = "Riccardo Cappuzzo" },
12+
{ name = "Jerome Dockes" },
13+
{ name = "Guillaume Lemaitre" },
14+
{ name = "Vincent Maladiere" },
15+
{ name = "Gael Varoquaux" },
1616
]
1717
license = "BSD-3-Clause"
1818
license-files = ["LICENSE.txt"]
@@ -31,56 +31,54 @@ classifiers = [
3131
]
3232
requires-python = ">=3.9"
3333
dependencies = [
34-
"numpy>=1.23.5",
35-
"pandas>=1.5.3",
36-
"scikit-learn>=1.2.1",
37-
"scipy>=1.9.3",
38-
"jinja2>=3.1.2",
39-
"matplotlib>=3.4.3",
40-
"requests>=2.25.0",
41-
"pydot",
34+
"numpy>=1.23.5",
35+
"pandas>=1.5.3",
36+
"scikit-learn>=1.2.1",
37+
"scipy>=1.9.3",
38+
"jinja2>=3.1.2",
39+
"matplotlib>=3.4.3",
40+
"requests>=2.25.0",
41+
"pydot",
4242
]
4343

4444
[tool.setuptools.dynamic]
4545
version = { file = "skrub/VERSION.txt" }
4646

4747
[project.optional-dependencies]
4848
dev = [
49-
"ipykernel",
50-
"ipython",
51-
"jupyterlab",
52-
53-
# doc
54-
"jupyterlite-sphinx",
55-
"jupyterlite-pyodide-kernel",
56-
"numpydoc",
57-
"pydata-sphinx-theme",
58-
"seaborn",
59-
"sphinx",
60-
"sphinx-copybutton",
61-
"sphinx-gallery",
62-
"sphinxext-opengraph",
63-
"sphinx-autosummary-accessors",
64-
"statsmodels",
65-
66-
# lint
67-
"black==23.3.0",
68-
"ruff==0.4.8",
69-
"pre-commit",
70-
71-
# test
72-
"pytest",
73-
"pytest-cov",
74-
"pytest-xdist",
75-
76-
# optional
77-
"pyarrow",
78-
"polars",
79-
"plotly",
80-
]
81-
transformers = [
82-
"sentence-transformers",
49+
"ipykernel",
50+
"ipython",
51+
"jupyterlab",
52+
53+
# doc
54+
"jupyterlite-sphinx",
55+
"jupyterlite-pyodide-kernel",
56+
"numpydoc",
57+
"pydata-sphinx-theme",
58+
"seaborn",
59+
"sphinx",
60+
"sphinx-copybutton",
61+
"sphinx-gallery",
62+
"sphinxext-opengraph",
63+
"sphinx-autosummary-accessors",
64+
"statsmodels",
65+
66+
# lint
67+
"black==23.3.0",
68+
"ruff==0.4.8",
69+
"pre-commit",
70+
71+
# test
72+
"pytest",
73+
"pytest-cov",
74+
"pytest-xdist",
75+
76+
# optional
77+
"pyarrow",
78+
"polars",
79+
"plotly",
8380
]
81+
transformers = ["sentence-transformers"]
8482

8583
[project.urls]
8684
Homepage = "https://skrub-data.org/"
@@ -90,7 +88,7 @@ Issues = "https://github.com/skrub-data/skrub/issues"
9088
[tool.setuptools]
9189
packages = ["skrub"]
9290

93-
[tool.pixi.project]
91+
[tool.pixi.workspace]
9492
channels = ["conda-forge", "pytorch"]
9593
platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"]
9694

@@ -169,6 +167,31 @@ pyarrow = "==15.0.2"
169167
polars = "==0.20.15"
170168
plotly = "*"
171169

170+
[tool.pixi.feature.nightly-dependencies.pypi-options]
171+
# Get the nightly of as many dependencies as possible
172+
extra-index-urls = [
173+
# scikit-learn, numpy, pandas...
174+
"https://pypi.anaconda.org/scientific-python-nightly-wheels/simple",
175+
# pyarrow
176+
"https://pypi.fury.io/arrow-nightlies",
177+
]
178+
179+
[tool.pixi.feature.nightly-dependencies.pypi-dependencies]
180+
# Have to repeat dependencies here because otherwise pixi pulls from conda channels
181+
# rather than PyPI indexes
182+
skrub = { path = ".", editable = true }
183+
numpy = "*"
184+
pandas = "*"
185+
scikit-learn = "*"
186+
scipy = "*"
187+
jinja2 = "*"
188+
matplotlib = "*"
189+
pydot = "*"
190+
requests = "*"
191+
pyarrow = "*"
192+
polars = "*"
193+
plotly = "*"
194+
172195
[tool.pixi.feature.polars-without-pyarrow.dependencies]
173196
polars = "*"
174197
plotly = "*"
@@ -211,14 +234,22 @@ doc = ["optional", "doc", "transformers"]
211234
test = ["optional", "test"]
212235
dev = ["dev", "optional", "doc", "lint", "test", "transformers"]
213236
ci-py309-min-deps = ["py309", "min-dependencies", "test"]
214-
ci-py309-min-optional-deps = ["py309", "min-dependencies", "min-optional-dependencies", "test"]
237+
ci-py309-min-optional-deps = [
238+
"py309",
239+
"min-dependencies",
240+
"min-optional-dependencies",
241+
"test",
242+
]
215243
ci-py311-transformers = ["py311", "transformers", "test"]
216244
ci-py312-latest-deps = ["py312", "test"]
217245
ci-py312-latest-optional-deps = ["py312", "optional", "test"]
218246
ci-py313-latest-deps = ["py313", "test"]
219247
ci-py313-polars-without-pyarrow = ["py313", "test", "polars-without-pyarrow"]
220248
ci-py313-latest-optional-deps = ["py313", "optional", "test"]
221249

250+
# no-default-feature is necessary for pixi to download from nightly PyPI indexes rather than conda channels
251+
ci-nightly-deps = { no-default-feature = true, features = [ "py313", "nightly-dependencies", "test" ] }
252+
222253
[tool.black]
223254
line-length = 88
224255
target_version = ['py310', 'py311']
@@ -241,60 +272,60 @@ exclude = '''
241272
# max line length for black
242273
line-length = 88
243274
target-version = "py38"
244-
exclude=[
245-
".git",
246-
"__pycache__",
247-
"dist",
248-
"doc/_build",
249-
"doc/auto_examples",
250-
"build",
275+
exclude = [
276+
".git",
277+
"__pycache__",
278+
"dist",
279+
"doc/_build",
280+
"doc/auto_examples",
281+
"build",
251282
]
252283

253284
[tool.ruff.lint]
254285
# all rules can be found here: https://beta.ruff.rs/docs/rules/
255286
select = ["E", "F", "W", "I"]
256-
ignore=[
257-
# space before : (needed for how black formats slicing)
258-
"E203",
259-
# do not assign a lambda expression, use a def
260-
"E731",
261-
# do not use variables named 'l', 'O', or 'I'
262-
"E741",
287+
ignore = [
288+
# space before : (needed for how black formats slicing)
289+
"E203",
290+
# do not assign a lambda expression, use a def
291+
"E731",
292+
# do not use variables named 'l', 'O', or 'I'
293+
"E741",
263294
]
264295

265296
[tool.ruff.lint.per-file-ignores]
266297
# It's fine not to put the import at the top of the file in the examples
267298
# folder.
268-
"examples/*"=["E402"]
269-
"doc/conf.py"=["E402"]
299+
"examples/*" = ["E402"]
300+
"doc/conf.py" = ["E402"]
270301

271302
[tool.pytest.ini_options]
272303
filterwarnings = [
273-
# Turn deprecation warnings into errors
274-
"error::FutureWarning",
275-
"error::DeprecationWarning",
276-
277-
# Ignore warning from np.in1d since the future behavior is already the desired
278-
# behavior. TODO remove when numpy min version >= 1.25.
279-
'ignore:elementwise\ comparison\ failed:FutureWarning',
280-
# TODO remove when pandas min version >= 2.2.0
281-
'ignore:.*utcfromtimestamp\(\) is deprecated.*:DeprecationWarning',
282-
# TODO remove when joblib min version >= 1.4.0
283-
'ignore:.*ast\.Num is deprecated.*:DeprecationWarning',
284-
# TODO remove when joblib min version >= 1.4.0
285-
'ignore:.*ast\.NameConstant is deprecated.*:DeprecationWarning',
286-
# TODO remove when joblib min version >= 1.4.0
287-
'ignore:.*Attribute n is deprecated.*:DeprecationWarning',
288-
# FIXME we need to decided what to do with pyarrow that is required by pandas >= 3.0
289-
'ignore:(?s).*Pyarrow will become a required dependency of pandas.*:DeprecationWarning',
290-
# accessing .values on a pandas dataframe raises this warning after numpy 1.25;
291-
# should be addressed in pandas
292-
'ignore:np.find_common_type is deprecated.*:DeprecationWarning',
293-
'ignore:.*distutils Version classes are deprecated.*',
294-
'ignore:.*`resume_download` is deprecated.*',
295-
'ignore:.*`clean_up_tokenization_spaces` was not set.*',
296-
'ignore:The current process just got forked.*',
297-
'ignore:.*`clean_up_tokenization_spaces` was not set.*',
304+
# Turn deprecation warnings into errors
305+
"error::FutureWarning",
306+
"error::DeprecationWarning",
307+
308+
# Ignore warning from np.in1d since the future behavior is already the desired
309+
# behavior. TODO remove when numpy min version >= 1.25.
310+
'ignore:elementwise\ comparison\ failed:FutureWarning',
311+
# TODO remove when pandas min version >= 2.2.0
312+
'ignore:.*utcfromtimestamp\(\) is deprecated.*:DeprecationWarning',
313+
# TODO remove when joblib min version >= 1.4.0
314+
'ignore:.*ast\.Num is deprecated.*:DeprecationWarning',
315+
# TODO remove when joblib min version >= 1.4.0
316+
'ignore:.*ast\.NameConstant is deprecated.*:DeprecationWarning',
317+
# TODO remove when joblib min version >= 1.4.0
318+
'ignore:.*Attribute n is deprecated.*:DeprecationWarning',
319+
# FIXME we need to decided what to do with pyarrow that is required by pandas >= 3.0
320+
'ignore:(?s).*Pyarrow will become a required dependency of pandas.*:DeprecationWarning',
321+
# accessing .values on a pandas dataframe raises this warning after numpy 1.25;
322+
# should be addressed in pandas
323+
'ignore:np.find_common_type is deprecated.*:DeprecationWarning',
324+
'ignore:.*distutils Version classes are deprecated.*',
325+
'ignore:.*`resume_download` is deprecated.*',
326+
'ignore:.*`clean_up_tokenization_spaces` was not set.*',
327+
'ignore:The current process just got forked.*',
328+
'ignore:.*`clean_up_tokenization_spaces` was not set.*',
298329
]
299330
addopts = "--doctest-modules"
300331
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS"

skrub/_apply_to_cols.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ class ApplyToCols(TransformerMixin, BaseEstimator):
343343
birthday city
344344
0 29/01/2024 London
345345
>>> df.dtypes
346-
birthday object
347-
city object
346+
birthday ...
347+
city ...
348348
dtype: object
349349
>>> ToDatetime().fit_transform(df["birthday"])
350350
0 2024-01-29
@@ -382,7 +382,7 @@ class ApplyToCols(TransformerMixin, BaseEstimator):
382382
383383
>>> transformed.dtypes
384384
birthday datetime64[...]
385-
city object
385+
city ...
386386
dtype: object
387387
>>> to_datetime.transformers_
388388
{'birthday': ToDatetime()}

0 commit comments

Comments
 (0)