Closed phofl closed 6 months ago
I also saw this when trying to investigate #921 .
We might need to wait for a conda-ready numpy 2 and dependencies like pandas.
@bnavigator , how did you manage to build fastparquet and run the tests?
import_array()
resulted in a the dreaded "size of dtype changed" exception.mamba create -n fastparquet python=3.11 mamba activate fastparquet pip install "numpy==2.0.0rc1" pip install fastparquet import fastparquet
Of course you have to compile fastparquet with numpy 2.0.0rc1, nut just install the older wheel from PyPI.
A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.0rc1 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0.
The logs in #921 is from the rpm build in https://build.opensuse.org/package/show/home:bnavigator:numpy/python-fastparquet, before I applied the fix from #922.
Here is a way to build fastparquet with numpy 2 and check in a plain venv:
bump-numpy.patch
diff --git a/pyproject.toml b/pyproject.toml
index fd80deb..61c1f63 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,2 +1,2 @@
[build-system]
-requires = ["setuptools", "wheel", "Cython >= 0.29.23", "oldest-supported-numpy", "pytest-runner"]
+requires = ["setuptools", "setuptools_scm", "Cython >= 0.29.23", "numpy>=2.0.0rc1"]
diff --git a/requirements.txt b/requirements.txt
index 384b66b..251278d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
pandas>=1.5.0
-numpy>=1.20.3
+numpy>=2.0.0rc1
cramjam>=2.3
fsspec
packaging
diff --git a/setup.py b/setup.py
index d3053c6..b07c16f 100644
--- a/setup.py
+++ b/setup.py
@@ -53,13 +53,6 @@ setup(
'local_scheme': 'no-local-version',
'write_to': 'fastparquet/_version.py'
},
- setup_requires=[
- 'setuptools>18.0',
- 'setuptools-scm>1.5.4',
- 'Cython',
- 'pytest-runner',
- 'oldest-supported-numpy'
- ],
description='Python support for Parquet file format',
author='Martin Durant',
author_email='mdurant@anaconda.com',
git clone https://github.com/dask/fastparquet.git
cd fastparquet
patch -p1 < ../bump-numpy.patch
pip wheel -v .
cd ..
python3 -m venv fp_np2
fp_np2/bin/python3 -m pip install fastparquet/fastparquet-2024.2.1.dev1-*.whl
fp_np2/bin/python3
Python 3.11.9 (main, Apr 08 2024, 06:18:15) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fastparquet
>>> import numpy
>>> numpy.__version__
'2.0.0rc1'
>>> fastparquet.__version__
'2024.2.1.dev1'
>>>
Ah
- 'oldest-supported-numpy'
of course ...
Thanks, @bnavigator , I can build and run the test suite like that and see the failures you fixed in the other PR (I still get warnings on import).
Is, then, the recommendation to build a new set of wheels for release built with the rc1, and expect these should work with older numpy too?
Is, then, the recommendation to build a new set of wheels for release built with the rc1, and expect these should work with older numpy too?
Exactly: https://numpy.org/devdocs/dev/depending_on_numpy.html#numpy-2-0-specific-advice
Describe the issue:
Minimal Complete Verifiable Example:
Anything else we need to know?:
Environment: