Skip to content

Commit

Permalink
Merge pull request pycaret#3987 from Smartappli/master
Browse files Browse the repository at this point in the history
Workflows and dependencies update + python 3.12 support
  • Loading branch information
Yard1 authored Aug 30, 2024
2 parents 614bf41 + 207bf7c commit 97649ad
Show file tree
Hide file tree
Showing 17 changed files with 101 additions and 62 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -46,7 +46,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -60,4 +60,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/lock_old_threads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
- uses: dessant/lock-threads@v5
with:
issue-inactive-days: '30'
pr-inactive-days: '3650'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
pull-requests: write

steps:
- uses: actions/stale@v7
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message: This issue will be automatically closed by GitHub Actions in 1 week if there is no further activity.'
Expand Down
75 changes: 44 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,47 +20,50 @@ jobs:
name: Code quality checks
steps:
- name: Check out source repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run black
uses: psf/black@stable
with:
src: pycaret tests
version: 22.12.0
version: 24.8.0
- name: Check imports
uses: jamescurtin/isort-action@master
with:
sort-paths: pycaret tests
isort-version: 5.11.4
isort-version: 5.13.2
- name: Run flake8
uses: py-actions/flake8@v2
with:
path: pycaret tests
flake8-version: 6.0.0
flake8-version: 7.1.1

# JOBS MUST START WITH test !!!!
test_notebooks:
runs-on: ubuntu-latest
name: Test notebooks
steps:
- name: Check out source repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python environment
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
pip install -U pytest pytest-xdist nbmake
python -m pip install --upgrade pip
python -m pip install uv
python -m uv pip install -U pytest pytest-xdist nbmake
# https://github.com/yaml/pyyaml/issues/736
echo 'Cython < 3.0' > /tmp/constraint.txt
PIP_CONSTRAINT=/tmp/constraint.txt pip wheel PyYAML==5.4.1
pip install ".[full]"
python -m uv pip install ".[full]"
python -m ipykernel install --user --name cikernel
- name: Python version and dependency list
run: |
echo "Python version expected: 3.11"
echo "Python version expected: 3.12"
python --version
which python
pip list
Expand All @@ -73,32 +76,34 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'windows-latest' ]
python-version: [ '3.9', '3.10', '3.11' ]
python-version: [ '3.9', '3.10', '3.11', '3.12' ]

defaults:
run:
shell: bash

name: Python ${{ matrix.python-version }} on OS ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install dependencies
# SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL required due to
# pyLDAvis 3.3.1 having an "sklearn" dependency
run: |
export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
python -m pip install -U pip
python -m pip install -U pytest numpy
python -m pip install -U uv
python -m uv pip install -U pytest numpy
# https://github.com/yaml/pyyaml/issues/736
echo 'Cython < 3.0' > /tmp/constraint.txt
PIP_CONSTRAINT=/tmp/constraint.txt pip wheel PyYAML==5.4.1
pip install ".[full, test]"
python -m uv pip install ".[full, test]"
if [ -f requirements-prophet.txt ]; then pip install -r requirements-prophet.txt; fi
- name: Python version and dependency list
run: |
Expand All @@ -114,28 +119,30 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

name: Test plotting
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install dependencies
# SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL required due to
# pyLDAvis 3.3.1 having an "sklearn" dependency
run: |
export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
python -m pip install --upgrade pip
python -m pip install -U pytest numpy
python -m pip install uv
python -m uv pip install -U pytest numpy
# https://github.com/yaml/pyyaml/issues/736
echo 'Cython < 3.0' > /tmp/constraint.txt
PIP_CONSTRAINT=/tmp/constraint.txt pip wheel PyYAML==5.4.1
pip install ".[full, test]"
python -m uv pip install ".[full, test]"
- name: Python version and dependency list
run: |
echo "Python version expected: ${{ matrix.python-version }}"
Expand All @@ -150,28 +157,30 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

name: Test random tuning
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install dependencies
# SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL required due to
# pyLDAvis 3.3.1 having an "sklearn" dependency
run: |
export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
python -m pip install -U pip
python -m pip install -U pytest numpy
python -m pip install -U uv
python -m uv pip install -U pytest numpy
# https://github.com/yaml/pyyaml/issues/736
echo 'Cython < 3.0' > /tmp/constraint.txt
PIP_CONSTRAINT=/tmp/constraint.txt pip wheel PyYAML==5.4.1
pip install ".[full, test]"
python -m uv pip install ".[full, test]"
if [ -f requirements-prophet.txt ]; then pip install -r requirements-prophet.txt; fi
- name: Python version and dependency list
run: |
Expand All @@ -187,28 +196,30 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

name: Test grid tuning
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install dependencies
# SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL required due to
# pyLDAvis 3.3.1 having an "sklearn" dependency
run: |
export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
python -m pip install -U pip
python -m pip install -U pytest numpy
python -m pip install -U uv
python -m uv pip install -U pytest numpy
# https://github.com/yaml/pyyaml/issues/736
echo 'Cython < 3.0' > /tmp/constraint.txt
PIP_CONSTRAINT=/tmp/constraint.txt pip wheel PyYAML==5.4.1
pip install ".[full, test]"
python -m uv pip install ".[full, test]"
if [ -f requirements-prophet.txt ]; then pip install -r requirements-prophet.txt; fi
- name: Python version and dependency list
run: |
Expand All @@ -224,28 +235,30 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

name: Benchmark tests
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install dependencies
# SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL required due to
# pyLDAvis 3.3.1 having an "sklearn" dependency
run: |
export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
python -m pip install -U pip
python -m pip install -U pytest numpy
python -m pip install -U uv
python -m uv pip install -U pytest numpy
# https://github.com/yaml/pyyaml/issues/736
echo 'Cython < 3.0' > /tmp/constraint.txt
PIP_CONSTRAINT=/tmp/constraint.txt pip wheel PyYAML==5.4.1
pip install ".[full, test]"
python -m uv pip install ".[full, test]"
if [ -f requirements-prophet.txt ]; then pip install -r requirements-prophet.txt; fi
- name: Python version and dependency list
run: |
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ ci:

repos:
- repo: https://github.com/pycqa/isort
rev: 5.11.4
rev: 5.13.2
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.1.1
hooks:
- id: flake8

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.8.0
hooks:
- id: black
4 changes: 2 additions & 2 deletions Docker_files/pycaret_full/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM jupyter/base-notebook:latest

# name your environment and choose python 3.x version
ARG conda_env=pycaret_full
ARG py_ver=3.8
ARG py_ver=3.11

# add additional libraries you want with mamba
RUN mamba create --quiet --yes -p "${CONDA_DIR}/envs/${conda_env}" python=${py_ver} ipython ipykernel && \
Expand All @@ -17,7 +17,7 @@ RUN "${CONDA_DIR}/envs/${conda_env}/bin/python" -m ipykernel install --user --na
fix-permissions "/home/${NB_USER}"

# install pycaret full version
RUN "${CONDA_DIR}/envs/${conda_env}/bin/pip" install pycaret[full]==3.0.0
RUN "${CONDA_DIR}/envs/${conda_env}/bin/pip" install pycaret[full]>=3.3.2

# prepend conda environment to path
ENV PATH "${CONDA_DIR}/envs/${conda_env}/bin:${PATH}"
Expand Down
4 changes: 2 additions & 2 deletions Docker_files/pycaret_slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM jupyter/base-notebook:latest

# name your environment and choose python 3.x version
ARG conda_env=pycaret
ARG py_ver=3.8
ARG py_ver=3.11

# add additional libraries you want mamba to install by listing them below
RUN mamba create --quiet --yes -p "${CONDA_DIR}/envs/${conda_env}" python=${py_ver} ipython ipykernel && \
Expand All @@ -17,7 +17,7 @@ RUN "${CONDA_DIR}/envs/${conda_env}/bin/python" -m ipykernel install --user --na
fix-permissions "/home/${NB_USER}"

# install pycaret light version
RUN "${CONDA_DIR}/envs/${conda_env}/bin/pip" install pycaret==3.0.0
RUN "${CONDA_DIR}/envs/${conda_env}/bin/pip" install pycaret>=3.3.2


# prepend conda environment to path
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
| Overview | |
|---|---|
| **CI/CD** | ![pytest on push](https://github.com/pycaret/pycaret/workflows/pytest%20on%20push/badge.svg) [![Documentation Status](https://readthedocs.org/projects/pip/badge/?version=stable)](http://pip.pypa.io/en/stable/?badge=stable) |
| **Code** | [![!pypi](https://img.shields.io/pypi/v/pycaret?color=orange)](https://pypi.org/project/pycaret/) [![!python-versions](https://img.shields.io/badge/Python-3.9%20%7C%203.10%20%7C%203.11-blue)](https://badge.fury.io/py/pycaret) [![!black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
| **Code** | [![!pypi](https://img.shields.io/pypi/v/pycaret?color=orange)](https://pypi.org/project/pycaret/) [![!python-versions](https://img.shields.io/badge/Python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)](https://badge.fury.io/py/pycaret) [![!black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
| **Downloads**| [![Downloads](https://static.pepy.tech/personalized-badge/pycaret?period=week&units=international_system&left_color=grey&right_color=blue&left_text=weekly%20(pypi))](https://pepy.tech/project/pycaret) [![Downloads](https://static.pepy.tech/personalized-badge/pycaret?period=month&units=international_system&left_color=grey&right_color=blue&left_text=monthly%20(pypi))](https://pepy.tech/project/pycaret) [![Downloads](https://static.pepy.tech/personalized-badge/pycaret?period=total&units=international_system&left_color=grey&right_color=blue&left_text=cumulative%20(pypi))](https://pepy.tech/project/pycaret) |
| **License** | [![License](https://img.shields.io/pypi/l/ansicolortags.svg)](https://img.shields.io/pypi/l/ansicolortags.svg)
| **Community** | [![Slack](https://img.shields.io/badge/slack-chat-green.svg?logo=slack)](https://join.slack.com/t/pycaret/shared_invite/zt-20gl4zb8k-L~ZQDyi9LtrV4dWxYpLE7A) |
Expand All @@ -42,7 +42,7 @@ The design and simplicity of PyCaret are inspired by the emerging role of citize

## 🌐 Option 1: Install via PyPi
PyCaret is tested and supported on 64-bit systems with:
- Python 3.9, 3.10 and 3.11
- Python 3.9, 3.10, 3.11 and 3.12
- Ubuntu 16.04 or later
- Windows 7 or later

Expand Down
Loading

0 comments on commit 97649ad

Please sign in to comment.