From 572cd2e08340581f20457445421b1e5442272d65 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Sun, 6 Oct 2024 16:00:03 +0800 Subject: [PATCH 1/8] build with numpy2 --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 77d85ff41..2ca59b5b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = [ - # pin NumPy version used in the build - "numpy>=1.20.1, <2", + "numpy>=2.0.0", "setuptools>=43.0.0", ] build-backend = "setuptools.build_meta" From 317f84dcf37d98156228fc38168438aefa65d27b Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Sun, 6 Oct 2024 16:01:56 +0800 Subject: [PATCH 2/8] release np <2 pin for runtime dep --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c0e79f2de..7cc859eb6 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ def local_version(version): include_package_data=True, zip_safe=False, install_requires=[ - "numpy >= 1.23, < 2", + "numpy >= 1.23", "requests ~= 2.31", "pandas >= 1.5, < 3", "tqdm ~= 4.66", From b40f5ade30a017132743ca6587fa957903eefe8c Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Sun, 6 Oct 2024 16:06:06 +0800 Subject: [PATCH 3/8] TEST: force numpy 2 for test purpose --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7cc859eb6..6c28e5b27 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ def local_version(version): include_package_data=True, zip_safe=False, install_requires=[ - "numpy >= 1.23", + "numpy >= 2", "requests ~= 2.31", "pandas >= 1.5, < 3", "tqdm ~= 4.66", From 65859f7d78dd282949db59d4d74081ffcba2c1e1 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Sun, 6 Oct 2024 16:07:24 +0800 Subject: [PATCH 4/8] pytest only show 20 durations instead of ALL --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a370aa0e..d960bd4bc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -73,7 +73,7 @@ jobs: - name: Run tests run: | - python${{ matrix.python-version }} -m pytest --cov=matminer matminer --durations=0 --timeout=360 + python${{ matrix.python-version }} -m pytest --cov=matminer matminer --durations=20 --timeout=360 - name: Build package if: matrix.python-version == 3.9 From eaf7b802e6945db741c673f17c578a08c6928b81 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Sun, 6 Oct 2024 16:18:20 +0800 Subject: [PATCH 5/8] test NumPy 1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6c28e5b27..c0e79f2de 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ def local_version(version): include_package_data=True, zip_safe=False, install_requires=[ - "numpy >= 2", + "numpy >= 1.23, < 2", "requests ~= 2.31", "pandas >= 1.5, < 3", "tqdm ~= 4.66", From 69b32cece64341ee28f22811439c02d33c41d197 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Sun, 6 Oct 2024 19:15:20 +0800 Subject: [PATCH 6/8] test finished, remove np<2 pin --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c0e79f2de..7cc859eb6 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ def local_version(version): include_package_data=True, zip_safe=False, install_requires=[ - "numpy >= 1.23, < 2", + "numpy >= 1.23", "requests ~= 2.31", "pandas >= 1.5, < 3", "tqdm ~= 4.66", From 15ce8eebd5c62ea973e3339a0012706d41c4517c Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Sun, 6 Oct 2024 19:25:18 +0800 Subject: [PATCH 7/8] fix: DeprecationWarning: pkg_resources is deprecated as an API --- matminer/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/matminer/__init__.py b/matminer/__init__.py index 130045a66..61e7a1e54 100644 --- a/matminer/__init__.py +++ b/matminer/__init__.py @@ -1,9 +1,9 @@ """data mining materials properties""" -from pkg_resources import DistributionNotFound, get_distribution +from importlib.metadata import PackageNotFoundError, version try: - __version__ = get_distribution("matminer").version -except DistributionNotFound: # pragma: no cover + __version__ = version("matminer") +except PackageNotFoundError: # pragma: no cover # package is not installed pass From d02ad88ffe2586e481af8e827cefe580e7e1a95c Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Sun, 6 Oct 2024 19:57:49 +0800 Subject: [PATCH 8/8] remove numpy from build dependency --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2ca59b5b0..adbe3e6bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,5 @@ [build-system] requires = [ - "numpy>=2.0.0", "setuptools>=43.0.0", ] build-backend = "setuptools.build_meta"