Bug 264716 - science/py-MDAnalysis: upgrade to 2.2.0
Summary: science/py-MDAnalysis: upgrade to 2.2.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Thierry Thomas
URL: https://github.com/MDAnalysis/mdanaly...
Keywords:
Depends on:
Blocks: 261703
  Show dependency treegraph
 
Reported: 2022-06-16 16:21 UTC by Thierry Thomas
Modified: 2022-06-21 17:26 UTC (History)
1 user (show)

See Also:
yuri: maintainer-feedback+


Attachments
Upgrade MDAnalysis to 2.2.0 (4.26 KB, patch)
2022-06-16 16:21 UTC, Thierry Thomas
no flags Details | Diff
Full log of py39-MDAnalysis-2.2.0 (15.05 KB, application/x-bzip)
2022-06-16 17:06 UTC, Thierry Thomas
no flags Details
New patch to upgrade science/py-MDAnalysis and science/py-MDAnalysisTests disabling threadpoolctl (11.54 KB, patch)
2022-06-17 16:59 UTC, Thierry Thomas
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thierry Thomas freebsd_committer freebsd_triage 2022-06-16 16:21:46 UTC
Created attachment 234730 [details]
Upgrade MDAnalysis to 2.2.0

Version 0.19.2 is too old and does not support Python-3.9.

Releases notes at <https://github.com/MDAnalysis/mdanalysis/releases>.
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2022-06-16 16:35:52 UTC
The latest versions of MDAnalysis require py-threadpoolctl which I didn't commit yet because it is broken due to https://github.com/python/cpython/issues/92828 being unresolved.
Comment 2 Thierry Thomas freebsd_committer freebsd_triage 2022-06-16 17:06:37 UTC
Created attachment 234731 [details]
Full log of py39-MDAnalysis-2.2.0

With the attached patch it builds fine without that.
Full log attached.
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2022-06-16 17:51:00 UTC
(In reply to Thierry Thomas from comment #2)

2.2.0 requires py-threadpoolctl that fails due to a python issue linked above.


Yuri
Comment 4 Thierry Thomas freebsd_committer freebsd_triage 2022-06-17 16:59:11 UTC
Created attachment 234753 [details]
New patch to upgrade science/py-MDAnalysis and science/py-MDAnalysisTests disabling threadpoolctl

OK, I see the problem.

I have just submitted a review in Phabricator to get some more eyes on this problem:
https://reviews.freebsd.org/D35513

But meanwhile, I think that we can disable threadpoolctl (see my new proposed patch).

Of course, this could impact performance in some cases, but according to my tests the port is usable.

When running `make test' in py-MDAnalysisTests, it produces the following result on my workstation:
12 failed, 17600 passed, 159 skipped, 2 xfailed, 2 xpassed, 31881 warnings, 3 errors

and the errors do not seem related with this issue.

Note: many tests are skipped because sklearn (from science/py-scikit-learn) also requires threadpoolctl which is missing; some other are skipped because some ports are not yet available in the tree, e.g.
- py-chemfiles is missing (see https://pypi.org/project/chemfiles/)
- py-hole is missing (see https://pypi.org/project/hole/)
- py-tidynamics is missing (see https://pypi.org/project/tidynamics/).
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2022-06-17 18:42:07 UTC
(In reply to Thierry Thomas from comment #4)

In MDAnalysis/transformations/base.py they have 'from threadpoolctl import threadpool_limits' which would fail at some point which would make this package broken.
Comment 6 Thierry Thomas freebsd_committer freebsd_triage 2022-06-17 19:37:11 UTC
(In reply to Yuri Victorovich from comment #5)
Ooops, I missed this one!

Will try to fix it…
Comment 7 Thierry Thomas freebsd_committer freebsd_triage 2022-06-20 17:53:53 UTC
(In reply to Yuri Victorovich from comment #5)
Sorry Yuri, but I don't find it: MDAnalysis/transformations/base.py is patched by science/py-MDAnalysis/files/patch-MDAnalysis_transformations_base.py.
Could you please check again the submitted patch?
Comment 8 Yuri Victorovich freebsd_committer freebsd_triage 2022-06-20 20:54:22 UTC
(In reply to Thierry Thomas from comment #7)

Hi Thierry,

You patched away threadpoolctl from setup.py, but the project still installs Python file that import threadpoolctl. For me this command finds it:

> $ grep -r import work-py*/stage/ | grep thread
> work-py38/stage/usr/local/lib/python3.8/site-packages/MDAnalysis/transformations/base.py:from threadpoolctl import threadpool_limits

This means that the updated py-MDAnalysis package would be broken, while the current one isn't broken.

py-threadpoolctl should be fixed and added first before the update.
Comment 9 Thierry Thomas freebsd_committer freebsd_triage 2022-06-20 20:59:40 UTC
(In reply to Yuri Victorovich from comment #8)
You cannot use a simple grep like this, you need -A and -B, because the import line belongs to commented lines.

But it you prefer, just delete it, no problem for me.
Comment 10 Yuri Victorovich freebsd_committer freebsd_triage 2022-06-20 21:27:00 UTC
(In reply to Thierry Thomas from comment #9)

Thierry,

I am sorry, I misunderstood what you said.

The patch is fine, please go ahead and commit it.

Thank you!
Comment 11 Thierry Thomas freebsd_committer freebsd_triage 2022-06-21 17:26:30 UTC
Committed, thanks!
Comment 12 commit-hook freebsd_committer freebsd_triage 2022-06-21 17:26:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=40568cac8e3e1931ca48becdfd18e2bf0aab1061

commit 40568cac8e3e1931ca48becdfd18e2bf0aab1061
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2022-06-16 16:10:38 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2022-06-21 17:26:21 +0000

    science/py-MDAnalysis*: upgrade to 2.2.0

    Version 0.19.2 is too old and does not support Python-3.9.

    Remark: threadpoolctl is disabled in this port. See
    <https://github.com/MDAnalysis/mdanalysis/pull/2950> for the impacts on
    performance.

    Releases notes at <https://github.com/MDAnalysis/mdanalysis/releases>.

    PR:             264716
    Approved by:    yuri (maintainer)

 science/py-MDAnalysis/Makefile                     | 27 +++++++----
 science/py-MDAnalysis/distinfo                     |  6 +--
 .../patch-MDAnalysis.egg-info_requires.txt (new)   | 10 ++++
 .../patch-MDAnalysis_transformations_base.py (new) | 23 +++++++++
 science/py-MDAnalysis/files/patch-setup.py         | 20 +++++---
 science/py-MDAnalysisTests/Makefile                |  7 ++-
 science/py-MDAnalysisTests/distinfo                |  6 +--
 ...alysisTests_transformations_test__base.py (new) | 54 ++++++++++++++++++++++
 8 files changed, 129 insertions(+), 24 deletions(-)