[MNT] Enhance compatibility with Python 3.13/3.14 and update dependencies - #26
Merged
Conversation
Relax numpy, scipy, matplotlib and joblib bounds that blocked installation on python 3.13/3.14, widen requires-python and the runtime version gate to <3.15, add 3.13/3.14 trove classifiers, and remove the unused trio and deprecation dependencies (trio 0.24 cannot import on python 3.13; neither package is imported by pycaret).
np.product -> np.prod and np.NaN -> np.nan; both spellings behave identically on numpy 1.x, so older environments are unaffected.
joblib 1.4 deprecated and 1.5 removed the bytes_limit argument of Memory.__init__ and reworked the private MemorizedFunc API that pycaret.internal.memory extends. Detect the installed API and use a dedicated FastMemorizedFunc implementation for each, preserving the xxhash argument hashing and min_time_to_cache behaviour. joblib 1.3.2 cannot hash on python 3.14, so the new API path is required there.
siddharth7113
marked this pull request as draft
August 7, 2026 09:58
The previous comment claimed the old use_line_collection cap was fully obsolete (fixed in shap 0.44).
Contributor
|
👀 funny to see you here - are you stalking me 😁 |
Contributor
Author
Maybe 😛, I was looking at |
Verified empirically: joblib 1.4.2 raises the same Hasher._batch_setitems TypeError on python 3.14 as 1.3.x; the fix first works in joblib 1.5.0.
siddharth7113
marked this pull request as ready for review
August 7, 2026 11:32
Contributor
I think this |
Contributor
|
FYI, I merged #30 into this. Kindly check if there are any merge accidents - I went through manually and hope not. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #20.
Note: partially merged with #30, therefore some of the below description is no longer accurate.
Summary
Makes pycaret installable and importable on python 3.13 and 3.14 while keeping 3.9–3.12 working. The full CI matrix now installs on every OS/python combination (on
main, every 3.13/3.14 job fails at the install step). Remaining test failures are at parity withmainexcept two items pending direction (see last section).Dependency changes and why
requires-python>=3.9,<3.13>=3.9,<3.15numpy>=1.21,<1.27>=1.21,<3scipy>=1.6.1,<=1.11.4>=1.6.1,<2matplotlib<3.8.0<4stem(use_line_collection)) no longer applies to pycaret core, one issue in plotting, yellowbrick, see belowjoblib>=1.2.0,<1.4>=1.2.0Hasher._batch_setitems- cpython 3.14 changed pickle internals); 1.5.0+ verified working; the<1.4cap protectedinternal/memory.py, which is now ported (below)trio>=0.22.0,<0.25.0deprecation>=2.1.0Also annotated
jinja2(needed by pandasStyler) andkaleido(needed by plotly's png renderer, which pycaret auto-selects for large time-series plots).Per-file changes
pyproject.tomlpycaret/__init__.pypycaret/internal/patches/sklearn.py,pycaret/internal/preprocess/preprocessor.py—np.producttonp.prod,np.NaNtonp.nan. Both were removed in numpy 2.0; the replacements are identical in behavior and exist on numpy 1.x, so older environments are unaffected.pycaret/utils/_show_versions.py- dropdeprecationfrom the version listing.pycaret/internal/memory.py:Memory/MemorizedFuncand overriding private joblib internals.bytes_limitmoved fromMemory.__init__toMemory.reduce_size, andMemorizedFunc._get_output_identifierswas replaced byfunc_id+_get_args_idwith new_before_call/_after_callhooks. With joblib 1.5 (required for 3.14), everysetup()call raisedTypeError, thenAttributeError.FastMemoryacceptsbytes_limiton both APIs and routes it appropriately.FastMemorizedFuncis now an alias resolved at import time between the untouched legacy implementation (joblib < 1.4) and a new, much smaller implementation for joblib >= 1.4 smaller because upstream fixed the double-hashing the legacy class worked around, so only two overrides remain:_get_args_id(xxhash argument hashing) and_after_call(skip persisting fast calls).FastMemory.__del__no longer raises during interpreter teardown or after failed construction.Core is installable on 3.13 and 3.14
Resolver, wheels-only, all six versions :
uv pip install '.[dev,test,mlops]' --dry-run --only-binary :all: --no-binary mljar-scikit-plotresolves successfully on 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 (mljar-scikit-plotis pure-python and ships only an sdist).CI install step is coompleted job of the PR run, including 3.13/3.14 on ubuntu, windows and macOS.
Test parity: locally,
tests/test_preprocess.py tests/test_pipeline.py tests/test_utils.pyon 3.13 and 3.14 both give 15 failed / 71 passed ,identical to failing set as main's CI.