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

pythonPackages.isort: 4.3.4 -> 4.3.15 #56884

Merged
merged 2 commits into from Mar 26, 2019
Merged

Conversation

kwohlfahrt
Copy link
Contributor

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
  • 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 nox --run "nox-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.

@xeji
Copy link
Contributor

xeji commented Mar 8, 2019

@GrahamcOfBorg eval

@kwohlfahrt kwohlfahrt changed the title isort: 4.3.4 -> 4.3.10 isort: 4.3.4 -> 4.3.15 Mar 19, 2019
@@ -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 {});
Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

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 ... { };

Copy link
Contributor Author

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?

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

@dotlambda dotlambda changed the title isort: 4.3.4 -> 4.3.15 pythonPackages.isort: 4.3.4 -> 4.3.15 Mar 23, 2019
Copy link
Member

@dotlambda dotlambda left a 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

@kwohlfahrt
Copy link
Contributor Author

Squashed, added link and disabled attribute.

@dotlambda
Copy link
Member

Please mind the pythonPackages. prefix that should be added to commit messages when it comes to Python packages.

@dotlambda
Copy link
Member

dotlambda commented Mar 25, 2019

The tests for the Python 2 variant are failing:

@GrahamcOfBorg build python2.pkgs.isort

@dotlambda
Copy link
Member

dotlambda commented Mar 25, 2019

Strange, I got

builder for '/nix/store/cm8qmxfbl5b96wjmn08pkgb76kxcby1n-python2.7-pytest-isort-0.3.1.drv' failed with exit code 1; last 10 log lines:
  E           and: u'=========================== 1 passed in 0.02 seconds ==========================='
  E           and: u''
  E       remains unmatched: '*test_incorrectly_sorted*FAILED*'
  
  /build/pytest-isort-0.3.1/test_isort.py:123: Failed
  ========================== deprecated python version ===========================
  You are using Python 2.7.15, which will no longer be supported in pytest 5.0
  For more information, please read:
    https://docs.pytest.org/en/latest/py27-py34-deprecation.html
  ====================== 1 failed, 8 passed in 0.85 seconds ======================

locally. Still investigating why.

@dotlambda
Copy link
Member

Ah I see. That's pytest-isort :D My fault.
Still, we'll have to investigate that because it would cause much breakage.

@kwohlfahrt
Copy link
Contributor Author

Weirdly, rolling back to 4.3.4 for python 2 doesn't work - the same test still fails:

  version = "4.3.4";

  src = fetchPypi {
    inherit pname version;
    sha256 = "1y0yfv56cqyh9wyg7kxxv9y5wmfgcq18n7a49mp7xmzka2bhxi5r";
  };

@dotlambda
Copy link
Member

I just came across PyCQA/isort#904. So there's no need to use a different version for Python 2.

@kwohlfahrt
Copy link
Contributor Author

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).
@kwohlfahrt
Copy link
Contributor Author

Addressed all comments.

@dotlambda
Copy link
Member

@GrahamcOfBorg build python2.pkgs.pytest-isort python3.pkgs.pytest-isort

@dotlambda
Copy link
Member

Nice, it works! 🎉
Thanks a lot for bearing with me @kwohlfahrt!

The isort tests were broken after upgrading the isort package.
@dotlambda
Copy link
Member

This broke cssselect2, so I disabled the useless tests.

@dotlambda dotlambda merged commit 4ad9324 into NixOS:master Mar 26, 2019
@kwohlfahrt
Copy link
Contributor Author

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.

@kwohlfahrt kwohlfahrt deleted the isort branch March 27, 2019 10:07
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