Merge pull request #311489 from TomaSajt/bayespy-truncnorm

python312Packages.bayespy: add missing dependency, clean up; python312Packages.truncnorm: init at 0.0.2
This commit is contained in:
Weijia Wang 2024-05-14 11:09:16 +02:00 committed by GitHub
commit 6b5afbf413
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 77 additions and 12 deletions

View File

@ -1,30 +1,49 @@
{ stdenv, lib, buildPythonPackage, fetchPypi, pythonOlder
, pytestCheckHook, nose, glibcLocales, fetchpatch
, numpy, scipy, matplotlib, h5py }:
{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
setuptools,
numpy,
scipy,
h5py,
truncnorm,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "bayespy";
version = "0.6.1";
format = "setuptools";
pyproject = true;
# Python 2 not supported and not some old Python 3 because MPL doesn't support
# them properly.
disabled = pythonOlder "3.4";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-3N8w/LiTLsDZbHp3z26FvDg3vStB2l3XkIWx+Mma1G0=";
src = fetchFromGitHub {
owner = "bayespy";
repo = "bayespy";
rev = "refs/tags/${version}";
hash = "sha256-X7CwJBrKHlU1jqMkt/7XEzaiwul1Yzkb/V64lXG4Aqo=";
};
nativeCheckInputs = [ pytestCheckHook nose glibcLocales ];
postPatch = ''
substituteInPlace versioneer.py \
--replace-fail SafeConfigParser ConfigParser \
--replace-fail readfp read_file
'';
propagatedBuildInputs = [ numpy scipy matplotlib h5py ];
build-system = [ setuptools ];
disabledTests = [
# Assertion error
"test_message_to_parents"
dependencies = [
numpy
scipy
h5py
truncnorm
];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "bayespy" ];
meta = with lib; {

View File

@ -0,0 +1,44 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
setuptools-scm,
numpy,
scipy,
}:
buildPythonPackage rec {
pname = "truncnorm";
version = "0.0.2";
pyproject = true;
src = fetchFromGitHub {
owner = "jluttine";
repo = "truncnorm";
rev = "refs/tags/${version}";
hash = "sha256-F+RBXN/pjxmHf26/Vxptz1NbF58eqU018l3zmepSoJk=";
};
build-system = [
setuptools
setuptools-scm
];
dependencies = [
numpy
scipy
];
# No checks
doCheck = false;
pythonImportsCheck = [ "truncnorm" ];
meta = with lib; {
homepage = "https://pypi.org/project/truncnorm";
description = "Moments for doubly truncated multivariate normal distributions";
license = licenses.mit;
maintainers = with maintainers; [ jluttine ];
};
}

View File

@ -15425,6 +15425,8 @@ self: super: with self; {
trueskill = callPackage ../development/python-modules/trueskill { };
truncnorm = callPackage ../development/python-modules/truncnorm { };
trustme = callPackage ../development/python-modules/trustme { };
truststore = callPackage ../development/python-modules/truststore { };