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

pre-commit autoupdate and related changes #163

Merged
merged 2 commits into from Feb 24, 2022

Conversation

danielsparing
Copy link

This PR includes the results of a pre-commit autoupdate propagated to the affected files.

In more detail:

  • Black in the release 22.1.0 made a style change that removes spaces around the ** operator in some cases Hug power operators if its operands are "simple" psf/black#2726
  • This is reflected in both nbqa-black and black-jupyter after the autoupdate.
  • This change temporarily resulted in a race condition, reproducibility issue and pre-commit failures in some PRs, e.g. in renaming files in text folder #161 (link to pre-commit.ci failure)
    • the reason for this is that while black-jupyter respects the pinned Black version number in , on the other hand nbqa-black uses the black installed in the local environment, and in case of the pre-commit.ci environment this was the latest 22.1.0, as opposed to the pinned 21.12b0.
    • in theory there would be a 'solution' to this reproducibility issue, in the pre-commit-config.yaml file in the nbqa-black section one could add something like additional_dependencies : ['black:21.12b0'] (see also the same advice in the nbQA doc), but probably this would add an unnecessary layer of manual maintenance burden (e.g. having to manually bump this version and sync with black's), hence this PR only autoupdate's and accepts the repercussions.

Finally, all this means that on your local environment you need to pip install --upgrade black, especially if you experience similar issues.

updating nbqa-black and black-jupyter means that a new black style is propagated that removes spaces around the "**" operator
psf/black#2726
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Collaborator

@sanjanalreddy sanjanalreddy left a comment

Choose a reason for hiding this comment

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

Thank you for identifying why this was happening and fixing this!

@BenoitDherin
Copy link
Collaborator

Thanks Daniel! This is great! LGTM

Copy link
Collaborator

@BenoitDherin BenoitDherin left a comment

Choose a reason for hiding this comment

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

LGTM

@BenoitDherin BenoitDherin merged commit 7115916 into master Feb 24, 2022
@BenoitDherin BenoitDherin deleted the black-exponentoperator branch February 24, 2022 18:36
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.

None yet

3 participants