Skip to content

Configure black to lint Jupyter notebooks#272

Merged
mkmkme merged 2 commits intovalkey-io:mainfrom
kurtmckee:update-black-config
Mar 28, 2026
Merged

Configure black to lint Jupyter notebooks#272
mkmkme merged 2 commits intovalkey-io:mainfrom
kurtmckee:update-black-config

Conversation

@kurtmckee
Copy link
Copy Markdown
Contributor

@kurtmckee kurtmckee commented Mar 4, 2026

Pull Request check-list

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?

Description of change

This PR introduces the following changes:

  • Black's jupyter extra is added, which allows it to lint Jupyter notebooks.

  • The docs/ directory is added to the list of directories to lint, so that black can lint the Jupyter notebooks there.

After making these changes to pyproject.toml and Makefile, this command was run:

black --target-version py37 docs tests valkey

@kurtmckee
Copy link
Copy Markdown
Contributor Author

Rebased on main, resolved merge conflicts, and force-pushed changes.

@mkmkme
Copy link
Copy Markdown
Collaborator

mkmkme commented Mar 21, 2026

Thanks for your PR. Hold it without rebasing for now. I have some plans of improving the CI on that part. Once I've done this, we'll get back to your PR.

@kurtmckee
Copy link
Copy Markdown
Contributor Author

@mkmkme Have you had a chance to implement your plans? If you haven't started, I'm hopeful that this can merge as-is, rather than being blocked on future work.

@mkmkme
Copy link
Copy Markdown
Collaborator

mkmkme commented Mar 28, 2026

@kurtmckee no, not yet.
I have to do this project only in my free time, so I don't have a lot of time to allocate on it. And this change is potentially quite big.

If you want to get this PR merged asap, I'd suggest limiting its scope to only cover linting and formatting Jupyter notebooks and dropping 3.10 syntax. Targeting py3.10 is potentially a larger task and it requires:

  • Changing the target version for black
  • Reformatting the whole repo
  • Adding the reformatting commit to .git-blame-ignore-revs

All of those should be done in separate commits. Also, I would like to do that after all currently pending PRs that I want to merge for the next release. Therefore, bumping the black target I would like to do myself. Thank you for understanding.

@kurtmckee
Copy link
Copy Markdown
Contributor Author

kurtmckee commented Mar 28, 2026

This PR already reformatted the code base -- two test files and docs/conf.py were affected. However, it could affect existing PRs, too, so I'll remove the py3.10 syntax change. 👍

@kurtmckee kurtmckee force-pushed the update-black-config branch 2 times, most recently from ba00416 to 062ba2a Compare March 28, 2026 11:27
Signed-off-by: Kurt McKee <contactme@kurtmckee.org>
Signed-off-by: Kurt McKee <contactme@kurtmckee.org>
@kurtmckee kurtmckee force-pushed the update-black-config branch from 062ba2a to d776cfa Compare March 28, 2026 11:28
@kurtmckee
Copy link
Copy Markdown
Contributor Author

@mkmkme I've updated the PR to merely target Jupyter notebooks, and I've rewritten the history so that the reformatting happens in a separate commit. 👍

Thanks for your explaining your reasoning! My goal is to continue hammering on the project infrastructure so that the project becomes easier to maintain, and risking causing additional work in existing PRs definitely was not an outcome I had considered.

Copy link
Copy Markdown
Collaborator

@mkmkme mkmkme left a comment

Choose a reason for hiding this comment

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

Looks great now, thanks a lot! 👍

@mkmkme mkmkme enabled auto-merge March 28, 2026 11:34
@kurtmckee kurtmckee changed the title Configure black to lint Jupyter notebooks and target py3.10 syntax Configure black to lint Jupyter notebooks Mar 28, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.40%. Comparing base (98d3b5c) to head (d776cfa).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #272   +/-   ##
=======================================
  Coverage   76.40%   76.40%           
=======================================
  Files         129      129           
  Lines       34065    34065           
=======================================
  Hits        26027    26027           
  Misses       8038     8038           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mkmkme mkmkme merged commit eadcc8e into valkey-io:main Mar 28, 2026
85 checks passed
@kurtmckee kurtmckee deleted the update-black-config branch March 28, 2026 20:59
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.

3 participants