scikit-hep / cabinetry

design and steer profile likelihood fits
https://cabinetry.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
26 stars 21 forks source link

ci: run mypy in Python 3.8 mode instead of Python 3.7 mode #371

Closed agoose77 closed 1 year ago

codecov[bot] commented 1 year ago

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage :thumbsup:

Coverage data is based on head (b7ed503) compared to base (6281501). Patch has no changes to coverable lines.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #371 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 23 23 Lines 2023 2023 Branches 331 320 -11 ========================================= Hits 2023 2023 ``` Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

agoose77 commented 1 year ago

As discussed on Slack, the lower-bound on this NumPy version exceeds the last version that supported Python 3.7. We probably need to change this to an upper bound (with LB if known) of <1.22.0, or split the CI into two jobs if we need to test newer stubs for 3.10.

alexander-held commented 1 year ago

The numpy version required for mypy to run without additional # type: ignore additions is numpy>=1.22. Since numpy==1.22 is Python 3.8+, the issue with positional-only parameters (which are also Python 3.8+) is not avoidable in Python 3.7 runs of mypy which have been used so far.

As cabinetry is likely to drop support for Python 3.7 soon (pyhf has already done this in https://github.com/scikit-hep/pyhf/pull/2044), we can drop the Python 3.7 runs of mypy in favor of running with 3.8, which will fix the CI issue.

* run mypy with Python 3.8 instead of 3.7 in pre-commit
* set default Python version for mypy to 3.8 
* updated pre-commit