-
Notifications
You must be signed in to change notification settings - Fork 197
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
ycecream: a no dependency. Pythonic fork of IceCream #58
Comments
If an issue was raised here, why not make a PR solving that issue? If there was no issue here, why not make one? Seems like all of these features could be in icecream:
As for this:
Perhaps this should be done in an automated manner with a tool like https://pypi.org/project/stickytape/ . Is that what https://github.com/salabim/ycecream/blob/main/install%20ycecream%20from%20github.py is? What will you do when there are changes to executing, asttokens, or icecream? |
I started with this project as I didn't like the API (not Pythonic) and wanted a single source package. That didn't seemed to be just a PR for IceCream, so I started my own fork. Feel free to use whatever you want from my package to make IceCream more useful (particularly decorators!). With respect to changes in the underlying packages: these will of course not automatically be incorporated. On the other hand, ycecream will not suffer from changes in the API's of these packages (although that's quite unlikely). The file 'install ycecream from github.py' is just another way |
this is definitely something we want. see #32 design discussion, and later pull requests, welcome there!
ya. as icecream has grown, so too have the number of options it's now clunky to pack so many params into
this is certainly possible with it could be useful to have those 'batteries' included and if you hand outputFunction a file object or string it 'does the right thing'. for example, could rename
@alexmojaki https://pypi.org/project/stickytape/ is neat. i, personally, havent seen it used by other projects, though think it'd be worth using stickytape to build a single at this time, my gut says no. this is the first time someone has requested a single file version of icecream |
I only found stickytape just now after a quick google. Seems like there's other possibilities for single file packaging. You can see places it's used here, the most significant being https://github.com/doyensec/inql with 704 stars where it looks like it works very well. Overall it's not clear to me why this kind of thing is important. In the case of InQL it looks like you need a single file to load as an extension for other software. For icecream, I don't know what significant advantage there is. I've seen this kind of thing requested once before here, and again it's not clear if it was necessary. I think the most sensible path would be to:
I've done something similar before. I know having your own codebase and complete control is easier and more fun. But I still contributed as much as I could to the original repo before I had to make a fork, and it was worth it. And in general, code in my fork was not pulled back into the base by anyone. That doesn't happen easily or naturally. @salabim You can of course do whatever you like, but I think it's a bit sad that someone clearly so interested in working on this project would keep all their contributions separate and isolated. |
@gruns - I am sure I am in a very tiny minority, but I would be interested in a single-file My reason for wanting a single file is related to the reason I don't just go ahead and use |
What implementation? The magic behind icecream and ycecream uses a lot of CPython implementation details. PyPy imitates these details which is why it works there, but there's no guarantees for all Pythons. Download https://github.com/alexmojaki/executing/blob/master/executing/executing.py (a single file!) and then try running this code (from a file, not a shell): import ast
import executing
import inspect
frame = inspect.currentframe()
print(ast.dump(executing.Source.for_frame(frame).executing(frame).node)) The expected output is something like this: Call(func=Attribute(value=Call(func=Attribute(value=Attribute(value=Name(id='executing', ctx=Load()), attr='Source', ctx=Load()), attr='for_frame', ctx=Load()), args=[Name(id='frame', ctx=Load())], keywords=[], starargs=None, kwargs=None), attr='executing', ctx=Load()), args=[Name(id='frame', ctx=Load())], keywords=[], starargs=None, kwargs=None) If you just get an exception or |
Otherwise you can try https://github.com/zestyping/q . It comes in a single file and is slightly less magical so it might have a better chance of working outside of CPython. |
It's iSeriesPython, running on IBM i, built primarily from the source for (I believe) CPython 2.7.1. It's still implemented in C and still recognizably a CPython.
I got exactly that output string, so at least that part of the puzzle fits. |
Originally posted by @salabim in #67 (comment)
Excellent! I tried it and it works! You got through the backport quicker than I expected. |
closing future readers of this issue: please open tickets/PRs for any features you'd like to see in icecream -- like from ycream or elsewhere! |
I like the IceCream package very much, but there were several reasons why I made a fork.
This solves also a number of issues raised here.
The ycecream package can be found here: https://github.com/salabim/ycecream and can be installed directly from PyPI.
Here are the main differences:
The text was updated successfully, but these errors were encountered: