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

Add Python 3.11 support #803

Merged
merged 14 commits into from
Apr 4, 2023
Merged

Add Python 3.11 support #803

merged 14 commits into from
Apr 4, 2023

Conversation

rly
Copy link
Contributor

@rly rly commented Dec 17, 2022

Motivation

  • Add Python 3.11 support
    - Drop Python 3.7 support. Major scientific Python packages, such as numpy, pandas, and scipy, have already dropped Python 3.7 support in their latest releases
  • Do not set upper bounds on package installation dependencies. Having no upper bounds is generally recommended for libraries. See https://iscinumpy.dev/post/bound-version-constraints/
  • Also test Pandas 2.0.0

NOTE: h5py has not yet released wheels for Python 3.11, so all tests will currently fail.

Checklist

  • Did you update CHANGELOG.md with your changes?
  • Have you checked our Contributing document?
  • Have you ensured the PR clearly describes the problem and the solution?
  • Is your contribution compliant with our coding style? This can be checked running flake8 from the source directory.
  • Have you checked to ensure that there aren't other open Pull Requests for the same change?
  • Have you included the relevant issue number using "Fix #XXX" notation where XXX is the issue number? By including "Fix #XXX" you allow GitHub to close issue #XXX when the PR is merged.

@codecov
Copy link

codecov bot commented Jan 23, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (95ba876) 87.79% compared to head (34d592a) 87.79%.

Additional details and impacted files
@@           Coverage Diff            @@
##              dev     #803    +/-   ##
========================================
  Coverage   87.79%   87.79%            
========================================
  Files          44       44            
  Lines        8950     8950            
  Branches     2062     2695   +633     
========================================
  Hits         7858     7858            
  Misses        779      779            
  Partials      313      313            
Impacted Files Coverage Δ
src/hdmf/common/table.py 85.34% <100.00%> (ø)
src/hdmf/data_utils.py 90.29% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rly rly marked this pull request as ready for review January 24, 2023 05:57
@rly rly added this to the Next Release milestone Jan 24, 2023
@rly rly changed the title [WIP] Add Python 3.11 support, drop Python 3.7 Add Python 3.11 support, drop Python 3.7 Jan 24, 2023
@rly
Copy link
Contributor Author

rly commented Jan 24, 2023

Now that h5py has released wheels for Python 3.11, I would like to make a minor release of hdmf in the next week or two to add support for Python 3.11.

TODO:

  • Update pynwb to use python 3.11 in a branch and make sure tests pass
  • Update branch protection

@yarikoptic
Copy link
Contributor

yarikoptic commented Jan 30, 2023

  • Drop Python 3.7 support. Major scientific Python packages, such as numpy, pandas, and scipy, have already dropped Python 3.7 support in their latest releases

yikes! numpy even dropped 3.8 already in its master main as of a month back: numpy/numpy#22902 to be released in 1.25.0 in July 2023 but 3.8 is EOLing only in over 1.5 years (14 Oct 2024) !! I wonder why they are rushing ?

@yarikoptic
Copy link
Contributor

I guess might stem from https://numpy.org/neps/nep-0029-deprecation_policy.html where 3.9 becomes minimal supported some time this Apr 2023. yet to comprehend it fully but at least it answers the question "why". It also doesn't imply that downstream projects (such as hdmf etc) have to drop versions no longer supported by numpy etc, since they could still be used with earlier versions of python and numpy which might still be supported or simply be supported/present in some given distribution.

@rly
Copy link
Contributor Author

rly commented Jan 31, 2023

Yes, we don't have to drop Python 3.7 support for newer versions of HDMF (EOL is 27 Jun 2023). The main benefits are that we can use Python 3.8+ only features (not critical but nice to have) and we need not test on Python 3.7 in CI. Dropping Python 3.6 was more useful since Python 3.7 introduced some nice-to-have features. Python 3.8 is less important. I'll update the PR, and we can drop Python 3.7 if we come across an incompatibility.

@rly
Copy link
Contributor Author

rly commented Jan 31, 2023

Note that #785 highlights an inconvenience with Python 3.7. We have worked around it though.

@rly rly changed the title Add Python 3.11 support, drop Python 3.7 Add Python 3.11 support Jan 31, 2023
@rly
Copy link
Contributor Author

rly commented Apr 4, 2023

PyNWB tests pass locally on my Mac M1 with Python 3.11. We can check for issues with other OSs in the PyNWB repo.

I also made a change to the DynamicTable.to_dataframe() to ensure that the index column of the dataframe has type int64, for consistency across OS (windows uses int32 by default, but mac and linux use int64).

@rly rly requested review from bendichter and oruebel April 4, 2023 21:40
@oruebel oruebel added the category: enhancement improvements of code or code behavior label Apr 4, 2023
@oruebel oruebel added the priority: medium non-critical problem and/or affecting only a small set of users label Apr 4, 2023
@rly rly merged commit 79f5886 into dev Apr 4, 2023
23 of 24 checks passed
@rly rly deleted the add_py311_support branch April 5, 2023 00:00
@rly rly mentioned this pull request Apr 5, 2023
6 tasks
@rly rly removed this from the 3.14.0 milestone Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: enhancement improvements of code or code behavior priority: medium non-critical problem and/or affecting only a small set of users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants