Merge pull request #107550 from tfmoraes/pydicom-2.1.2
This commit is contained in:
commit
f14e007296
@ -1,29 +1,55 @@
|
|||||||
{ stdenv
|
{ stdenv
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, fetchPypi
|
, fetchFromGitHub
|
||||||
, isPy27
|
, isPy27
|
||||||
, pytest
|
|
||||||
, pytestrunner
|
, pytestrunner
|
||||||
, pytestCheckHook
|
, pytestCheckHook
|
||||||
, numpy
|
, numpy
|
||||||
, pillow
|
, pillow
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
let
|
||||||
version = "2.1.1";
|
|
||||||
pname = "pydicom";
|
pname = "pydicom";
|
||||||
disabled = isPy27;
|
version = "2.1.2";
|
||||||
|
|
||||||
src = fetchPypi {
|
src = fetchFromGitHub {
|
||||||
inherit pname version;
|
owner = "${pname}";
|
||||||
sha256 = "72a11086f6a277c1529a552583fde73e03256a912173f15e9bc256e5b28f28f1";
|
repo = "${pname}";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "sha256-iExy+mUs1uqs/u9N6btlqyP6/TvoPVsuOuzs56zZAS8=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Pydicom needs pydicom-data to run some tests. If these files are downloaded
|
||||||
|
# before the package creation, it'll try to download during the checkPhase.
|
||||||
|
test_data = fetchFromGitHub {
|
||||||
|
owner = "${pname}";
|
||||||
|
repo = "${pname}-data";
|
||||||
|
rev = "bbb723879690bb77e077a6d57657930998e92bd5";
|
||||||
|
sha256 = "sha256-dCI1temvpNWiWJYVfQZKy/YJ4ad5B0e9hEKHJnEeqzk=";
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
buildPythonPackage {
|
||||||
|
inherit pname version src;
|
||||||
|
disabled = isPy27;
|
||||||
|
|
||||||
propagatedBuildInputs = [ numpy pillow ];
|
propagatedBuildInputs = [ numpy pillow ];
|
||||||
|
|
||||||
checkInputs = [ pytest pytestrunner pytestCheckHook ];
|
checkInputs = [ pytestrunner pytestCheckHook ];
|
||||||
disabledTests = [ "test_invalid_bit_depth_raises" ];
|
|
||||||
# harmless failure; see https://github.com/pydicom/pydicom/issues/1119
|
# Setting $HOME to prevent pytest to try to create a folder inside
|
||||||
|
# /homeless-shelter which is read-only.
|
||||||
|
# Linking pydicom-data dicom files to $HOME/.pydicom/data
|
||||||
|
preCheck = ''
|
||||||
|
export HOME=$TMP/test-home
|
||||||
|
mkdir -p $HOME/.pydicom/
|
||||||
|
ln -s ${test_data}/data_store/data $HOME/.pydicom/data
|
||||||
|
'';
|
||||||
|
|
||||||
|
# This test try to remove a dicom inside $HOME/.pydicom/data/ and download it again.
|
||||||
|
disabledTests = [
|
||||||
|
"test_fetch_data_files"
|
||||||
|
];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = "https://pydicom.github.io";
|
homepage = "https://pydicom.github.io";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user