Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tifffile #62755

Closed
wants to merge 1 commit into from
Closed

Tifffile #62755

wants to merge 1 commit into from

Conversation

tbenst
Copy link
Contributor

@tbenst tbenst commented Jun 6, 2019

Motivation for this change

Add missing dependency to tifffile. Note: do not merge until #62754 is merged

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@oxzi
Copy link
Member

oxzi commented Jun 6, 2019

Your PR contains two commits, one for the newly added imagecodecs-lite package, which seems to be identically with #62754, and one to reference this library. Thus, #62754 can be closed, or am I mistaken?

Copy link
Member

@oxzi oxzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ nix-build -A python2Packages.imagecodecs-lite
these derivations will be built:
  /nix/store/99yx9b4m7m4h6ahbgsgwvvsh5vz5imw1-python2.7-imagecodecs-lite-2019.4.20.drv
building '/nix/store/99yx9b4m7m4h6ahbgsgwvvsh5vz5imw1-python2.7-imagecodecs-lite-2019.4.20.drv'...
unpacking sources
unpacking source archive /nix/store/4jmyxkmhpaliifbhh4qq42dkqgm13d70-imagecodecs-lite-2019.4.20.tar.gz
source root is imagecodecs-lite-2019.4.20
setting SOURCE_DATE_EPOCH to timestamp 1555874253 of file imagecodecs-lite-2019.4.20/setup.cfg
patching sources
configuring
building
Traceback (most recent call last):
  File "nix_run_setup", line 8, in <module>
    exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
  File "setup.py", line 24, in <module>
    code, re.MULTILINE | re.DOTALL).groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'
builder for '/nix/store/99yx9b4m7m4h6ahbgsgwvvsh5vz5imw1-python2.7-imagecodecs-lite-2019.4.20.drv' failed with exit code 1
error: build of '/nix/store/99yx9b4m7m4h6ahbgsgwvvsh5vz5imw1-python2.7-imagecodecs-lite-2019.4.20.drv' failed

The imagecodecs-lite library fails to be built with Python 2 (Python 3 works fine). Therefore, one should add disabled = !isPy3k;.

@tbenst
Copy link
Contributor Author

tbenst commented Jun 6, 2019

@geistesk yes this pull request also contains #62754, so I closed that one and made changes you suggested, thx!

@FRidh
Copy link
Member

FRidh commented Jun 23, 2019

Two commits are needed here, one per package.

@tbenst
Copy link
Contributor Author

tbenst commented Jun 26, 2019

@FRidh ok I reopened #62754

@tbenst
Copy link
Contributor Author

tbenst commented Oct 4, 2019

Now that #62754 is merged, rebased and ready to merge

@tbenst
Copy link
Contributor Author

tbenst commented Oct 30, 2019

@geistesk does this look ok to you?

Copy link
Member

@oxzi oxzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not mistaken, the Python 2.7 cases could be removed.
In addition, the transitive Python 2 compatibility is thus omitted. Currently this seems to affect only the PIMS Python module.

@@ -22,12 +23,12 @@ buildPythonPackage rec {
pytest
'';

propagatedBuildInputs = [ numpy ]
propagatedBuildInputs = [ numpy imagecodecs-lite ]
++ lib.optional isPy27 [ futures enum34 pathlib ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building tifffile with Python 2.7 fails for me, because imagecodes-lite does not support Python 2.7. So can this not be removed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same applies to the patch above.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please leave it in for now. It's not unlikely that someone would choose to re-add Python 2 support.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified so imagecodecs-lite is only loaded for python3..let me know if this sounds good?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does the setup.py say?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonringer when you want to have an environment that represents a build environment, that works well. Otherwise, I would recommend going of the nix run approach so setup hooks are not executed.

For example, having the following in a default.nix or shell.nix works when using nix-shell

with import <nixpkgs> {};
(python3.withPackages(ps: with ps; [ virtualenv tifffle matplotlib imagecodecs-lite ]).env

Note the env. When using nix run -f . that part should be removed

with import <nixpkgs> {};
(python3.withPackages(ps: with ps; [ virtualenv tifffle matplotlib imagecodecs-lite ])

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general that is my workflow. I guess I could do a default.nix like the on you have, then I could have just have a shell.nix be:

  (import ./default.nix).env

I think that would work...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or just execute nix run -f . :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too easy, don't like :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also for my workflow, i need to be able to use virtualenv and then install some packages locally, the shellhook is nice in that case, because i can have it auto create the venv dir, set the pythonpath to include the venv sitepackages, and a few other project specific things :)


meta = with lib; {
description = "Read and write image data from and to TIFF files.";
homepage = https://www.lfd.uci.edu/~gohlke/;
homepage = "https://www.lfd.uci.edu/~gohlke/";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary change, undo this

@tbenst tbenst closed this Oct 30, 2019
@tbenst tbenst mentioned this pull request Dec 21, 2019
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants