Unverified Commit 6b5afbf4 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #311489 from TomaSajt/bayespy-truncnorm

python312Packages.bayespy: add missing dependency, clean up; python312Packages.truncnorm: init at 0.0.2
parents 48378ee5 ec53d50e
Loading
Loading
Loading
Loading
+31 −12
Original line number Diff line number Diff line
{ 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; {
+44 −0
Original line number Diff line number Diff line
{
  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 ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -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 { };