diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2021-01-04 12:16:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-04 12:16:54 +0100 |
commit | f14e00729644391ac21a6f6544dd6c210702313d (patch) | |
tree | 1c2f656dbf2535289e7c3a876f13a3b5889d84d8 /pkgs/development/python-modules | |
parent | 4a55ebeca22d9a838bcc7d331a7a181fe1b029e9 (diff) | |
parent | 4553efaedd2e0f209daa75eca77559eca8b2099d (diff) | |
download | nixpkgs-f14e00729644391ac21a6f6544dd6c210702313d.tar nixpkgs-f14e00729644391ac21a6f6544dd6c210702313d.tar.gz nixpkgs-f14e00729644391ac21a6f6544dd6c210702313d.tar.bz2 nixpkgs-f14e00729644391ac21a6f6544dd6c210702313d.tar.lz nixpkgs-f14e00729644391ac21a6f6544dd6c210702313d.tar.xz nixpkgs-f14e00729644391ac21a6f6544dd6c210702313d.tar.zst nixpkgs-f14e00729644391ac21a6f6544dd6c210702313d.zip |
Merge pull request #107550 from tfmoraes/pydicom-2.1.2
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r-- | pkgs/development/python-modules/pydicom/default.nix | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/pkgs/development/python-modules/pydicom/default.nix b/pkgs/development/python-modules/pydicom/default.nix index 24186c09dcd..450a6a3c049 100644 --- a/pkgs/development/python-modules/pydicom/default.nix +++ b/pkgs/development/python-modules/pydicom/default.nix @@ -1,29 +1,55 @@ { stdenv , buildPythonPackage -, fetchPypi +, fetchFromGitHub , isPy27 -, pytest , pytestrunner , pytestCheckHook , numpy , pillow }: -buildPythonPackage rec { - version = "2.1.1"; +let pname = "pydicom"; - disabled = isPy27; + version = "2.1.2"; + + src = fetchFromGitHub { + owner = "${pname}"; + repo = "${pname}"; + rev = "v${version}"; + sha256 = "sha256-iExy+mUs1uqs/u9N6btlqyP6/TvoPVsuOuzs56zZAS8="; + }; - src = fetchPypi { - inherit pname version; - sha256 = "72a11086f6a277c1529a552583fde73e03256a912173f15e9bc256e5b28f28f1"; + # 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 ]; - checkInputs = [ pytest pytestrunner pytestCheckHook ]; - disabledTests = [ "test_invalid_bit_depth_raises" ]; - # harmless failure; see https://github.com/pydicom/pydicom/issues/1119 + checkInputs = [ pytestrunner pytestCheckHook ]; + + # 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; { homepage = "https://pydicom.github.io"; |