Skip to content

Follow NEP 29: Support Python 3.7+ and NumPy 1.18+#195

Merged
apdavison merged 7 commits intopython-quantities:masterfrom
hugovk:replace-travis-with-gha
Oct 18, 2021
Merged

Follow NEP 29: Support Python 3.7+ and NumPy 1.18+#195
apdavison merged 7 commits intopython-quantities:masterfrom
hugovk:replace-travis-with-gha

Conversation

@hugovk
Copy link
Copy Markdown
Contributor

@hugovk hugovk commented Aug 28, 2021

- name: Test
run: |
pytest
PY_IGNORE_IMPORTMISMATCH=1 pytest
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it needed to set this env var?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@twmr
Copy link
Copy Markdown
Contributor

twmr commented Sep 25, 2021

Thx a lot for switching to GitHub Actions, supporting newer numpy versions, recommending pytest, and for dropping support for older python releases! 👍🏿

@hugovk hugovk force-pushed the replace-travis-with-gha branch from 5f95bfa to 80290b8 Compare September 25, 2021 19:44
@apdavison
Copy link
Copy Markdown
Contributor

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?

@hugovk
Copy link
Copy Markdown
Contributor Author

hugovk commented Sep 30, 2021

NEP 29

This project supports:

  • All minor versions of Python released 42 months prior to the project, and at minimum the two latest minor versions.
  • All minor versions of numpy released in the 24 months prior to the project, and at minimum the last three minor versions.

Applying NEP 29:

On Jun 23, 2020 drop support for Python 3.6 (initially released on Dec 23, 2016)
...
On Jul 26, 2021 drop support for NumPy 1.17 (initially released on Jul 26, 2019)

Means supporting:

  • Python 3.7+ (= 3 versions, and 4 from Monday)
  • NumPy 1.17+ (= 5 versions)

NEP 29 + 1 year

This project supports:

  • All minor versions of Python released 42 54 months prior to the project, and at minimum the two latest minor versions.
  • All minor versions of numpy released in the 24 36 months prior to the project, and at minimum the last three minor versions.

Applying NEP 29 + 1 year:

On Jun 23, 2020 2021 drop support for Python 3.6 (initially released on Dec 23, 2016)
On Jul 23, 2020 2021 drop support for NumPy 1.15 (initially released on Jul 23, 2018)

Means supporting:

  • Python 3.7+ (= 3 versions, and 4 from Monday)
  • NumPy 1.16+ (= 6 versions)

@hugovk
Copy link
Copy Markdown
Contributor Author

hugovk commented Sep 30, 2021

CPython

Just 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:

  • Python 3.6+ (=4 versions, and 5 from Monday)

@apdavison apdavison merged commit 2043891 into python-quantities:master Oct 18, 2021
@apdavison
Copy link
Copy Markdown
Contributor

Merging this now, and will perhaps relax to NEP + 1 year in a separate PR

@hugovk hugovk deleted the replace-travis-with-gha branch October 18, 2021 07:23
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.

Tests fail Shutdown of travis-ci.org test_fix in test_umath.py gives an unexpected success Drop support for Python 2.7 np.fix fails

4 participants