Skip to content

Commit

Permalink
MAINT: NumPy 2.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
inoelloc committed Jun 19, 2024
1 parent a5eec31 commit 1299348
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ please contact James Kermode <[email protected]>
Dependencies
------------

1. [Python](http://www.python.org) 3.7+ (Python 2.7 no longer supported)
1. [Python](http://www.python.org) 3.8+ (Python 2.7 no longer supported)
2. Recent version of [numpy](http://www.numpy.org) which includes `f2py`
3. Fortran compiler - tested with `gfortran` 4.6+ and recent `ifort` 12+

Expand Down
4 changes: 2 additions & 2 deletions examples/optional_string/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ def test_string_in_1(self):
m_string_test.string_in('yo')

def test_string_in_2(self):
m_string_test.string_in(np.unicode_('yo'))
m_string_test.string_in(np.str_('yo'))

def test_string_in_3(self):
m_string_test.string_in(np.string_('yo'))
m_string_test.string_in(np.bytes_('yo'))

def test_string_to_string(self):
in_string = 'yo'
Expand Down
2 changes: 1 addition & 1 deletion f90wrap/scripts/f2py_f90wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def main():
if(sys.platform == 'win32'):
includes_inject = includes_inject + "#include <signal.h> // fix https://github.com/jameskermode/f90wrap/issues/73 \n#include <setjmpex.h> // fix https://github.com/jameskermode/f90wrap/issues/96\n"
else:
includes_inject = includes_inject + "#include <setjmp.h>\n"
includes_inject = includes_inject + "#include <signal.h>\n#include <setjmp.h>\n"

includes_inject = includes_inject + """
#define ABORT_BUFFER_SIZE 1024
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = ["meson-python>=0.12.0", "oldest-supported-numpy"]
requires = [
"meson-python>=0.12.0",
"oldest-supported-numpy; python_version=='3.8'",
"numpy>=2.0.0; python_version>='3.9'",
]
build-backend = 'mesonpy'

[project]
name = "f90wrap"
description = "Fortran to Python interface generator with derived type support"
authors = [{name = "James Kermode", email = "[email protected]"}]
python-requires = ">=3.6"
python-requires = ">=3.8"
urls = {Homepage = "https://github.com/jameskermode/f90wrap"}
dependencies = ["numpy>=1.13", "packaging"]
dynamic = ["version"]
Expand Down

0 comments on commit 1299348

Please sign in to comment.