diff options
author | Horea Christian <chr@chymera.eu> | 2023-12-11 10:59:30 -0500 |
---|---|---|
committer | Horea Christian <chr@chymera.eu> | 2023-12-11 10:59:30 -0500 |
commit | 1d9f52f78d06e93d2fa28efaff395e19c17f063a (patch) | |
tree | 65034299db2964a9cb879b262bfd1a5dd31315df /sci-libs | |
parent | dev-python/typish: unkeyword 1.9.3 (diff) | |
download | sci-1d9f52f78d06e93d2fa28efaff395e19c17f063a.tar.gz sci-1d9f52f78d06e93d2fa28efaff395e19c17f063a.tar.bz2 sci-1d9f52f78d06e93d2fa28efaff395e19c17f063a.zip |
sci-libs/nipype: PEP517 fixes and revbump
Signed-off-by: Horea Christian <chr@chymera.eu>
Diffstat (limited to 'sci-libs')
-rw-r--r-- | sci-libs/nipype/files/nipype-1.8.4-no_etelemetry.patch | 50 | ||||
-rw-r--r-- | sci-libs/nipype/nipype-1.8.4-r1.ebuild | 1 | ||||
-rw-r--r-- | sci-libs/nipype/nipype-1.8.4-r2.ebuild | 96 |
3 files changed, 147 insertions, 0 deletions
diff --git a/sci-libs/nipype/files/nipype-1.8.4-no_etelemetry.patch b/sci-libs/nipype/files/nipype-1.8.4-no_etelemetry.patch new file mode 100644 index 000000000..b5c223422 --- /dev/null +++ b/sci-libs/nipype/files/nipype-1.8.4-no_etelemetry.patch @@ -0,0 +1,50 @@ +diff --git a/nipype/__init__.py b/nipype/__init__.py +index 06084e823..2e42dcbce 100644 +--- a/nipype/__init__.py ++++ b/nipype/__init__.py +@@ -73,23 +73,6 @@ from .interfaces import ( + ) + + +-def check_latest_version(raise_exception=False): +- """ +- Check for the latest version of the library. +- +- Parameters +- ---------- +- raise_exception: bool +- Raise a RuntimeError if a bad version is being used +- """ +- import etelemetry +- +- logger = logging.getLogger("nipype.utils") +- return etelemetry.check_available_version( +- "nipy/nipype", __version__, logger, raise_exception +- ) +- +- + # Run telemetry on import for interactive sessions, such as IPython, Jupyter notebooks, Python REPL + if config.getboolean("execution", "check_version"): + import __main__ +@@ -98,4 +81,4 @@ if config.getboolean("execution", "check_version"): + from .interfaces.base import BaseInterface + + if BaseInterface._etelemetry_version_data is None: +- BaseInterface._etelemetry_version_data = check_latest_version() or "n/a" ++ BaseInterface._etelemetry_version_data = "n/a" +diff --git a/nipype/interfaces/base/core.py b/nipype/interfaces/base/core.py +index c8099be63..f7770dbfc 100644 +--- a/nipype/interfaces/base/core.py ++++ b/nipype/interfaces/base/core.py +@@ -183,10 +183,9 @@ class BaseInterface(Interface): + config.getboolean("execution", "check_version") + and "NIPYPE_NO_ET" not in os.environ + ): +- from ... import check_latest_version + + if BaseInterface._etelemetry_version_data is None: +- BaseInterface._etelemetry_version_data = check_latest_version() or "n/a" ++ BaseInterface._etelemetry_version_data = "n/a" + + if not self.input_spec: + raise Exception("No input_spec in class: %s" % self.__class__.__name__) diff --git a/sci-libs/nipype/nipype-1.8.4-r1.ebuild b/sci-libs/nipype/nipype-1.8.4-r1.ebuild index 8214ccff4..7c2e801ff 100644 --- a/sci-libs/nipype/nipype-1.8.4-r1.ebuild +++ b/sci-libs/nipype/nipype-1.8.4-r1.ebuild @@ -3,6 +3,7 @@ EAPI=8 +DISTUTILS_USE_PEP517=setuptools PYTHON_COMPAT=( python3_{10..11} ) PYTHON_REQ_USE="threads(+),sqlite" diff --git a/sci-libs/nipype/nipype-1.8.4-r2.ebuild b/sci-libs/nipype/nipype-1.8.4-r2.ebuild new file mode 100644 index 000000000..4c3da70b3 --- /dev/null +++ b/sci-libs/nipype/nipype-1.8.4-r2.ebuild @@ -0,0 +1,96 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..11} ) +PYTHON_REQ_USE="threads(+),sqlite" + +inherit distutils-r1 + +DESCRIPTION="Neuroimaging in Python: Pipelines and Interfaces" +HOMEPAGE="https://nipype.readthedocs.io/" +SRC_URI="https://github.com/nipy/nipype/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="test" +RESTRICT="!test? ( test )" + +DEPEND=" + dev-python/numpy[${PYTHON_USEDEP}] + dev-python/prov[${PYTHON_USEDEP}] + sci-libs/nibabel[${PYTHON_USEDEP}] + test? ( + dev-python/mock[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + ${RDEPEND} + ) +" + +RDEPEND=" + dev-python/click[${PYTHON_USEDEP}] + dev-python/filelock[${PYTHON_USEDEP}] + dev-python/looseversion[${PYTHON_USEDEP}] + dev-python/networkx[${PYTHON_USEDEP}] + dev-python/packaging[${PYTHON_USEDEP}] + dev-python/pydot[${PYTHON_USEDEP}] + dev-python/python-dateutil[${PYTHON_USEDEP}] + dev-python/rdflib[${PYTHON_USEDEP}] + dev-python/scipy[${PYTHON_USEDEP}] + dev-python/simplejson[${PYTHON_USEDEP}] + <dev-python/traits-6.4.0[${PYTHON_USEDEP}] +" + +PATCHES=( + "${FILESDIR}/${PN}-1.8.4-dependency_compatibility.patch" + "${FILESDIR}/${PN}-1.8.4-no_etelemetry.patch" +) + +src_prepare() { + # Remove etelemetry + # Doing this separately since the file is affected by another patch. + sed -i '/"etelemetry/d' nipype/info.py requirements.txt || die + + # Mark failing tests + sed -i \ + -e "/def test_no_et(tmp_path):/i@pytest.mark.skip('Known to fail by upstream: https://github.com/nipy/nipype/issues/3196#issuecomment-606003186')" \ + nipype/tests/test_nipype.py || die + sed -i \ + -e "/def test_fslversion():/i@pytest.mark.skip('Known to fail by upstream: https://github.com/nipy/nipype/issues/3196#issuecomment-605997462')" \ + nipype/interfaces/fsl/tests/test_base.py || die + default +} + +python_install_all() { + distutils-r1_python_install_all + doenvd "${FILESDIR}/98nipype" +} + +# Reported upstream: +# https://github.com/nipy/nipype/issues/3540 +EPYTEST_DESELECT=( + nipype/interfaces/tests/test_io.py::test_s3datagrabber_communication +) + +python_test() { + # Setting environment variable to disable etelemetry version check: + # https://github.com/nipy/nipype/issues/3196#issuecomment-605980044 + NIPYPE_NO_ET=1 epytest + # Upstream test configuration fails + #-c nipype/pytest.ini\ + #--doctest-modules nipype\ + #--cov nipype\ + #--cov-config .coveragerc\ + #--cov-report xml:cov.xml\ +} + +pkg_postinst() { + echo + einfo "Please run the following commands if you" + einfo "intend to use nipype from an existing shell:" + einfo "source /etc/profile" + echo +} |