Skip to content

Fix: numpy version for python 3.11 #839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ requires = [
"numpy==1.19.3; python_version=='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'",
"numpy==1.21.2; python_version=='3.10' and platform_system!='Darwin'",
"numpy==1.21.4; python_version=='3.10' and platform_system=='Darwin'",
"numpy==1.22.0; python_version>='3.11'"
"numpy==1.24.3; python_version>='3.11'"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let it be 1.23.0 to leverage numpy backward compatibility.

Copy link
Contributor Author

@tomsweeting tomsweeting May 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it looks like there is a problem using 1.23.0 - I had a little time this evening to try building with this and I hit the same error again.

Start of output from pip wheel:

  Running command pip subprocess to install build dependencies
  Ignoring numpy: markers 'python_version == "3.6" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.7" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.8" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
  Ignoring numpy: markers 'python_version <= "3.9" and sys_platform == "linux" and platform_machine == "aarch64"' don't match your environment
  Ignoring numpy: markers 'python_version <= "3.9" and sys_platform == "darwin" and platform_machine == "arm64"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.9" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.10" and platform_system != "Darwin"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.10" and platform_system == "Darwin"' don't match your environment
  Collecting setuptools==59.2.0
    Using cached setuptools-59.2.0-py3-none-any.whl (952 kB)
  Collecting wheel==0.37.0
    Using cached wheel-0.37.0-py2.py3-none-any.whl (35 kB)
  Collecting cmake>=3.1
    Using cached cmake-3.26.3-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (45.6 MB)
  Collecting pip
    Using cached pip-23.1.2-py3-none-any.whl (2.1 MB)
  Collecting scikit-build>=0.13.2
    Downloading scikit_build-0.17.5-py3-none-any.whl (82 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82.9/82.9 kB 2.5 MB/s eta 0:00:00
  Collecting numpy==1.23.0
    Downloading numpy-1.23.0.tar.gz (10.7 MB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.7/10.7 MB 7.9 MB/s eta 0:00:00
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'error'
    error: subprocess-exited-with-error

    × Getting requirements to build wheel did not run successfully.
    │ exit code: 1
    ╰─> [105 lines of output]
        <string>:71: RuntimeWarning: NumPy 1.23.0 may not yet support Python 3.11.
        Running from numpy source directory.
        <string>:86: DeprecationWarning:

          `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
          of the deprecation of `distutils` itself. It will be removed for
          Python >= 3.12. For older Python versions it will remain present.
          It is recommended to use `setuptools < 60.0` for those Python versions.
          For more details, see:
            https://numpy.org/devdocs/reference/distutils_status_migration.html

However by setting this to 1.23.2 instead, I was able to build successfully (python 3.11.3 / M1 mac)

Would you accept setting this to 1.23.2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a little digging and yeah it looks like 1.23.2 is the first version to specifically support python 3.11: https://numpy.org/doc/stable/release/1.23.2-notes.html

With that, i'll update this one more time. Let me know if that's alright!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes,1.23.2 works! Thanks!

]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def main():
'numpy>=1.19.3; python_version>="3.6" and platform_system=="Linux" and platform_machine=="aarch64"',
'numpy>=1.21.0; python_version<="3.9" and platform_system=="Darwin" and platform_machine=="arm64"',
'numpy>=1.21.4; python_version>="3.10" and platform_system=="Darwin"',
"numpy>=1.22.0; python_version>='3.11'"
"numpy>=1.24.3; python_version>='3.11'"
Copy link
Collaborator

@asmorkalov asmorkalov May 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you replace minimal version with 1.23.5?

]

python_version = cmaker.CMaker.get_python_version()
Expand Down