-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Tifffile #62755
Conversation
There was a problem hiding this 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;
.
Two commits are needed here, one per package. |
Now that #62754 is merged, rebased and ready to merge |
@geistesk does this look ok to you? |
There was a problem hiding this 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 ]; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ])
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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 .
:)
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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/"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary change, undo this
Motivation for this change
Add missing dependency to
tifffile
. Note: do not merge until #62754 is mergedThings done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)