From b510f2e2f2a4c893a2e9761b8de3ffbdda917024 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Sun, 23 Jun 2024 17:31:24 -0700 Subject: [PATCH] Fixes for new dependencies --- .github/workflows/main.yml | 3 ++- hypothesis-python/tests/pandas/test_indexes.py | 5 +++-- tooling/src/hypothesistooling/__main__.py | 2 +- whole_repo_tests/revealed_types.py | 9 ++++++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 292360ccdd..90beb7fd9a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -165,6 +165,7 @@ jobs: if: matrix.python.architecture # See https://github.com/pandas-dev/pandas/issues/54979 run: | + (Get-Content .\requirements\coverage.txt) -replace 'numpy==[0-9.]+', 'numpy==1.26.4' | Out-File .\requirements\coverage.txt (Get-Content .\requirements\coverage.txt) -replace 'pandas==[0-9.]+', 'pandas==2.0.3' | Out-File .\requirements\coverage.txt (Get-Content .\requirements\coverage.txt) -replace 'pyarrow==[0-9.]+', '# omitted' | Out-File .\requirements\coverage.txt - name: Install dependencies @@ -235,7 +236,7 @@ jobs: actions-cache-folder: emsdk-cache - name: Build run: | - pip install "pydantic<2" pyodide-build==$PYODIDE_VERSION + pip install pyodide-build==$PYODIDE_VERSION cd hypothesis-python/ CFLAGS=-g2 LDFLAGS=-g2 pyodide build - name: Set up Pyodide venv and install dependencies diff --git a/hypothesis-python/tests/pandas/test_indexes.py b/hypothesis-python/tests/pandas/test_indexes.py index 5680e4ad93..e1a4a083d7 100644 --- a/hypothesis-python/tests/pandas/test_indexes.py +++ b/hypothesis-python/tests/pandas/test_indexes.py @@ -27,9 +27,10 @@ def test_gets_right_dtype_for_empty_indices(ix): is_32bit = sys.maxsize == 2**31 - 1 pandas2 = pandas.__version__.startswith("2.") + numpy1 = np.__version__.startswith("1.") windows = sys.platform == "win32" # including 64-bit windows, confusingly - if pandas2 and (is_32bit or windows): - # No, I don't know what this is int32 on 64-bit windows, but here we are. + if pandas2 and (is_32bit or (windows and numpy1)): + # No, I don't know what this is int32 on 64-bit windows until Numpy 2.0 assert ix.dtype == np.dtype("int32") else: assert ix.dtype == np.dtype("int64") diff --git a/tooling/src/hypothesistooling/__main__.py b/tooling/src/hypothesistooling/__main__.py index 932818c36f..dd008a5fa2 100644 --- a/tooling/src/hypothesistooling/__main__.py +++ b/tooling/src/hypothesistooling/__main__.py @@ -436,7 +436,7 @@ def run_tox(task, version, *args): "3.10": "3.10.14", "3.11": "3.11.9", "3.12": "3.12.3", - "3.13": "3.13.0b1", + "3.13": "3.13.0b2", "3.14": "3.14-dev", "pypy3.8": "pypy3.8-7.3.11", "pypy3.9": "pypy3.9-7.3.16", diff --git a/whole_repo_tests/revealed_types.py b/whole_repo_tests/revealed_types.py index 31cfc7f42d..c78f3da6bc 100644 --- a/whole_repo_tests/revealed_types.py +++ b/whole_repo_tests/revealed_types.py @@ -8,6 +8,13 @@ # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. +try: + from numpy import __version__ as np_version +except ImportError: + NP1 = False +else: + NP1 = np_version.startswith("1.") + REVEALED_TYPES = [ ("integers()", "int"), ("text()", "str"), @@ -37,7 +44,7 @@ ), ( "boolean_dtypes()", - "dtype[bool_]", + "dtype[bool_]" if NP1 else "dtype[bool]", ), ( "unsigned_integer_dtypes(sizes=8)",