-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python312Packages.hdmedians: modernize, fix testing, adopt
- Loading branch information
Showing
1 changed file
with
38 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,65 @@ | ||
{ | ||
lib, | ||
buildPythonPackage, | ||
pythonOlder, | ||
fetchPypi, | ||
nose, | ||
cython, | ||
oldest-supported-numpy, | ||
setuptools, | ||
numpy, | ||
nose, | ||
}: | ||
|
||
buildPythonPackage rec { | ||
version = "0.14.2"; | ||
format = "setuptools"; | ||
pname = "hdmedians"; | ||
version = "0.14.2"; | ||
pyproject = true; | ||
|
||
src = fetchPypi { | ||
inherit pname version; | ||
sha256 = "b47aecb16771e1ba0736557255d80ae0240b09156bff434321de559b359ac2d6"; | ||
}; | ||
|
||
# nose was specified in setup.py as a build dependency... | ||
buildInputs = [ | ||
# nose was marked as a build-time dependency, but is only used for testing | ||
postPatch = '' | ||
substituteInPlace setup.py \ | ||
--replace-fail "'nose>=1.0', " "" | ||
''; | ||
|
||
build-system = [ | ||
cython | ||
nose | ||
oldest-supported-numpy | ||
setuptools | ||
]; | ||
propagatedBuildInputs = [ numpy ]; | ||
|
||
# cannot resolve path for packages in tests | ||
doCheck = false; | ||
dependencies = [ numpy ]; | ||
|
||
# nose no longer builds on python >=3.12 | ||
doCheck = pythonOlder "3.12"; | ||
|
||
nativeCheckInputs = [ nose ]; | ||
|
||
checkPhase = '' | ||
nosetests | ||
runHook preCheck | ||
# force python to resolve the package from $out, where the cython ext files actually exist | ||
mv hdmedians/tests tests | ||
rm -r hdmedians | ||
nosetests tests | ||
runHook postCheck | ||
''; | ||
|
||
meta = with lib; { | ||
pythonImportsCheck = [ | ||
"hdmedians" | ||
"hdmedians.geomedian" # ext | ||
]; | ||
|
||
meta = { | ||
homepage = "https://github.com/daleroberts/hdmedians"; | ||
description = "High-dimensional medians"; | ||
license = licenses.gpl3; | ||
maintainers = [ ]; | ||
license = lib.licenses.asl20; | ||
maintainers = with lib.maintainers; [ tomasajt ]; | ||
}; | ||
} |