Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update numpy version#6221

Merged
sw005320 merged 27 commits intoespnet:masterfrom
Fhrozen:pr-numpy
Sep 9, 2025
Merged

Update numpy version#6221
sw005320 merged 27 commits intoespnet:masterfrom
Fhrozen:pr-numpy

Conversation

@Fhrozen
Copy link
Member

@Fhrozen Fhrozen commented Aug 23, 2025

Notes

Fix #6213

What did you change?

This pull request updates the project's Python and dependency requirements to ensure compatibility with newer versions and to drop support for older Python versions. The key changes are focused on updating the numpy dependency and the supported Python versions in setup.py, as well as a minor update to the tools/Makefile.

Dependency and compatibility updates:

  • Updated the numpy requirement in setup.py to numpy>=2.2.0, removing the previous restriction to versions below 1.24. This ensures compatibility with the latest numpy releases.
  • Changed the minimum required Python version in setup.py from 3.7 to 3.9, and updated the list of supported Python versions to include 3.11, 3.12, and 3.13 while removing 3.7 and 3.8.

Build process update:

  • Removed chainer.done from the python target dependencies in tools/Makefile, likely reflecting the project's move away from Chainer.

Additional Context

The part of the code that requires numpy<2.2 (if any part is found during evaluations) will not be removed, but will raise a compatibility error.

@Fhrozen Fhrozen requested a review from Copilot August 23, 2025 04:40
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 23, 2025
@Fhrozen Fhrozen requested a review from sw005320 August 23, 2025 04:40
@dosubot dosubot bot added the dependencies Pull requests that update a dependency file label Aug 23, 2025
@Fhrozen Fhrozen added this to the v.202509 milestone Aug 23, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Updates Python and dependency requirements to modernize the project's compatibility matrix. The changes focus on upgrading the numpy dependency to version 2.2.0+ and dropping support for older Python versions.

  • Updated numpy requirement from <1.24 to >=2.2.0 to use the latest releases
  • Increased minimum Python version from 3.7 to 3.9 and added support for Python 3.11, 3.12, and 3.13
  • Removed chainer dependency from the Makefile build process

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
setup.py Updated numpy dependency and Python version requirements
tools/Makefile Removed chainer.done from python target dependencies

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mergify mergify bot added the Installation label Aug 23, 2025
@Fhrozen
Copy link
Member Author

Fhrozen commented Aug 23, 2025

I expect this will be merged before the new release in the middle of September.

@sw005320. I think that if you approve it after checks are performed, it will be merged automatically. You can also activate the other auto-merge PRs by adding your user as the reviewer.

@Fhrozen
Copy link
Member Author

Fhrozen commented Aug 23, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to update numpy and Python version requirements. While updating dependencies is a good initiative, there are a couple of critical issues that need to be addressed. First, the new numpy version (>=2.2.0) is incompatible with the currently pinned librosa==0.9.2, which will cause installation failures. Second, removing chainer from the Makefile dependencies will lead to runtime ImportErrors, as it is still used extensively in the training loop across various tasks. I've left detailed comments on these issues.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates key dependencies, most notably numpy and the supported Python versions. The numpy requirement is changed from <1.24 to >=2.2.0, and Python support is updated to require version 3.9 or newer, dropping 3.7 and 3.8. Additionally, chainer is now an optional dependency.

My main feedback concerns the significant jump in the numpy version requirement. This change could impact users with environments that rely on intermediate numpy versions and requires careful testing due to breaking changes in numpy 2.0. I've added a comment with more details in setup.py.

@codecov
Copy link

codecov bot commented Aug 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.82%. Comparing base (df7f106) to head (da51c06).
⚠️ Report is 86 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6221   +/-   ##
=======================================
  Coverage   55.82%   55.82%           
=======================================
  Files         884      884           
  Lines       84007    84007           
=======================================
  Hits        46900    46900           
  Misses      37107    37107           
Flag Coverage Δ
test_integration_espnet2 46.16% <ø> (ø)
test_integration_espnetez 36.94% <ø> (ø)
test_python_espnet2 50.51% <ø> (ø)
test_python_espnetez 12.83% <ø> (ø)
test_utils 18.77% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Aug 23, 2025
@mergify mergify bot added ESPnet1 CI Travis, Circle CI, etc labels Aug 23, 2025
@Fhrozen
Copy link
Member Author

Fhrozen commented Aug 23, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively updates the project's dependencies, most notably numpy, and bumps the required Python version. The changes to handle the optional chainer dependency are well-implemented. I've identified a critical issue in setup.py concerning build reproducibility that should be addressed. Additionally, I've suggested improvements to the shell scripts in the CI to enhance their robustness and maintainability. Overall, these are solid updates that move the project forward.

@mergify
Copy link
Contributor

mergify bot commented Aug 25, 2025

This pull request is now in conflict :(

@mergify mergify bot added the conflicts label Aug 25, 2025
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Aug 26, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Aug 26, 2025
@Fhrozen
Copy link
Member Author

Fhrozen commented Aug 26, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates several dependencies, most notably numpy to version 2.0.0 or higher, and raises the minimum required Python version to 3.9. The changes in setup.py and devcontainer files look good. However, I found a critical issue in the new CI script that checks the numpy version. The logic is inverted and the error message is incorrect, which would cause the build to fail under the intended conditions. My review includes a suggestion to fix this.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@Fhrozen Fhrozen changed the title [WIP] Update numpy version Update numpy version Sep 3, 2025
@Fhrozen
Copy link
Member Author

Fhrozen commented Sep 3, 2025

@sw005320 This seems to be working.

BTW, I found additional errors when using Python 3.12. I will be making a different PR to target related issues.

@sw005320 sw005320 merged commit ca74d92 into espnet:master Sep 9, 2025
32 checks passed
@sw005320
Copy link
Contributor

sw005320 commented Sep 9, 2025

Thanks!

@Fhrozen Fhrozen deleted the pr-numpy branch September 9, 2025 15:24
This was referenced Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ASR Automatic speech recogntion CI Travis, Circle CI, etc dependencies Pull requests that update a dependency file ESPnet1 Installation LM size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installation in Google Colab

3 participants