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

Format code using black #763

Merged
merged 6 commits into from Sep 5, 2020
Merged

Format code using black #763

merged 6 commits into from Sep 5, 2020

Conversation

ianhi
Copy link
Collaborator

@ianhi ianhi commented Sep 5, 2020

closes: #728

  1. Formatted existing code black .
  2. added black . --check to github actions
  3. Saved formatting commit SHA in a file following https://github.com/psf/black/tree/20.8b1#migrating-your-code-style-without-ruining-git-blame
  4. added pre-commit to setup.py and updated install instructions (https://github.com/psf/black/tree/20.8b1#version-control-integration)

@mlucool @fcollonval

@ianhi
Copy link
Collaborator Author

ianhi commented Sep 5, 2020

Tests fail because black is not available on python 3.5. This can be worked around with some if statements but it seems to get a little bit ugly as github actions don't support line level if statements. Given that python 3.5 is at the end of life in 9 days (september 13) I propose dropping it from the tests. Thoughts?

Copy link
Member

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

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

Thanks @ianhi

I agree with you. We can drop testing against 3.5 and I went ahead by adding 3.9rc.

I reorganize a bit the CI script so only jupyterlab needs to be explicitly installed before the test step (to get jlpm).

@@ -0,0 +1,2 @@
# migrate code to black
f922e2e1e60e3a964dbd07597e7c44c068b7ba1d
Copy link
Member

Choose a reason for hiding this comment

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

Very nice

@fcollonval fcollonval merged commit a4d5970 into jupyterlab:master Sep 5, 2020
@fcollonval
Copy link
Member

@meeseeksdev backport to 0.11.x

@lumberbot-app
Copy link

lumberbot-app bot commented Sep 5, 2020

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout 0.11.x
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 a4d5970c04fd46d77611e548f4f9539e6b702e1a
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #763: Format code using black'
  1. Push to a named branch :
git push YOURFORK 0.11.x:auto-backport-of-pr-763-on-0.11.x
  1. Create a PR against branch 0.11.x, I would have named this PR:

"Backport PR #763 on branch 0.11.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to suggest an improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python Styling Proposal
2 participants