Merge pull request #309586 from TomaSajt/scikit-bio

python311Packages.scikit-bio: unbreak, refactor, run tests, adopt
This commit is contained in:
OTABI Tomoya 2024-05-07 09:19:29 +09:00 committed by GitHub
commit d372356ff5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 121 additions and 37 deletions

View File

@ -0,0 +1,71 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
setuptools,
cython,
click,
numpy,
scipy,
pandas,
h5py,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "biom-format";
version = "2.1.15";
pyproject = true;
src = fetchFromGitHub {
owner = "biocore";
repo = "biom-format";
rev = "refs/tags/${version}";
hash = "sha256-WRBc+C/UWme7wYogy4gH4KTIdIqU3KmBm2jWzGNxGQg=";
};
patches = [
# fixes a test, can be removed in next version after 2.1.15
(fetchpatch {
name = "fix-dataframe-comparison.patch";
url = "https://github.com/biocore/biom-format/commit/5d1c921ca2cde5d7332508503ce990a7209d1fdc.patch";
hash = "sha256-nyHi469ivjJSQ01yIk/6ZMXFdoo9wVuazJHnFdy2nBg=";
})
];
build-system = [
setuptools
cython
numpy
];
dependencies = [
click
numpy
scipy
pandas
h5py
];
# make pytest resolve the package from $out
# some tests don't work if we change the level of directory nesting
preCheck = ''
mkdir biom_tests
mv biom/tests biom_tests/tests
rm -r biom
'';
nativeCheckInputs = [ pytestCheckHook ];
pytestFlagsArray = [ "biom_tests/tests" ];
pythonImportsCheck = [ "biom" ];
meta = {
homepage = "http://biom-format.org/";
description = "Biological Observation Matrix (BIOM) format";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ tomasajt ];
};
}

View File

@ -1,53 +1,64 @@
{ lib
, buildPythonPackage
, fetchPypi
, cython
, lockfile
, cachecontrol
, decorator
, h5py
, ipython
, matplotlib
, natsort
, numpy
, pandas
, scipy
, hdmedians
, scikit-learn
, coverage
, python
, isPy3k
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
cython,
oldest-supported-numpy,
requests,
decorator,
natsort,
numpy,
pandas,
scipy,
h5py,
hdmedians,
biom-format,
python,
pytestCheckHook,
}:
buildPythonPackage rec {
version = "0.6.0";
format = "setuptools";
pname = "scikit-bio";
disabled = !isPy3k;
version = "0.6.0";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-EBBafDwVrlkQJEkn8punqjUjSxnr5lE7hIRUc0OywQ8=";
src = fetchFromGitHub {
owner = "scikit-bio";
repo = "scikit-bio";
rev = "refs/tags/${version}";
hash = "sha256-v8/r52pJpMi34SekPQBf7CqRbs+ZEyPR3WO5RBB7uKg=";
};
nativeBuildInputs = [ cython ];
nativeCheckInputs = [ coverage ];
propagatedBuildInputs = [ lockfile cachecontrol decorator ipython matplotlib natsort numpy pandas scipy h5py hdmedians scikit-learn ];
build-system = [
setuptools
cython
oldest-supported-numpy
];
# cython package not included for tests
doCheck = false;
dependencies = [
requests
decorator
natsort
numpy
pandas
scipy
h5py
hdmedians
biom-format
];
checkPhase = ''
${python.interpreter} -m skbio.test
'';
nativeCheckInputs = [ pytestCheckHook ];
# only the $out dir contains the built cython extensions, so we run the tests inside there
pytestFlagsArray = [ "${placeholder "out"}/${python.sitePackages}/skbio" ];
pythonImportsCheck = [ "skbio" ];
meta = with lib; {
meta = {
homepage = "http://scikit-bio.org/";
description = "Data structures, algorithms and educational resources for bioinformatics";
license = licenses.bsd3;
platforms = [ "x86_64-linux" "x86_64-darwin" ];
maintainers = [ ];
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ tomasajt ];
};
}

View File

@ -1531,6 +1531,8 @@ self: super: with self; {
binwalk-full = self.binwalk.override { visualizationSupport = true; };
biom-format = callPackage ../development/python-modules/biom-format { };
biopandas = callPackage ../development/python-modules/biopandas { };
biopython = callPackage ../development/python-modules/biopython { };