Wolf is a VsCode extension that enables visual inspection of live Python code from the editor. It was inspired by Quokka.js:
The Rapid Prototyping Playground for JavaScript and TypeScript
and my love of programming.
Wolf is Good for:
NOTE: Please see FAQ section "Will APIs Hate Me?" before making requests with Wolf.
This extension contributes the following settings:
wolf.barkAtCurrentFile
: Starts Wolf on the current file.wolf.stopBarking
: Stops all running Wolf sessions.wolf.pawPrintsInGutter
: Use paw prints for gutter icons.wolf.maxLineLength
: The maximum length of line decorations. Lines longer than this are truncated (ex: 97, 98, 99, ... )wolf.printLoggingEnabled
: Enable Wolf console output (ie: the vscode terminal "output" section)wolf.updateFrequency
: Adjust the minimum timeframe before the file is saved during Hot ModeAbso-fucking-lutely.
Make sure to save the file you're working on, and that Wolf is activated. You can try stopping and starting Wolf again on the file to see if this helps.
Sorry, it's a feature for now. Try stopping and starting Wolf from the command menu to clear the pesky buggers.
Yes. Sorry, I mean, HELL YES!
That depends. If you code reponsibly and use something like diskcache or redis to cache your calls, then you'll do just fine out there. But if you decide to just bang away at some API without some other sort of caching in place, then it's on you my friend. Having said that, Wolf will only actually run your code on document save. So you do get a small amount of throttling by default.
Here's an example using diskcache:
*Cue Jingle
Honestly, if you need a real debugger, the one builtin to VSCode is
about as good as it gets. So really, please use that (or pdb
, ipdb
)
if you're in need of stuff like breakpoints (or if lives depend on it, ie
please don't use this to debug something like a drug pump ffs, ty).
I see Wolf as more of an exploration tool, for teachers or students in a learning environment, and definitely for streamers. You can't get any better than live feedback next to the code you're editing!
1 + 334 #? 335
example from above doesn't work in Python 3.8It's possible the tracer just passes over non-binding expressions but it could also be a bug.. I'm not really sure ATM but there's a unit test so I'll know if it regresses.
I know :( Not really sure how to fix this one yet but I'll get to it someday.
Wolf annotations no longer stutter/flash when editing files. Makes for a much smoother coding experience.
See #46 comment about "flashing on updates"
Fixes a regression of issue #54 on some systems.
Fixed issues 52 and 53 on GitHub and added test cases for each (Fixes contributed by @Almenon)
This was a limitation of the previous versions of Wolf and is a really nice QOL feature when coding on the fly.
Using github-actions Wolf is now tested against windows, macos, and windows, for Python versions 3.5, 3.6, and 3.8. This caught more than a few bugs that should make it easier for new users to get running with Wolf faster.
Now using the latest vscode extension APIs and Python 3rd party deps.
Fixed issues 28, 29, 30, and 34 on GitHub. Fixed some cross compatibility issues with Python v3.6, and v3.8.
Fixed hunter installation and added setting for python path (Fixes contributed by @Almenon). This should
fix any remaining 'Hunter not found'
errors. The Python Path
setting makes it easy to point your Wolf session at another Python
installation if you don't want to have to install Hunter into your
working env.
Wolf works in what was once called "Hot Mode" by default now. This means your live editing experience will be tuned for performance out of the box, with updating annotations on the fly.
NOTE: With these changes the following config options have been removed or changed:
Removed Options:
wolf.hot
: For enabling live re-loading. (Always on now)Changed Options:
wolf.hotFrequency
-> wolf.updateFrequency
Turn on Hot Mode to enable live reloading of code as you work. You can set the minimum frequency from the user settings if you want more control over when your file is saved/run.
Turn on Live Reloading:
"wolf.hot": true
Adjust minimum time between saves (throttle control) in milliseconds:
"wolf.hotFrequency": 270
Note: Frequency setting is clamped between 100 and 1000 millisecends
A comment macro is any single line comment character (pound/hash symbol) followed by a question mark. See the examples above to get a better idea of how they work, and check out the macro syntax rules below.
Syntax:
some.expression() #? <----Comment Macro
a = [i for i in some_list] # ? <----Space allowed
Note: Macros are restricted on lines starting with these blacklisted tokens.
while
return 0 #? <---Restriced, won't work
Efforts have been made to improve the structure of the core Wolf extension to allow for easier updates and more powerful features in the future.
Wolf now uses the builtin API for improving the sticky behavior of line decorations, especially while coding with Hot Reloading turned off.
Annotated lines now show up in the OverView ruler panel on the left side and are color coded for easy visual grepping.
Hover over any Wolf annotation to see the value pretty printed in a popup box.
Toggle Wolf on and off from the touch bar.
Set wolf.pawGutterIcons
: true
to swap the default gutter
icons with the new paw print style. (Requires restart)
Windows does not support SIGALRM so a custom decorator was provided by Almenon.
Newly added support for Python 3.5 was also provided by Almenon.
Thanks for contributing to Wolf, Almenon! :tada:
Better sticky handling during multi-line range edits and deletions.
Annotations now stay attached to their line during editing and between saves. Multi line editing is supported as well. A page save is still necessary to update the values, this means the script is still only run when the file is manually saved.
Colored notification icons in the gutter to aid in visual grepping of Wolf output. Error lines get a red icon while okay lines get a green icon.
The shortcut icons are now a single icon that senses whether Wolf is running on the current script and updates accordingly.
New shortcut buttons added to the action bar for easier starting and stopping.
Added a timeout to prevent locking and high cpu usage.
Bug: This introduced a bug in Windows which was fixed in v0.1.5
The previous version of Wolf would crap out a lot due to some poor choices on my part. Essentially, I tried to make it do too much too soon. I felt that stabilty should come before shiny features and have adjusted accordingly. This really shouldn't affect usability, but if you have other thoughts please let me know. That feedback is important.
Things like nested lists, sets, tuples.. etc, are now printed properly. Certain structures were flattened during printing during the last version and it was pretty frustrating, this should also be fixed but feel free to let me know if you find a way to break it.
This was a quiet feature in the last release, so not totally new in 0.1.0. But it wasn't mentioned in the docs before so I'm making it official now.
* Removed - Will possibly be re-implemented in a later version
Macros ~Removed in 0.1.0~
Wolf now automatically adds annotations for print
function calls.
Macros ~ Removed in 0.1.0
First release of the Wolf. :tada:
You mean a flea? Report any fleas in the issue tracker, please!
That would be awesome. You can shoot me an email or submit a PR. I'm also on
reddit at /u/Duroktar
. Also, there's plenty of documentation to get started
on your own, if you just want to do that. Welcome one, welcome all!
The following people have contributed to Wolf:
Almenon - Windows fixes, Python 3.5 support, tests & many more fixes and improvements ~ #3 #6 #13 #52 #53
Wolf source is available under the Apache 2.0 Software license. Any dependant libraries are subject to their own licenses and terms, the most direct of which are listed below.
Hunter - Hunter is a flexible code tracing toolkit. (Honestly, I couldn't have made Wolf without this library.) - BSD License