Skip to content

Commit

Permalink
Support NumPy 2 (#949)
Browse files Browse the repository at this point in the history
* build with numpy2

* release np <2 pin for runtime dep

* TEST: force numpy 2 for test purpose

* pytest only show 20 durations instead of ALL

* test NumPy 1

* test finished, remove np<2 pin

* fix: DeprecationWarning: pkg_resources is deprecated as an API

* remove numpy from build dependency
  • Loading branch information
DanielYang59 authored Oct 6, 2024
1 parent 6df36ea commit cc3573b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions matminer/__init__.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
[build-system]
requires = [
# pin NumPy version used in the build
"numpy>=1.20.1, <2",
"setuptools>=43.0.0",
]
build-backend = "setuptools.build_meta"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit cc3573b

Please sign in to comment.