Skip to content

Commit bb18847

Browse files
authored
DEP: Bump pytest, xdist, hypothesis (#50481)
* DEP: Bump pytest, xdist, hypothesis * forgot one item * Ensure only hypothesis and pytest and checked aligned * Use conda forge
1 parent 35ce27a commit bb18847

19 files changed

+64
-55
lines changed

.github/workflows/32-bit-linux.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
. ~/virtualenvs/pandas-dev/bin/activate && \
4040
python -m pip install --no-deps -U pip wheel 'setuptools<60.0.0' && \
4141
python -m pip install versioneer[toml] && \
42-
python -m pip install cython numpy python-dateutil pytz pytest pytest-xdist pytest-asyncio>=0.17 hypothesis && \
42+
python -m pip install cython numpy python-dateutil pytz pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.34.2 && \
4343
python setup.py build_ext -q -j1 && \
4444
python -m pip install --no-build-isolation --no-use-pep517 -e . && \
4545
python -m pip list && \

.github/workflows/python-dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
python -m pip install --extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
7777
python -m pip install git+https://github.com/nedbat/coveragepy.git
7878
python -m pip install versioneer[toml]
79-
python -m pip install python-dateutil pytz cython hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-cov pytest-asyncio>=0.17
79+
python -m pip install python-dateutil pytz cython hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-cov pytest-asyncio>=0.17
8080
python -m pip list
8181
8282
# GH 47305: Parallel build can cause flaky ImportError from pandas/_libs/tslibs

.github/workflows/wheels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168
# (1. Generate sdist 2. Build wheels from sdist)
169169
# This tests the sdists, and saves some build time
170170
python -m pip install dist/*.gz
171-
pip install hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-asyncio>=0.17
171+
pip install hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17
172172
cd .. # Not a good idea to test within the src tree
173173
python -c "import pandas; print(pandas.__version__);
174174
pandas.test(extra_args=['-m not clipboard and not single_cpu', '--skip-slow', '--skip-network', '--skip-db', '-n=2']);

ci/deps/actions-310-numpydev.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
name: pandas-dev
22
channels:
3-
- defaults
3+
- conda-forge
44
dependencies:
55
- python=3.10
66

77
# build dependencies
88
- versioneer[toml]
99

1010
# test dependencies
11-
- pytest>=6.0
11+
- pytest>=7.0.0
1212
- pytest-cov
13-
- pytest-xdist>=1.31
14-
- hypothesis>=5.5.3
13+
- pytest-xdist>=2.2.0
14+
- hypothesis>=6.34.2
1515
- pytest-asyncio>=0.17
1616

1717
# pandas dependencies

ci/deps/actions-310.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ dependencies:
99
- cython>=0.29.32
1010

1111
# test dependencies
12-
- pytest>=6.0
12+
- pytest>=7.0.0
1313
- pytest-cov
14-
- pytest-xdist>=1.31
14+
- pytest-xdist>=2.2.0
1515
- psutil
1616
- pytest-asyncio>=0.17
1717
- boto3

ci/deps/actions-38-downstream_compat.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ dependencies:
1010
- cython>=0.29.32
1111

1212
# test dependencies
13-
- pytest>=6.0
13+
- pytest>=7.0.0
1414
- pytest-cov
15-
- pytest-xdist>=1.31
15+
- pytest-xdist>=2.2.0
1616
- psutil
1717
- pytest-asyncio>=0.17
1818
- boto3

ci/deps/actions-38-minimum_versions.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ dependencies:
1111
- cython>=0.29.32
1212

1313
# test dependencies
14-
- pytest>=6.0
14+
- pytest>=7.0.0
1515
- pytest-cov
16-
- pytest-xdist>=1.31
16+
- pytest-xdist>=2.2.0
1717
- psutil
1818
- pytest-asyncio>=0.17
1919
- boto3
@@ -31,7 +31,7 @@ dependencies:
3131
- fastparquet=0.6.3
3232
- fsspec=2021.07.0
3333
- html5lib=1.1
34-
- hypothesis=6.13.0
34+
- hypothesis=6.34.2
3535
- gcsfs=2021.07.0
3636
- jinja2=3.0.0
3737
- lxml=4.6.3

ci/deps/actions-38.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ dependencies:
99
- cython>=0.29.32
1010

1111
# test dependencies
12-
- pytest>=6.0
12+
- pytest>=7.0.0
1313
- pytest-cov
14-
- pytest-xdist>=1.31
14+
- pytest-xdist>=2.2.0
1515
- psutil
1616
- pytest-asyncio>=0.17
1717
- boto3

ci/deps/actions-39.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ dependencies:
99
- cython>=0.29.32
1010

1111
# test dependencies
12-
- pytest>=6.0
12+
- pytest>=7.0.0
1313
- pytest-cov
14-
- pytest-xdist>=1.31
14+
- pytest-xdist>=2.2.0
1515
- psutil
1616
- pytest-asyncio>=0.17
1717
- boto3

ci/deps/actions-pypy-38.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ dependencies:
1212
- cython>=0.29.32
1313

1414
# test dependencies
15-
- pytest>=6.0
15+
- pytest>=7.0.0
1616
- pytest-cov
1717
- pytest-asyncio
18-
- pytest-xdist>=1.31
19-
- hypothesis>=5.5.3
18+
- pytest-xdist>=2.2.0
19+
- hypothesis>=6.34.2
2020

2121
# required
2222
- numpy<1.24

ci/deps/circle-38-arm64.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ dependencies:
99
- cython>=0.29.32
1010

1111
# test dependencies
12-
- pytest>=6.0
12+
- pytest>=7.0.0
1313
- pytest-cov
14-
- pytest-xdist>=1.31
14+
- pytest-xdist>=2.2.0
1515
- psutil
1616
- pytest-asyncio>=0.17
1717
- boto3

ci/test_wheels_windows.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ pd.test(extra_args=['-m not clipboard and single_cpu', '--skip-slow', '--skip-ne
44

55
python --version
66
pip install pytz six numpy python-dateutil
7-
pip install hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-asyncio>=0.17
7+
pip install hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17
88
pip install --find-links=pandas/dist --no-index pandas
9-
python -c "%test_command%"
9+
python -c "%test_command%"

doc/source/getting_started/install.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ pandas is equipped with an exhaustive set of unit tests, covering about 97% of
208208
the code base as of this writing. To run it on your machine to verify that
209209
everything is working (and that you have all of the dependencies, soft and hard,
210210
installed), make sure you have `pytest
211-
<https://docs.pytest.org/en/latest/>`__ >= 6.0 and `Hypothesis
212-
<https://hypothesis.readthedocs.io/en/latest/>`__ >= 6.13.0, then run:
211+
<https://docs.pytest.org/en/latest/>`__ >= 7.0 and `Hypothesis
212+
<https://hypothesis.readthedocs.io/en/latest/>`__ >= 6.34.2, then run:
213213

214214
::
215215

doc/source/whatsnew/v2.0.0.rst

+13-7
Original file line numberDiff line numberDiff line change
@@ -447,13 +447,19 @@ Increased minimum versions for dependencies
447447
Some minimum supported versions of dependencies were updated.
448448
If installed, we now require:
449449

450-
+-----------------+-----------------+----------+---------+
451-
| Package | Minimum Version | Required | Changed |
452-
+=================+=================+==========+=========+
453-
| mypy (dev) | 0.991 | | X |
454-
+-----------------+-----------------+----------+---------+
455-
| python-dateutil | 2.8.2 | X | X |
456-
+-----------------+-----------------+----------+---------+
450+
+-------------------+-----------------+----------+---------+
451+
| Package | Minimum Version | Required | Changed |
452+
+===================+=================+==========+=========+
453+
| mypy (dev) | 0.991 | | X |
454+
+-------------------+-----------------+----------+---------+
455+
| pytest (dev) | 7.0.0 | | X |
456+
+-------------------+-----------------+----------+---------+
457+
| pytest-xdist (dev)| 2.2.0 | | X |
458+
+-------------------+-----------------+----------+---------+
459+
| hypothesis (dev) | 6.34.2 | | X |
460+
+-------------------+-----------------+----------+---------+
461+
| python-dateutil | 2.8.2 | X | X |
462+
+-------------------+-----------------+----------+---------+
457463

458464
For `optional libraries <https://pandas.pydata.org/docs/getting_started/install.html>`_ the general recommendation is to use the latest version.
459465
The following table lists the lowest version per library that is currently being tested throughout the development of pandas.

environment.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ dependencies:
1111
- cython=0.29.32
1212

1313
# test dependencies
14-
- pytest>=6.0
14+
- pytest>=7.0.0
1515
- pytest-cov
16-
- pytest-xdist>=1.31
16+
- pytest-xdist>=2.2.0
1717
- psutil
1818
- pytest-asyncio>=0.17
1919
- coverage

pandas/compat/_optional.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"fastparquet": "0.6.3",
2020
"fsspec": "2021.07.0",
2121
"html5lib": "1.1",
22-
"hypothesis": "6.13.0",
22+
"hypothesis": "6.34.2",
2323
"gcsfs": "2021.07.0",
2424
"jinja2": "3.0.0",
2525
"lxml.etree": "4.6.3",
@@ -33,7 +33,7 @@
3333
"pymysql": "1.0.2",
3434
"pyarrow": "6.0.0",
3535
"pyreadstat": "1.1.2",
36-
"pytest": "6.0",
36+
"pytest": "7.0.0",
3737
"pyxlsb": "1.0.8",
3838
"s3fs": "2021.08.0",
3939
"scipy": "1.7.1",

pyproject.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ repository = 'https://github.com/pandas-dev/pandas'
5555
matplotlib = "pandas:plotting._matplotlib"
5656

5757
[project.optional-dependencies]
58-
test = ['hypothesis>=5.5.3', 'pytest>=6.0', 'pytest-xdist>=1.31', 'pytest-asyncio>=0.17.0']
58+
test = ['hypothesis>=6.34.2', 'pytest>=7.0.0', 'pytest-xdist>=2.2.0', 'pytest-asyncio>=0.17.0']
5959
performance = ['bottleneck>=1.3.2', 'numba>=0.53.1', 'numexpr>=2.7.1']
6060
timezone = ['tzdata>=2022.1']
6161
computation = ['scipy>=1.7.1', 'xarray>=0.21.0']
@@ -87,7 +87,7 @@ all = ['beautifulsoup4>=4.9.3',
8787
'fsspec>=2021.07.0',
8888
'gcsfs>=2021.07.0',
8989
'html5lib>=1.1',
90-
'hypothesis>=6.13.0',
90+
'hypothesis>=6.34.2',
9191
'jinja2>=3.0.0',
9292
'lxml>=4.6.3',
9393
'matplotlib>=3.6.1',
@@ -101,8 +101,8 @@ all = ['beautifulsoup4>=4.9.3',
101101
'pymysql>=1.0.2',
102102
'PyQt5>=5.15.1',
103103
'pyreadstat>=1.1.2',
104-
'pytest>=6.0',
105-
'pytest-xdist>=1.31',
104+
'pytest>=7.0.0',
105+
'pytest-xdist>=2.2.0',
106106
'pytest-asyncio>=0.17.0',
107107
'python-snappy>=0.6.0',
108108
'pyxlsb>=1.0.8',
@@ -143,7 +143,7 @@ parentdir_prefix = "pandas-"
143143
[tool.cibuildwheel]
144144
skip = "cp36-* cp37-* pp37-* *-manylinux_i686 *_ppc64le *_s390x *-musllinux*"
145145
build-verbosity = "3"
146-
test-requires = "hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-asyncio>=0.17"
146+
test-requires = "hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17"
147147
test-command = "python {project}/ci/test_wheels.py"
148148

149149
[tool.cibuildwheel.macos]

requirements-dev.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
pip
55
versioneer[toml]
66
cython==0.29.32
7-
pytest>=6.0
7+
pytest>=7.0.0
88
pytest-cov
9-
pytest-xdist>=1.31
9+
pytest-xdist>=2.2.0
1010
psutil
1111
pytest-asyncio>=0.17
1212
coverage

scripts/validate_min_versions_in_sync.py

+13-10
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,26 @@ def get_versions_from_code() -> dict[str, str]:
4747
versions = _optional.VERSIONS
4848
for item in EXCLUDE_DEPS:
4949
versions.pop(item, None)
50-
return {
51-
install_map.get(k, k).casefold(): v
52-
for k, v in versions.items()
53-
if k != "pytest"
54-
}
50+
return {install_map.get(k, k).casefold(): v for k, v in versions.items()}
5551

5652

5753
def get_versions_from_ci(content: list[str]) -> tuple[dict[str, str], dict[str, str]]:
5854
"""Min versions in CI job for testing all optional dependencies."""
5955
# Don't parse with pyyaml because it ignores comments we're looking for
6056
seen_required = False
6157
seen_optional = False
58+
seen_test = False
6259
required_deps = {}
6360
optional_deps = {}
6461
for line in content:
65-
if "# required dependencies" in line:
62+
if "# test dependencies" in line:
63+
seen_test = True
64+
elif seen_test and "- pytest>=" in line:
65+
# Only grab pytest
66+
package, version = line.strip().split(">=")
67+
package = package[2:]
68+
optional_deps[package.casefold()] = version
69+
elif "# required dependencies" in line:
6670
seen_required = True
6771
elif "# optional dependencies" in line:
6872
seen_optional = True
@@ -87,17 +91,16 @@ def get_versions_from_ci(content: list[str]) -> tuple[dict[str, str], dict[str,
8791
def get_versions_from_toml() -> dict[str, str]:
8892
"""Min versions in pyproject.toml for pip install pandas[extra]."""
8993
install_map = _optional.INSTALL_MAPPING
90-
dependencies = set()
9194
optional_dependencies = {}
9295

9396
with open(SETUP_PATH, "rb") as pyproject_f:
9497
pyproject_toml = tomllib.load(pyproject_f)
9598
opt_deps = pyproject_toml["project"]["optional-dependencies"]
9699
dependencies = set(opt_deps["all"])
97100

98-
# remove test dependencies
99-
test_deps = set(opt_deps["test"])
100-
dependencies = dependencies.difference(test_deps)
101+
# remove pytest plugin dependencies
102+
pytest_plugins = {dep for dep in opt_deps["test"] if dep.startswith("pytest-")}
103+
dependencies = dependencies.difference(pytest_plugins)
101104

102105
for dependency in dependencies:
103106
package, version = dependency.strip().split(">=")

0 commit comments

Comments
 (0)