Skip to content

Migrate to NumPy 2.x.x and raise minimum Python version to 3.10#403

Open
muhammad-fiaz wants to merge 3 commits intofacebookresearch:mainfrom
muhammad-fiaz:main
Open

Migrate to NumPy 2.x.x and raise minimum Python version to 3.10#403
muhammad-fiaz wants to merge 3 commits intofacebookresearch:mainfrom
muhammad-fiaz:main

Conversation

@muhammad-fiaz
Copy link

@muhammad-fiaz muhammad-fiaz commented Jan 12, 2026

Hello!

I have updated the project to be compatible with NumPy 2.0 (minimum supported version) and raised the minimum required Python version to 3.10 to ensure consistent dependency resolution when using uv.

NumPy Compatibility

Python Version Requirement

* I raised the minimum supported Python version to 3.10

  • Python versions below 3.10 cannot satisfy NumPy’s dependency constraints when resolving environments with uv.
  × No solution found when resolving dependencies for split (markers: python_full_version == '3.8.*'):
  ╰─▶ Because the requested Python version (>=3.8) does not satisfy Python>=3.9.0 and numpy>=1.26.0,<=1.26.1 depends on     
      Python>=3.9,<3.13, we can conclude that numpy>=1.26.0,<=1.26.1 cannot be used.
      And because only the following versions of numpy are available:
          numpy<=1.26.0
          numpy==1.26.1
          numpy==1.26.2
          numpy==1.26.3
          numpy==1.26.4
          numpy==2.0.0
          numpy==2.0.1
          numpy==2.0.2
          numpy==2.1.0
          numpy==2.1.1
          numpy==2.1.2
          numpy==2.1.3
          numpy==2.2.0
          numpy==2.2.1
          numpy==2.2.2
          numpy==2.2.3
          numpy==2.2.4
          numpy==2.2.5
          numpy==2.2.6
          numpy==2.3.0
          numpy==2.3.1
          numpy==2.3.2
          numpy==2.3.3
          numpy==2.3.4
          numpy==2.3.5
          numpy==2.4.0
          numpy==2.4.1
      we can conclude that numpy>=1.26.0,<1.26.2 cannot be used. (1)

      Because the requested Python version (>=3.8) does not satisfy Python>=3.9.0 and numpy>=1.26.2,<=2.0.2 depends on      
      Python>=3.9, we can conclude that numpy>=1.26.2,<=2.0.2 cannot be used.
      And because we know from (1) that numpy>=1.26.0,<1.26.2 cannot be used, we can conclude that numpy>=1.26.0,<2.1.0     
      cannot be used. (2)

      Because the requested Python version (>=3.8) does not satisfy Python>=3.9.0 and numpy>=2.1.0,<=2.2.6 depends on       
      Python>=3.10, we can conclude that numpy>=2.1.0,<=2.2.6 cannot be used.
      And because we know from (2) that numpy>=1.26.0,<2.1.0 cannot be used, we can conclude that numpy>=1.26.0,<2.3.0      
      cannot be used. (3)

      Because the requested Python version (>=3.8) does not satisfy Python>=3.9.0 and all of:
          numpy>=2.3.0,<=2.3.5
          numpy>=2.4.1
      depend on Python>=3.11, we can conclude that all of:
          numpy>=2.3.0,<=2.3.5
          numpy>=2.4.1
       cannot be used.
      And because we know from (3) that numpy>=1.26.0,<2.3.0 cannot be used, we can conclude that all of:
          numpy>=1.26.0,<2.4.0
          numpy>2.4.0
       cannot be used.
      And because numpy==2.4.0 was yanked (reason: Backward compatibility bug), we can conclude that numpy>=1.26.0 cannot   
      be used.
      And because your project depends on numpy>=1.26 and your project requires sam3[dev], we can conclude that your        
      project's requirements are unsatisfiable.

      hint: Pre-releases are available for `numpy` in the requested range (e.g., 2.4.0rc1), but pre-releases weren't        
      enabled (try: `--prerelease=allow`)

      hint: The `requires-python` value (>=3.8) includes Python versions that are not supported by your dependencies        
      (e.g., numpy>=1.26.0,<=1.26.1 only supports >=3.9, <3.13). Consider using a more restrictive `requires-python` value  
      (like >=3.9, <3.13).

      hint: While the active Python version is 3.14, the resolution failed for other Python versions supported by your      
      project. Consider limiting your project's supported Python versions using `requires-python`.
  • I ran Ruff with the NPY201 rule and verified that all checks pass.
  • I confirmed that uv sync --dev completes successfully with the updated constraints.

these changes follows the official NumPy 2.0 migration guide.

please tell me, if there any additional changes needed!

additional reference

Update np.bool to be an alias to np.bool_ and un-deprecate it

image

@meta-cla
Copy link

meta-cla bot commented Jan 12, 2026

Hi @muhammad-fiaz!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla
Copy link

meta-cla bot commented Jan 12, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant