diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8c89516d..b2659fde 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -31,7 +31,7 @@ jobs: test-id: [main] include: - julia-version: '1.10' - python-version: '3.9' + python-version: '3.10' os: ubuntu-latest test-id: include - julia-version: '1' @@ -89,7 +89,7 @@ jobs: julia-version: ['1'] include: - os: ubuntu-latest - python-version: '3.9' + python-version: '3.10' julia-version: '1.10' steps: - uses: actions/checkout@v4 @@ -168,7 +168,7 @@ jobs: matrix: python-version: - '3.12' - - '3.9' + - '3.10' os: ['ubuntu-latest'] steps: @@ -184,10 +184,10 @@ jobs: pip install '.[dev]' - name: "Run mypy" run: python -m mypy --install-types --non-interactive pysr - if: ${{ matrix.python-version != '3.9' }} + if: ${{ matrix.python-version != '3.10' }} - name: "Run compatible mypy" run: python -m mypy --ignore-missing-imports pysr - if: ${{ matrix.python-version == '3.9' }} + if: ${{ matrix.python-version == '3.10' }} beartype: name: Test with beartype diff --git a/.github/workflows/CI_conda_forge.yml b/.github/workflows/CI_conda_forge.yml index 98d064b9..097a22bc 100644 --- a/.github/workflows/CI_conda_forge.yml +++ b/.github/workflows/CI_conda_forge.yml @@ -20,17 +20,17 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.9', '3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12'] os: ['ubuntu-latest'] use-mamba: [true, false] include: - - python-version: 3.9 + - python-version: 3.10 os: 'windows-latest' use-mamba: true - python-version: 3.12 os: 'windows-latest' use-mamba: true - - python-version: 3.9 + - python-version: 3.10 os: 'macos-latest' use-mamba: true - python-version: 3.12 diff --git a/.github/workflows/CI_docker_large_nightly.yml b/.github/workflows/CI_docker_large_nightly.yml index 35d15fba..4e6dbf8b 100644 --- a/.github/workflows/CI_docker_large_nightly.yml +++ b/.github/workflows/CI_docker_large_nightly.yml @@ -18,8 +18,8 @@ jobs: strategy: fail-fast: false matrix: - julia-version: ['1.6', '1'] - python-version: ['3.9', '3.12'] + julia-version: ['1.10', '1'] + python-version: ['3.10', '3.12'] os: [ubuntu-latest] arch: ['linux/amd64', 'linux/arm64'] diff --git a/.github/workflows/CI_large_nightly.yml b/.github/workflows/CI_large_nightly.yml index 369d4bf4..4598468b 100644 --- a/.github/workflows/CI_large_nightly.yml +++ b/.github/workflows/CI_large_nightly.yml @@ -23,8 +23,8 @@ jobs: strategy: fail-fast: false matrix: - julia-version: ['1.6', '1.8', '1.10'] - python-version: ['3.9', '3.10', '3.12'] + julia-version: ['1.10', '1'] + python-version: ['3.10', '3.12'] os: [ubuntu-latest, macos-latest, windows-latest] steps: diff --git a/environment.yml b/environment.yml index 840b6a1c..fbed19f6 100644 --- a/environment.yml +++ b/environment.yml @@ -2,11 +2,10 @@ name: test channels: - conda-forge dependencies: - - python>=3.9 + - python>=3.10 - sympy>=1.0.0,<2.0.0 - pandas>=0.21.0,<3.0.0 - numpy>=1.13.0,<2.0.0 - scikit-learn>=1.0.0,<2.0.0 - pyjuliacall>=0.9.21,<0.9.22 - click>=7.0.0,<9.0.0 - - typing-extensions>=4.0.0,<5.0.0 diff --git a/pyproject.toml b/pyproject.toml index c9ed895f..c3ed9622 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ authors = [ description = "Simple and efficient symbolic regression" readme = {file = "README.md", content-type = "text/markdown"} license = {file = "LICENSE"} -requires-python = ">=3.9" +requires-python = ">=3.10" classifiers = [ "Programming Language :: Python :: 3", "Operating System :: OS Independent", @@ -25,7 +25,6 @@ dependencies = [ "juliacall==0.9.23", "click>=7.0.0,<9.0.0", "setuptools>=50.0.0", - "typing-extensions>=4.0.0,<5.0.0", ] [project.optional-dependencies] diff --git a/pysr/denoising.py b/pysr/denoising.py index fbf17468..92a640ee 100644 --- a/pysr/denoising.py +++ b/pysr/denoising.py @@ -1,7 +1,5 @@ """Functions for denoising data during preprocessing.""" -from __future__ import annotations - from typing import cast import numpy as np diff --git a/pysr/export.py b/pysr/export.py index bc88b7e1..c1b589b8 100644 --- a/pysr/export.py +++ b/pysr/export.py @@ -1,12 +1,5 @@ -from __future__ import annotations - import copy -import sys - -if sys.version_info >= (3, 10): - from collections.abc import Callable -else: - from typing import Callable +from collections.abc import Callable import numpy as np import pandas as pd diff --git a/pysr/export_latex.py b/pysr/export_latex.py index f00fc48a..55d24de0 100644 --- a/pysr/export_latex.py +++ b/pysr/export_latex.py @@ -1,7 +1,5 @@ """Functions to help export PySR equations to LaTeX.""" -from __future__ import annotations - import pandas as pd import sympy # type: ignore from sympy.printing.latex import LatexPrinter # type: ignore diff --git a/pysr/export_numpy.py b/pysr/export_numpy.py index c6783498..163726d6 100644 --- a/pysr/export_numpy.py +++ b/pysr/export_numpy.py @@ -1,7 +1,5 @@ """Code for exporting discovered expressions to numpy""" -from __future__ import annotations - import warnings import numpy as np diff --git a/pysr/export_sympy.py b/pysr/export_sympy.py index 9f3112e8..ea54b01c 100644 --- a/pysr/export_sympy.py +++ b/pysr/export_sympy.py @@ -1,13 +1,6 @@ """Define utilities to export to sympy""" -from __future__ import annotations - -import sys - -if sys.version_info >= (3, 10): - from collections.abc import Callable -else: - from typing import Callable +from collections.abc import Callable import sympy # type: ignore from sympy import sympify diff --git a/pysr/expression_specs.py b/pysr/expression_specs.py index b7103d35..e8606478 100644 --- a/pysr/expression_specs.py +++ b/pysr/expression_specs.py @@ -1,14 +1,6 @@ -from __future__ import annotations - import copy -import sys from abc import ABC, abstractmethod -from typing import TYPE_CHECKING, Any, NewType - -if sys.version_info >= (3, 10): - from typing import TypeAlias -else: - from typing_extensions import TypeAlias +from typing import TYPE_CHECKING, Any, NewType, TypeAlias import numpy as np import pandas as pd diff --git a/pysr/feature_selection.py b/pysr/feature_selection.py index a0e4d207..8c8358fd 100644 --- a/pysr/feature_selection.py +++ b/pysr/feature_selection.py @@ -1,7 +1,5 @@ """Functions for doing feature selection during preprocessing.""" -from __future__ import annotations - from typing import cast import numpy as np diff --git a/pysr/julia_helpers.py b/pysr/julia_helpers.py index 917c4fd3..a93b6265 100644 --- a/pysr/julia_helpers.py +++ b/pysr/julia_helpers.py @@ -1,12 +1,6 @@ """Functions for initializing the Julia environment and installing deps.""" -import sys -from typing import Any, cast, overload - -if sys.version_info >= (3, 10): - from typing import Callable -else: - from collections.abc import Callable +from typing import Any, Callable, cast, overload import numpy as np from juliacall import convert as jl_convert # type: ignore diff --git a/pysr/sr.py b/pysr/sr.py index 6dc5169f..2c7d7653 100644 --- a/pysr/sr.py +++ b/pysr/sr.py @@ -1,7 +1,5 @@ """Define the PySRRegressor scikit-learn interface.""" -from __future__ import annotations - import copy import os import pickle as pkl @@ -9,17 +7,13 @@ import sys import tempfile import warnings +from collections.abc import Callable from dataclasses import dataclass, fields from io import StringIO from multiprocessing import cpu_count from pathlib import Path from typing import Any, Literal, cast -if sys.version_info >= (3, 10): - from collections.abc import Callable -else: - from typing import Callable - import numpy as np import pandas as pd from numpy import ndarray