11
11
Final ,
12
12
)
13
13
14
- from packaging .version import parse
15
14
import pandas as pd
15
+ from pandas .util .version import Version
16
16
import pytest
17
17
18
18
from pandas ._typing import T
19
19
20
20
TYPE_CHECKING_INVALID_USAGE : Final = TYPE_CHECKING
21
21
WINDOWS = os .name == "nt" or "cygwin" in platform .system ().lower ()
22
- PD_LTE_15 = parse (pd .__version__ ) < parse ("1.5.999" )
22
+ PD_LTE_15 = Version (pd .__version__ ) < Version ("1.5.999" )
23
23
24
24
25
25
def check (actual : T , klass : type , dtype : type | None = None , attr : str = "left" ) -> T :
@@ -46,7 +46,7 @@ def pytest_warns_bounded(
46
46
upper : str | None = None ,
47
47
) -> AbstractContextManager :
48
48
"""
49
- Version conditional pytet .warns context manager
49
+ Version conditional pytest .warns context manager
50
50
51
51
Returns a context manager that will raise an error if
52
52
the warning is not issued when pandas version is
@@ -86,9 +86,9 @@ def pytest_warns_bounded(
86
86
# Versions between 1.3.x and 1.5.x will raise an error
87
87
pass
88
88
"""
89
- lb = parse ("0.0.0" ) if lower is None else parse (lower )
90
- ub = parse ("9999.0.0" ) if upper is None else parse (upper )
91
- current = parse (pd .__version__ )
89
+ lb = Version ("0.0.0" ) if lower is None else Version (lower )
90
+ ub = Version ("9999.0.0" ) if upper is None else Version (upper )
91
+ current = Version (pd .__version__ )
92
92
if lb < current < ub :
93
93
return pytest .warns (warning , match = match )
94
94
else :
0 commit comments