Skip to content
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

Pylint and Mypy fixes to solve CI errors. Remove Python 3.8 support #1374

Merged
merged 21 commits into from
Jan 24, 2025

Conversation

ftroisi
Copy link
Collaborator

@ftroisi ftroisi commented Jan 15, 2025

Summary

This PR originates from #1371, and fixes pylint and mypy errors in the CI. Also, the package networkx had to be updated to support numpy 2.x.
Since tests must pass, PR #1371 has been incorporated in this PR. Thanks to @iyanmv for opening that PR.

Details and comments

Fixes: #1370

Note that since MacOS 14, github-hosted runners do not have Conda bundled. Thus, on the macos-latest pipeline, we have to install Conda (conda-incubator/setup-miniconda#344). A sincere thanks to @EndBug for the discussion on this topic.

Python 3.8 reached EOL last year. Since there were pylint errors due to this old version and qiskit no longer supports Python 3.8, this PR deprecates Python 3.8 support

@coveralls
Copy link

coveralls commented Jan 22, 2025

Pull Request Test Coverage Report for Build 12931707835

Details

  • 22 of 31 (70.97%) changed or added relevant lines in 17 files are covered.
  • 80 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-1.0%) to 85.986%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_nature/second_q/circuit/library/ansatzes/ucc.py 2 3 66.67%
qiskit_nature/second_q/circuit/library/ansatzes/uvcc.py 0 1 0.0%
qiskit_nature/second_q/transformers/active_space_transformer.py 0 1 0.0%
qiskit_nature/second_q/mappers/bosonic_logarithmic_mapper.py 0 2 0.0%
qiskit_nature/second_q/operators/symmetric_two_body.py 0 4 0.0%
Files with Coverage Reduction New Missed Lines %
qiskit_nature/second_q/drivers/gaussiand/gaussiandriver.py 80 39.5%
Totals Coverage Status
Change from base Build 8747150606: -1.0%
Covered Lines: 8786
Relevant Lines: 10218

💛 - Coveralls

@ftroisi ftroisi requested a review from woodsp-ibm January 22, 2025 16:35
@ftroisi ftroisi changed the title Pylint and Mypy fixes to solve CI errors Pylint and Mypy fixes to solve CI errors. Deprecate Python 3.8 Jan 22, 2025
@woodsp-ibm
Copy link
Member

Looks fine to me overall. One comment I have about the title and text is that this does not deprecate 3.8 support it removes it completely. Deprecation keeps support but issues warnings about the intent to remove it in an upcoming version. Since its changed the package from the user perspective in that regard the PR should have a release note stating that 3.8 support has been removed such that when a release is generated, including this, that this comes out in the release notes documentation. See https://github.com/qiskit-community/qiskit-nature/blob/main/CONTRIBUTING.md#release-notes for creating release notes (you can see examples in past PRs too if you need any).

I see you noted networkx requirement needed updating for numpy 2. I cannot recall any longer why it was pinned - I assume some compatibility related problem. Just noting that I think CI will install the latest unless constrained otherwise so maybe the entry in requirements-dev is not strictly needed. Commenting as I see the main requirements.txt file whose contents affect a normal install state numpy >=1.17 such that I guess if a user has an older numpy than 2.0 it still works. (I checked qiskit just because its a major dependency and it has the same min version)

@woodsp-ibm
Copy link
Member

I will note the branch rules here will need updating such that new jobs are made Required as needed and older jobs, no longer run, get removed from being Required. This can be done just ahead of this being merged so the rules match what is needed to pass this given the CI changes here.

@ftroisi ftroisi changed the title Pylint and Mypy fixes to solve CI errors. Deprecate Python 3.8 Pylint and Mypy fixes to solve CI errors. Remove Python 3.8 support Jan 23, 2025
@ftroisi
Copy link
Collaborator Author

ftroisi commented Jan 23, 2025

@woodsp-ibm I changed the name to reflect the removal of Python 3.8 and added a release note. I have also removed networkx from requirements-dev, as it gets the latest version from other dependencies.

It should be all good now, I am just waiting for approval and your update on the branch rules.

@ftroisi ftroisi merged commit ea8cc99 into qiskit-community:main Jan 24, 2025
16 checks passed
@woodsp-ibm
Copy link
Member

woodsp-ibm commented Jan 25, 2025

@ftroisi FYI I see the nightly scheduled CI, that was run after this was merged, failed in unbuntu 3.12 with psi4, though it had passed here. You can see the CI runs under "Actions" its here https://github.com/qiskit-community/qiskit-nature/actions/runs/12960770104 Not sure if that was just an intermittent and/or related to the psi4 errors you had before.

Update: I see last nights (Sat 25th thru Sun) scheduled CI passed. So I guess we have to see if the failure re-occurs or not.

@ftroisi
Copy link
Collaborator Author

ftroisi commented Jan 27, 2025

@woodsp-ibm Thanks for the message, the error was about a temp folder which could be found (FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/qiskit-nature/qiskit-nature/psi.3594.clean').
Nothing related to the errors I fixed in the PR. Anyways, as you said let's wait and see if it happens again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestBravyiKitaevSuperFastMapper::test_h2 fails with NumPy >= 2.0
3 participants