Page MenuHomeFreeBSD

[WIP] Adding devel/py-threadpoolctl
Needs ReviewPublic

Authored by thierry on Jun 17 2022, 4:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 5, 4:51 PM
Unknown Object (File)
Jan 17 2024, 11:00 AM
Unknown Object (File)
Dec 25 2023, 7:44 PM
Unknown Object (File)
Dec 24 2023, 4:55 PM
Unknown Object (File)
Dec 14 2023, 6:32 AM
Unknown Object (File)
Nov 27 2023, 11:13 PM
Unknown Object (File)
Nov 6 2023, 10:52 PM
Unknown Object (File)
Nov 6 2023, 3:34 AM

Details

Summary

This port is required to upgrade science/py-MDAnalysis and (science/py-MDAnalysisTests), and it is also missing for science/py-scikit-learn.

This initial patch can be installed cleanly, but when you try to use it, it fails with the following error:
ld-elf.so.1: Can't find module with TLS index 1

This error has already been reported upstream by yuri@ but no solution has been found ATM:
https://github.com/joblib/threadpoolctl/issues/125

Adding emaste@ as a reviewer because you touched libexec/rtld-elf/rtld.c and wen@ as the maintainer of sklearn.

Test Plan
$ python3.8
Python 3.8.13 (default, May 12 2022, 01:23:33) 
[Clang 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a on freebsd14
Type "help", "copyright", "credits" or "license" for more information.
>>> from threadpoolctl import threadpool_info
>>> from pprint import pprint
>>> pprint(threadpool_info())

ld-elf.so.1: Can't find module with TLS index 1

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

thierry created this revision.
koobs added inline comments.
devel/py-threadpoolctl/Makefile
23

Upstream declares requires-python = ">=3.6" (capping at 3.9). Match upstream version support declarations as closely as possible given our current USES=python:<version-spec> syntax. 3.6-3.9 is fine here, unless upstream tests with and the tests pass with 3.10 too

33

Upstream provides tests in their sources. If these are not packaged in the PyPI sdist, feel free to USE_GITHUB in the meantime after asking upstream to ship them there.

Should be able to:

do-test:
cd ${WRKSRC} && ${PYTHON_CMD} -m pytest -v -rs -o addopt=
devel/py-threadpoolctl/pkg-plist
8

Are pyc|pco objects created at first runtime for this file? If so, these will be orphans on uninstallation

Taking koobs’s remarks into account:

  • set the range of Python versions;
  • build and run the tests (using the pytest helper), as an option since it requires more dependencies.

Unfortunately, on my machine, I get "8 failed, 20 passed, 34 skipped".

Some tests are normally skipped because we do not have MKL or some kind of OMP, but others are skipped because openblas or blis is not found, and I have not yet found why. Same for the 8 errors: to be investigated…

Note: the pyc|pco objects are created during the installation.

The reported error is not fixed, but at least the port is cleaner, and understanding the causes of the failures reported by `make test' could hopefully help.

sunpoet added inline comments.
devel/py-threadpoolctl/Makefile
15–21

Right now, I'd like to generate a setup.py before we move to pyproject.toml.

See https://gist.github.com/sunpoet/f9ee85a45f334f65afde2a3a257e1bb3 for the setup.py.

I'll add a post-patch: to update the version.

post-patch:
        @${SED} -e 's|%%PORTVERSION%%|${PORTVERSION}|' ${FILESDIR}/setup.py > ${WRKSRC}/setup.py
24
33

It is outdated.
Please use USE_PYTHON=pytest instead.
See https://cgit.freebsd.org/ports/commit/Mk/Uses/python.mk?id=535f310d337c0b7de64a972bc0b855bba6c6f1f0 for details.

devel/py-threadpoolctl/Makefile
24

Unless upstream tests with and the tests pass beyond the versions supported, <version-spec> should be capped. Incomplete version spec declarations (particularly leaving open max versions), causes problems for Python evolving default Python version.

33

I posted a specific target because many packages do not work with a standard invocation.

thierry added inline comments.
devel/py-threadpoolctl/Makefile
33

USES=pytest can be used with this port.