Skip to content

DEP: Bump pytest, xdist, hypothesis #50481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/32-bit-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
. ~/virtualenvs/pandas-dev/bin/activate && \
python -m pip install --no-deps -U pip wheel 'setuptools<60.0.0' && \
python -m pip install versioneer[toml] && \
python -m pip install cython numpy python-dateutil pytz pytest pytest-xdist pytest-asyncio>=0.17 hypothesis && \
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 && \
python setup.py build_ext -q -j1 && \
python -m pip install --no-build-isolation --no-use-pep517 -e . && \
python -m pip list && \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
python -m pip install git+https://github.com/nedbat/coveragepy.git
python -m pip install versioneer[toml]
python -m pip install python-dateutil pytz cython hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-cov pytest-asyncio>=0.17
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
python -m pip list

# GH 47305: Parallel build can cause flaky ImportError from pandas/_libs/tslibs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ jobs:
# (1. Generate sdist 2. Build wheels from sdist)
# This tests the sdists, and saves some build time
python -m pip install dist/*.gz
pip install hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-asyncio>=0.17
pip install hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17
cd .. # Not a good idea to test within the src tree
python -c "import pandas; print(pandas.__version__);
pandas.test(extra_args=['-m not clipboard and not single_cpu', '--skip-slow', '--skip-network', '--skip-db', '-n=2']);
Expand Down
8 changes: 4 additions & 4 deletions ci/deps/actions-310-numpydev.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: pandas-dev
channels:
- defaults
- conda-forge
dependencies:
- python=3.10

# build dependencies
- versioneer[toml]

# test dependencies
- pytest>=6.0
- pytest>=7.0.0
- pytest-cov
- pytest-xdist>=1.31
- hypothesis>=5.5.3
- pytest-xdist>=2.2.0
- hypothesis>=6.34.2
- pytest-asyncio>=0.17

# pandas dependencies
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-310.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ dependencies:
- cython>=0.29.32

# test dependencies
- pytest>=6.0
- pytest>=7.0.0
- pytest-cov
- pytest-xdist>=1.31
- pytest-xdist>=2.2.0
- psutil
- pytest-asyncio>=0.17
- boto3
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-38-downstream_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ dependencies:
- cython>=0.29.32

# test dependencies
- pytest>=6.0
- pytest>=7.0.0
- pytest-cov
- pytest-xdist>=1.31
- pytest-xdist>=2.2.0
- psutil
- pytest-asyncio>=0.17
- boto3
Expand Down
6 changes: 3 additions & 3 deletions ci/deps/actions-38-minimum_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ dependencies:
- cython>=0.29.32

# test dependencies
- pytest>=6.0
- pytest>=7.0.0
- pytest-cov
- pytest-xdist>=1.31
- pytest-xdist>=2.2.0
- psutil
- pytest-asyncio>=0.17
- boto3
Expand All @@ -31,7 +31,7 @@ dependencies:
- fastparquet=0.6.3
- fsspec=2021.07.0
- html5lib=1.1
- hypothesis=6.13.0
- hypothesis=6.34.2
- gcsfs=2021.07.0
- jinja2=3.0.0
- lxml=4.6.3
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ dependencies:
- cython>=0.29.32

# test dependencies
- pytest>=6.0
- pytest>=7.0.0
- pytest-cov
- pytest-xdist>=1.31
- pytest-xdist>=2.2.0
- psutil
- pytest-asyncio>=0.17
- boto3
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ dependencies:
- cython>=0.29.32

# test dependencies
- pytest>=6.0
- pytest>=7.0.0
- pytest-cov
- pytest-xdist>=1.31
- pytest-xdist>=2.2.0
- psutil
- pytest-asyncio>=0.17
- boto3
Expand Down
6 changes: 3 additions & 3 deletions ci/deps/actions-pypy-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ dependencies:
- cython>=0.29.32

# test dependencies
- pytest>=6.0
- pytest>=7.0.0
- pytest-cov
- pytest-asyncio
- pytest-xdist>=1.31
- hypothesis>=5.5.3
- pytest-xdist>=2.2.0
- hypothesis>=6.34.2

# required
- numpy<1.24
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/circle-38-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ dependencies:
- cython>=0.29.32

# test dependencies
- pytest>=6.0
- pytest>=7.0.0
- pytest-cov
- pytest-xdist>=1.31
- pytest-xdist>=2.2.0
- psutil
- pytest-asyncio>=0.17
- boto3
Expand Down
4 changes: 2 additions & 2 deletions ci/test_wheels_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ pd.test(extra_args=['-m not clipboard and single_cpu', '--skip-slow', '--skip-ne

python --version
pip install pytz six numpy python-dateutil
pip install hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-asyncio>=0.17
pip install hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17
pip install --find-links=pandas/dist --no-index pandas
python -c "%test_command%"
python -c "%test_command%"
4 changes: 2 additions & 2 deletions doc/source/getting_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ pandas is equipped with an exhaustive set of unit tests, covering about 97% of
the code base as of this writing. To run it on your machine to verify that
everything is working (and that you have all of the dependencies, soft and hard,
installed), make sure you have `pytest
<https://docs.pytest.org/en/latest/>`__ >= 6.0 and `Hypothesis
<https://hypothesis.readthedocs.io/en/latest/>`__ >= 6.13.0, then run:
<https://docs.pytest.org/en/latest/>`__ >= 7.0 and `Hypothesis
<https://hypothesis.readthedocs.io/en/latest/>`__ >= 6.34.2, then run:

::

Expand Down
20 changes: 13 additions & 7 deletions doc/source/whatsnew/v2.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,19 @@ Increased minimum versions for dependencies
Some minimum supported versions of dependencies were updated.
If installed, we now require:

+-----------------+-----------------+----------+---------+
| Package | Minimum Version | Required | Changed |
+=================+=================+==========+=========+
| mypy (dev) | 0.991 | | X |
+-----------------+-----------------+----------+---------+
| python-dateutil | 2.8.2 | X | X |
+-----------------+-----------------+----------+---------+
+-------------------+-----------------+----------+---------+
| Package | Minimum Version | Required | Changed |
+===================+=================+==========+=========+
| mypy (dev) | 0.991 | | X |
+-------------------+-----------------+----------+---------+
| pytest (dev) | 7.0.0 | | X |
+-------------------+-----------------+----------+---------+
| pytest-xdist (dev)| 2.2.0 | | X |
+-------------------+-----------------+----------+---------+
| hypothesis (dev) | 6.34.2 | | X |
+-------------------+-----------------+----------+---------+
| python-dateutil | 2.8.2 | X | X |
+-------------------+-----------------+----------+---------+

For `optional libraries <https://pandas.pydata.org/docs/getting_started/install.html>`_ the general recommendation is to use the latest version.
The following table lists the lowest version per library that is currently being tested throughout the development of pandas.
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ dependencies:
- cython=0.29.32

# test dependencies
- pytest>=6.0
- pytest>=7.0.0
- pytest-cov
- pytest-xdist>=1.31
- pytest-xdist>=2.2.0
- psutil
- pytest-asyncio>=0.17
- coverage
Expand Down
4 changes: 2 additions & 2 deletions pandas/compat/_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"fastparquet": "0.6.3",
"fsspec": "2021.07.0",
"html5lib": "1.1",
"hypothesis": "6.13.0",
"hypothesis": "6.34.2",
"gcsfs": "2021.07.0",
"jinja2": "3.0.0",
"lxml.etree": "4.6.3",
Expand All @@ -33,7 +33,7 @@
"pymysql": "1.0.2",
"pyarrow": "6.0.0",
"pyreadstat": "1.1.2",
"pytest": "6.0",
"pytest": "7.0.0",
"pyxlsb": "1.0.8",
"s3fs": "2021.08.0",
"scipy": "1.7.1",
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ repository = 'https://github.com/pandas-dev/pandas'
matplotlib = "pandas:plotting._matplotlib"

[project.optional-dependencies]
test = ['hypothesis>=5.5.3', 'pytest>=6.0', 'pytest-xdist>=1.31', 'pytest-asyncio>=0.17.0']
test = ['hypothesis>=6.34.2', 'pytest>=7.0.0', 'pytest-xdist>=2.2.0', 'pytest-asyncio>=0.17.0']
performance = ['bottleneck>=1.3.2', 'numba>=0.53.1', 'numexpr>=2.7.1']
timezone = ['tzdata>=2022.1']
computation = ['scipy>=1.7.1', 'xarray>=0.21.0']
Expand Down Expand Up @@ -87,7 +87,7 @@ all = ['beautifulsoup4>=4.9.3',
'fsspec>=2021.07.0',
'gcsfs>=2021.07.0',
'html5lib>=1.1',
'hypothesis>=6.13.0',
'hypothesis>=6.34.2',
'jinja2>=3.0.0',
'lxml>=4.6.3',
'matplotlib>=3.6.1',
Expand All @@ -101,8 +101,8 @@ all = ['beautifulsoup4>=4.9.3',
'pymysql>=1.0.2',
'PyQt5>=5.15.1',
'pyreadstat>=1.1.2',
'pytest>=6.0',
'pytest-xdist>=1.31',
'pytest>=7.0.0',
'pytest-xdist>=2.2.0',
'pytest-asyncio>=0.17.0',
'python-snappy>=0.6.0',
'pyxlsb>=1.0.8',
Expand Down Expand Up @@ -143,7 +143,7 @@ parentdir_prefix = "pandas-"
[tool.cibuildwheel]
skip = "cp36-* cp37-* pp37-* *-manylinux_i686 *_ppc64le *_s390x *-musllinux*"
build-verbosity = "3"
test-requires = "hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-asyncio>=0.17"
test-requires = "hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17"
test-command = "python {project}/ci/test_wheels.py"

[tool.cibuildwheel.macos]
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
pip
versioneer[toml]
cython==0.29.32
pytest>=6.0
pytest>=7.0.0
pytest-cov
pytest-xdist>=1.31
pytest-xdist>=2.2.0
psutil
pytest-asyncio>=0.17
coverage
Expand Down
23 changes: 13 additions & 10 deletions scripts/validate_min_versions_in_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,26 @@ def get_versions_from_code() -> dict[str, str]:
versions = _optional.VERSIONS
for item in EXCLUDE_DEPS:
versions.pop(item, None)
return {
install_map.get(k, k).casefold(): v
for k, v in versions.items()
if k != "pytest"
}
return {install_map.get(k, k).casefold(): v for k, v in versions.items()}


def get_versions_from_ci(content: list[str]) -> tuple[dict[str, str], dict[str, str]]:
"""Min versions in CI job for testing all optional dependencies."""
# Don't parse with pyyaml because it ignores comments we're looking for
seen_required = False
seen_optional = False
seen_test = False
required_deps = {}
optional_deps = {}
for line in content:
if "# required dependencies" in line:
if "# test dependencies" in line:
seen_test = True
elif seen_test and "- pytest>=" in line:
# Only grab pytest
package, version = line.strip().split(">=")
package = package[2:]
optional_deps[package.casefold()] = version
elif "# required dependencies" in line:
seen_required = True
elif "# optional dependencies" in line:
seen_optional = True
Expand All @@ -87,17 +91,16 @@ def get_versions_from_ci(content: list[str]) -> tuple[dict[str, str], dict[str,
def get_versions_from_toml() -> dict[str, str]:
"""Min versions in pyproject.toml for pip install pandas[extra]."""
install_map = _optional.INSTALL_MAPPING
dependencies = set()
optional_dependencies = {}

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

# remove test dependencies
test_deps = set(opt_deps["test"])
dependencies = dependencies.difference(test_deps)
# remove pytest plugin dependencies
pytest_plugins = {dep for dep in opt_deps["test"] if dep.startswith("pytest-")}
dependencies = dependencies.difference(pytest_plugins)

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