diff options
author | Thiago Franco de Moraes <totonixsame@gmail.com> | 2020-12-24 19:46:29 -0300 |
---|---|---|
committer | Thiago Franco de Moraes <totonixsame@gmail.com> | 2021-01-01 18:26:46 -0300 |
commit | 4553efaedd2e0f209daa75eca77559eca8b2099d (patch) | |
tree | c058674a17d3f59e374f7b796d9ae26ff1ca2b2e /pkgs/development/python-modules | |
parent | f0e774407c3ce6ac41d79a5a564a9265b6efc600 (diff) | |
download | nixpkgs-4553efaedd2e0f209daa75eca77559eca8b2099d.tar nixpkgs-4553efaedd2e0f209daa75eca77559eca8b2099d.tar.gz nixpkgs-4553efaedd2e0f209daa75eca77559eca8b2099d.tar.bz2 nixpkgs-4553efaedd2e0f209daa75eca77559eca8b2099d.tar.lz nixpkgs-4553efaedd2e0f209daa75eca77559eca8b2099d.tar.xz nixpkgs-4553efaedd2e0f209daa75eca77559eca8b2099d.tar.zst nixpkgs-4553efaedd2e0f209daa75eca77559eca8b2099d.zip |
python3Packages.pydicom: 2.1.1 -> 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"; |