-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
pythonPackages.isort: 4.3.4 -> 4.3.15 #56884
Conversation
@GrahamcOfBorg eval |
pkgs/top-level/python-packages.nix
Outdated
@@ -2893,7 +2893,7 @@ in { | |||
|
|||
iso8601 = callPackage ../development/python-modules/iso8601 { }; | |||
|
|||
isort = callPackage ../development/python-modules/isort {}; | |||
isort = disabledIf (!isPy3k) (callPackage ../development/python-modules/isort {}); |
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.
This should be put inside the expression: disabled = !isPy3k
. However, I don't think we can afford to drop Python 2 support right now.
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.
Actually, I don't see any hint at isort only supporting Python 3. Do 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.
This was in the release notes a while back: https://github.com/timothycrosley/isort/releases/tag/4.3.5
It might still work from coincidence, so I can switch it on again? AFAIK isort
is mostly used as a CLI application, so it doesn't really matter what python version it supports.
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.
Why do some packages use callPackage ./whatever.nix { disabled = isPy3k; }
, and some use disabledIf isPy3k (callPackage ./whatever.nix)
? protobuf
uses the former, zeitgeist
uses the latter.
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 latter is only there because it has been for some time. It should no longer be used.
The reason that we cannot simply drop Python 2 support is that there is quite a number of packages that depend on isort or pytest-isort. What you could do is use
isort = if isPy3k then
callPackage ... { }
else
callPackage ... { };
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.
Ah, OK. So I should pin the old version for use in python 2?
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.
Wait, only protobuf
uses the disabled = ...
syntax, everything else uses disabledIf
- or am I missing something?
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.
Ah, OK. So I should pin the old version for use in python 2?
Yes, please use the latest version with Python 2 support for that.
Wait, only protobuf uses the disabled = ... syntax, everything else uses disabledIf - or am I missing something?
grep -r "disabled =" pkgs/development/python-modules/
yields quite a lot of results.
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.
Even though we now have two expressions, please do still add disabled = !isPy3k
to default.nix
.
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.
Ah, I was looking in top-level/python-packages.nix
. Done.
6852fe9
to
b99007c
Compare
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.
There should be two commits with the following commit messages:
pythonPackages.isort: 4.3.4 -> 4.3.16
pythonPackages.isort: pin python2-compatible version
4435e8b
to
f23d4c6
Compare
Squashed, added link and disabled attribute. |
Please mind the |
The tests for the Python 2 variant are failing: @GrahamcOfBorg build python2.pkgs.isort |
Strange, I got
locally. Still investigating why. |
Ah I see. That's pytest-isort :D My fault. |
Weirdly, rolling back to
|
I just came across PyCQA/isort#904. So there's no need to use a different version for Python 2. |
3b3e6dd
to
74a8b9a
Compare
Removed python-2 specific version. There was a failing test, but for some reason it is passing in upstream CI, so I haven't dug into it much. |
We set $TMPDIR, because isort refuses to run in paths containing 'build' (since that is part of Python's typical build infrastructure).
Addressed all comments. |
@GrahamcOfBorg build python2.pkgs.pytest-isort python3.pkgs.pytest-isort |
Nice, it works! 🎉 |
The isort tests were broken after upgrading the isort package.
This broke cssselect2, so I disabled the useless tests. |
Yay! Thanks for looking after this PR - isort was incompatible with black before (i.e. they'd revert each other's changes) so it's nice to have this in. |
We set $TMPDIR, because isort refuses to run in paths containing
'build' (since that is part of Python's typical build infrastructure).
Motivation for this change
Version bump.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)