-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add support for custom python cell magics #2744
Merged
JelleZijlstra
merged 16 commits into
psf:main
from
mgmarino:add-support-for-custom-python-magics
Jan 21, 2022
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3a6c30e
Add python-cell-magics as config option
mgmarino 65d48e4
Consider python_cell_magics when formatting cells
mgmarino f469c88
Test parsing of python_cell_magics configuration
mgmarino f0c67bc
Add Changelog entry for python magics
mgmarino 8110734
Ensure default behavior does not change when custom magics are included
mgmarino f18fc2b
Expand tests of custom python magics
mgmarino 7b3f7ab
Merge branch 'main' into add-support-for-custom-python-magics
JelleZijlstra 5eb71d8
sort set to ensure stability of cache
mgmarino 00e02c5
Use `object` for typing
mgmarino e23dc2f
Merge remote-tracking branch 'upstream/main' into add-support-for-cus…
mgmarino 924e900
Remove unused import
mgmarino 96cf858
Merge remote-tracking branch 'upstream/main' into add-support-for-cus…
mgmarino d004e5a
Merge remote-tracking branch 'upstream/main' into add-support-for-cus…
mgmarino 8b12ba3
Hash python cell magics cache string to ensure file-system compatibility
mgmarino c495217
Merge branch 'main' into add-support-for-custom-python-magics
JelleZijlstra 376dfe3
use Sequence
JelleZijlstra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
A bit jarring to write
--python-cell-magics custom1 --python-cell-magics custom2
. Should we use a comma-separated list instead?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.
Agreed, though this is how
click
supports multiple options out of the box. This is also howtarget-version
takes multiple arguments. I expect that we would need to introduce a custom callback to support multiple options, which might then also require custom logic when reading from thepyproject.toml
file.My expectation is that this will rather mostly be used in a configuration file and so perhaps the clunkiness on the command line is acceptable.
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.
That's fair!