Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4a55ebeca22d
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f14e00729644
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jan 1, 2021

  1. Copy the full SHA
    4553efa View commit details

Commits on Jan 4, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f14e007 View commit details
Showing with 37 additions and 11 deletions.
  1. +37 −11 pkgs/development/python-modules/pydicom/default.nix
48 changes: 37 additions & 11 deletions pkgs/development/python-modules/pydicom/default.nix
Original file line number Diff line number Diff line change
@@ -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";