dagghe / pyOMA2

Python module for conducting operational modal analysis
MIT License
14 stars 4 forks source link

Fix requires-python #15

Closed akaszynski closed 1 month ago

akaszynski commented 1 month ago

Installation fails when using Python 3.12.4

ERROR: Package 'pyoma-2' requires a different Python: 3.12.4 not in '<=3.12,>=3.8'

This PR fixes the python requires by simply setting the upper limit to <3.12, thus covering all 3.12.X.

dfm88 commented 1 month ago

Hi @akaszynski thank you for your contribution, can you kindly check if you are downloading the current version? Support for python 3.12 should have been added from v0.5.1 (https://github.com/dagghe/pyOMA2/releases/tag/v0.5.1) and tests on that version of python passes (https://github.com/dagghe/pyOMA2/actions/runs/8654979937). Thanks

akaszynski commented 1 month ago

Hi @akaszynski thank you for your contribution, can you kindly check if you are downloading the current version? Support for python 3.12 should have been added from v0.5.1 (https://github.com/dagghe/pyOMA2/releases/tag/v0.5.1) and tests on that version of python passes (https://github.com/dagghe/pyOMA2/actions/runs/8654979937). Thanks

Turns out that the python environment for 3.12 isn't resolving correctly for Ubuntu or MacOS. See: https://github.com/dagghe/pyOMA2/actions/runs/9181281196/job/25247651952#step:7:12

2024-05-21T20:49:57.5592860Z ============================= test session starts ==============================
2024-05-21T20:49:57.5594100Z platform darwin -- Python 3.11.9, pytest-7.4.4, pluggy-1.3.0
2024-05-21T20:49:57.5594700Z rootdir: /Users/runner/work/pyOMA2/pyOMA2
2024-05-21T20:49:57.5595370Z plugins: anyio-4.3.0, cov-4.1.0

Issue seems to be because we're using an older version of pdm. Updating to pdm v2.17.2 fixes the environment creation, but causes the dependency install step to fail because the proper version of numpy can't be resolved. See the workflow run which uses the updated pdm: https://github.com/akaszynski/pyOMA2/actions/runs/10183661296/job/28169155716

Note, this works just fine with pip, but if you're using pdm, the only workaround is to stop testing Python 3.8 and bump numpy to >= v1.26. It's the oldest version that supports Python 3.12, but numpy dropped Python 3.8.

If you'd like, I can submit changes for that here.

dfm88 commented 1 month ago

Oh great, thank you for the insight, we would like to keep PDM as dependency manager and to support until python 3.8 included. If you want to deepen the problem, probably there is a way in pdm to specify different dependency depending on python version and also on platform https://pdm-project.org/en/latest/usage/lock-targets/. Just let us know if you want to give it a try :)

akaszynski commented 1 month ago

I think I figured it out in f30cf1b. Thanks for the tip regarding lock-targets.

dfm88 commented 1 month ago

Great :D thank you I'll merge it