Skip to content

Commit

Permalink
deps: require Python >= 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Nov 30, 2024
1 parent 147432b commit c5404f8
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 63 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
matrix:
python-version:
- '3.12'
- '3.9'
- '3.10'
os: ['ubuntu-latest']

steps:
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/CI_conda_forge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CI_docker_large_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CI_large_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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]
Expand Down
2 changes: 0 additions & 2 deletions pysr/denoising.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Functions for denoising data during preprocessing."""

from __future__ import annotations

from typing import cast

import numpy as np
Expand Down
9 changes: 1 addition & 8 deletions pysr/export.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions pysr/export_latex.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions pysr/export_numpy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Code for exporting discovered expressions to numpy"""

from __future__ import annotations

import warnings

import numpy as np
Expand Down
9 changes: 1 addition & 8 deletions pysr/export_sympy.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 1 addition & 9 deletions pysr/expression_specs.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions pysr/feature_selection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Functions for doing feature selection during preprocessing."""

from __future__ import annotations

from typing import cast

import numpy as np
Expand Down
8 changes: 1 addition & 7 deletions pysr/julia_helpers.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 1 addition & 7 deletions pysr/sr.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
"""Define the PySRRegressor scikit-learn interface."""

from __future__ import annotations

import copy
import os
import pickle as pkl
import re
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
Expand Down

0 comments on commit c5404f8

Please sign in to comment.