Follow NEP 29: Support Python 3.7+ and NumPy 1.18+#195
Follow NEP 29: Support Python 3.7+ and NumPy 1.18+#195apdavison merged 7 commits intopython-quantities:masterfrom
Conversation
| - name: Test | ||
| run: | | ||
| pytest | ||
| PY_IGNORE_IMPORTMISMATCH=1 pytest |
There was a problem hiding this comment.
Why is it needed to set this env var?
There was a problem hiding this comment.
I'm not entirely sure, I think it may be due to distutils? Without, it fails like this:
_______________ ERROR collecting quantities/tests/test_units.py ________________
import file mismatch:
imported module 'quantities.tests.test_units' has this __file__ attribute:
/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/quantities/tests/test_units.py
which is not the same as the test file we want to collect:
/home/runner/work/python-quantities/python-quantities/quantities/tests/test_units.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
https://github.com/hugovk/python-quantities/runs/3709626106?check_suite_focus=true
See also: pytest-dev/pytest#2042
|
Thx a lot for switching to GitHub Actions, supporting newer numpy versions, recommending pytest, and for dropping support for older python releases! 👍🏿 |
NumPy 1.21 has changed the exception type for incorrect np.arctan2() arguments from ValueError to TypeError. Adjust the test appropriately. Fixes python-quantities#190
5f95bfa to
80290b8
Compare
|
This is great. I do wonder though, whether NEP 29 isn't too restrictive. For a stable project like quantities, the maintenance burden of supporting older versions is fairly low, and the benefits for reproducibility can be substantial. I would propose that we support NEP 29 + 1 year. What do you folks think? |
NEP 29
Applying NEP 29:
Means supporting:
NEP 29 + 1 year
Applying NEP 29 + 1 year:
Means supporting:
|
CPythonJust considering Python versions, another simple policy which many non-Science Python projects choose, is to support those which the core CPython team supports: Means supporting:
|
|
Merging this now, and will perhaps relax to NEP + 1 year in a separate PR |
Follow NEP 29: Support Python 3.7+ and NumPy 1.18+ (closes Drop support for Python 2.7 #169)
--py37-plusReplace Travis CI with Github Actions, as Travis has placed limits for free accounts (closes Shutdown of travis-ci.org #187)
Includes the fix from fix expected np.arctan2() exception for numpy 1.21 #191 for NumPy 1.21 (closes fix expected np.arctan2() exception for numpy 1.21 #191)
Tests now pass (closes Tests fail #192)
Replace deprecated
python setup.py testwith modern pytest, to avoid the test suite passing for errorsPY_IGNORE_IMPORTMISMATCH=1env var, I think it may be due to distutils? More info: get rid of "ImportMismatchError" pytest-dev/pytest#2042