This repository has been archived by the owner on Jul 8, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Blackify #14
Blackify #14
Changes from 8 commits
1684998
47971c1
026473a
5d3e0ab
f743887
7d9fbb4
36b345f
7a65905
026bf3b
c324549
819f8cd
e3d8194
d2af6b4
d79a304
c1ee611
3be35de
5f154cd
8238eb7
565ebfb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 seems different to the way Iris is set up to test for black compliance
https://github.com/SciTools/iris/blob/d16f6767d4d775e2afd691de9c6514782ba2a90d/.travis.yml#L108-L113
In particular, it looks as though
black --check
is being run for iris. Is this test equivalent? If there is a difference, is there a reason for that difference?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 was hoping to leverage the extra elegance of pytest (which Iris doesn't use) by using the pytest-black plugin. Unfortunately, while pytest-black is under active development, it is not kept up to date on Anaconda, which has resulted in the deprecation error in Travis.
I am unsure whether the correct action should be to explicitly pip install pytest-black, or to invoke black the 'old-fashioned' way like Iris does. Thoughts?
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.
... just trying the pip solution on Travis as a POC ...
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 do like the idea of using the latest features of pytest, since we are kind of using this repo to "test drive" pytest anyway. I guess there is a good case for making changes where pytest allows a more elegant solution.
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.
OK well that worked at least, and I've included a TODO to get rid of the pip line once conda gets a later pytest-black version.
Gonna take a break now. I await your verdict!
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.
It's probably worth noting that in Iris, black is pinned to version 19.10b0 https://github.com/SciTools/iris/blob/d16f6767d4d775e2afd691de9c6514782ba2a90d/requirements/test.txt#L4.
This approach means that Iris-ugrid will be tested against a different version of black than Iris. I don't think this should cause massive issues, but it might be worth thinking about.
This file was deleted.