Skip to content

Commit e2303be

Browse files
authored
Merge pull request #935 from MilesCranmer/fix-beartype
fix: compat with python 3.8 by removing beartype
2 parents 03429bc + 3bd5fc8 commit e2303be

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ dependencies:
99
- scikit-learn>=1.0.0,<2.0.0
1010
- pyjuliacall>=0.9.24,<0.9.26
1111
- click>=7.0.0,<9.0.0
12-
- beartype>=0.19,<0.22
1312
- typing-extensions>=4.0.0,<5.0.0

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "pysr"
7-
version = "1.5.7"
7+
version = "1.5.8"
88
authors = [
99
{name = "Miles Cranmer", email = "miles.cranmer@gmail.com"},
1010
]
@@ -24,13 +24,13 @@ dependencies = [
2424
"scikit_learn>=1.0.0,<2.0.0",
2525
"juliacall>=0.9.24,<0.9.26",
2626
"click>=7.0.0,<9.0.0",
27-
"beartype>=0.19,<0.22",
2827
"typing-extensions>=4.0.0,<5.0.0",
2928
]
3029

3130
[project.optional-dependencies]
3231
dev = [
3332
"coverage>=7,<8",
33+
"beartype>=0.19,<0.22",
3434
"ipykernel>=6,<7",
3535
"ipython>=8,<9",
3636
"jax[cpu]>=0.4,<0.6",

pysr/sr.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import numpy as np
2121
import pandas as pd
22-
from beartype.typing import List
2322
from numpy import ndarray
2423
from numpy.typing import NDArray
2524
from sklearn.base import BaseEstimator, MultiOutputMixin, RegressorMixin
@@ -70,6 +69,12 @@
7069
except ImportError:
7170
OLD_SKLEARN = True
7271

72+
try:
73+
from typing import List
74+
except ImportError:
75+
from typing_extensions import List
76+
77+
7378
ALREADY_RAN = False
7479

7580
pysr_logger = logging.getLogger(__name__)

pysr/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66
from pathlib import Path
77
from typing import Any, TypeVar, Union
88

9-
from beartype.typing import List
109
from numpy import ndarray
1110
from sklearn.utils.validation import _check_feature_names_in # type: ignore
1211

12+
try:
13+
from typing import List
14+
except ImportError:
15+
from typing_extensions import List
16+
1317
T = TypeVar("T", bound=Any)
1418

1519
ArrayLike = Union[ndarray, List[T]]

0 commit comments

Comments
 (0)