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

fix: raise minimum Python version for type checking to 3.9 #416

Merged
merged 2 commits into from
Jul 1, 2023

Conversation

alexander-held
Copy link
Member

@alexander-held alexander-held commented Jul 1, 2023

The latest version of numpy, 1.25.0, dropped compatibility with Python 3.8. When using mypy on cabinetry with Python 3.8 and the settings from the pyproject.toml, this results in errors getting raised in cabinetry. An example is the following:

import numpy as np

a = np.asarray([1, 2, 3])
b = a.copy()
c = a.copy().astype(float)
d: np.ndarray = a.copy().astype(float)

resulting in

test.py:5: error: Need type annotation for "c"  [var-annotated]
    c = a.copy().astype(float)
        ^~~~~~~~~~~~~~~~~~~~~~
Found 1 error in 1 file (checked 1 source file)

This is addressed here by raising the minimum Python version for the type checks being performed to Python 3.9.

* raise minimum Python version for mypy to Python 3.9 for compatibility with numpy 1.25.0

@codecov
Copy link

codecov bot commented Jul 1, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (b1c4c40) 100.00% compared to head (fc6a688) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #416   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         2069      2069           
  Branches       334       334           
=========================================
  Hits          2069      2069           

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

@alexander-held alexander-held merged commit 5064e38 into master Jul 1, 2023
7 checks passed
@alexander-held alexander-held deleted the fix/numpy-typing-python-version branch July 1, 2023 09:38
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.

None yet

1 participant