-
Notifications
You must be signed in to change notification settings - Fork 184
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
Package into a single file #67
Comments
Implementing this would likely use https://github.com/mwilliamson/stickytape Similar request in a different project, which explains some of the reasoning as well as generic instructions for installing from github without pip: cool-RR/PySnooper#18
I'm very curious about how a CPython fork can't use If that doesn't work, what if you download/clone this repo and run If none of that works, I'd suggest https://github.com/zestyping/q again until this is implemented, which may not be soon. |
And no, these are not due to path errors. They are just not on the system. The person who built this Python either ran into too much difficulty when working on certain pieces, given the specifics of the platform; or just didn't get around to it, and didn't feel a strong enough need for his own purposes.
Well, thanks for pointing it out. It does seem to work, but it is nowhere near as easy to use as icecream (at least judging by the examples shown in icecream's README). I mean, I was drawn to icecream because it looks like a great way to do print-debugging. q seems like a nifty way to get simple logging (to me, there is a big gulf between the two; perhaps this is exacerbated by the specifics of the platform I am looking to use this on). |
I am trying to backport ycecream to Python 2.7, but it's a lot of work and I am not sure whether it will be successful. |
The funny thing is that I often get that error when setting up a normal Python installation, and I have to install distutils from elsewhere. I don't know why, it's really weird, Python packaging in general is a mess. That said, you might still be able to install it. @jkyeung try downloading https://raw.githubusercontent.com/gruns/icecream/stickytape/single_file/single_file_icecream.py and see if that works for you. You can use |
Unfortunately it doesn't:
That's using CPython 2.7.14 on Windows 10. I got the same thing with iSeriesPython. I tried not deleting the temporary directory, just to make things more human-readable, and got this:
My understanding of the Python import system is too weak to say why it fails there. I will say that installing icecream via pip works fine for CPython 2.7 on Windows, so I tried just copying over the various pip-installed directories from Windows to the IBM i... and it seems to have worked! But it's basically unusable when running interactively with iSeriesPython (the codes used for coloring show up as extra gibberish characters, completely overwhelming the actual content). It's a little better for batch mode use, but still not great. Interactive mode snippet:
Batch mode snippet:
Now you see why I wasn't interested in the colorization. Is there any way to turn it off? |
Nice! Sounds like different Python versions need different packages. What are interactive and batch mode?
from icecream import ic, stderrPrint
ic.configureOutput(outputFunction=stderrPrint)
# or
ic.configureOutput(outputFunction=print) This should definitely be clarified in the README, at least so that searching the page for 'col' finds something. |
Ycvecream is now available under Python 2.7. |
I've updated the PR to make separate packages for each python version, try https://raw.githubusercontent.com/gruns/icecream/stickytape/single_file/icecream_py27.py |
Looks like it works! Thank you! I have to say, the stickytape approach feels... heavy. Startup time is pretty gruesome, and deleting the temporary directory feels like a shame after all that work building it, only to have to build it again next time. I realize my situation is weird (I do have permission to install stuff, yet cannot use pip and the like). Perhaps the stickytape-generated file has value for folks who really aren't allowed to install stuff. (Though for them, I think ycecream is a very attractive alternative to icecream.) For me, if I do wind up using icecream regularly from iSeriesPython, I'll just use copy-installed versions of the dependencies.
Interactive mode is what everyone is used to. You type a command and it runs immediately, potentially with real-time user interaction. Batch mode is from the mainframe days (it would not be a gross mischaracterization to say IBM i is descended from IBM mainframes), where you submit a job to a queue and the job runs whenever the computer gets around to it. There is no user interaction in batch mode. In batch mode, stdout and stderr default to being redirected to (separate) printed output. And, not that anyone asked, but IBM i does have an AIX compatibility environment, which was underdeveloped in the past but now has a working gcc and near-stock builds of CPython 2.7 and CPython 3.6, each with pip. I haven't tried, but I have no doubt icecream would install and run in the usual fashion with those. The coloring probably even works, if you use an SSH client (such as PuTTY) to log in to that environment. |
I agree, I was surprised to discover that 's how it works. Seems like it should just be an install script that you run once. How long is your startup time? For me it's about 0.12 seconds. |
Aren't you confusing single source file package with a no dependency package? If you have such an all-in-one file, users can just put that one file in their current directory and they have all functionality. The only thing they have to do is pip installing once the required packages. Future versions don't require any pip installing. For me that would be a very acceptable solution. |
No, pip installing the dependencies is the main problem. Future versions of the dependencies are also important, maybe even more important than future versions of icecream itself. And your suggestion doesn't really save the user much trouble over just downloading the icecream directory. I think we've already reached an acceptable solution. The only problems are that it's apparently slow on some machines and the release process could be automated a bit more. And while this problem interested me for a bit, I don't want to go much further. |
@gruns - I am sure I am in a very tiny minority, but I would be interested in a single-file
icecream.py
.My reason for wanting a single file is related to the reason I don't just go ahead and use
ycecream.py
(since I actually am not particularly interested in the color features). I would love to be able to use icecream with an obscure and esoteric implementation of Python that is stuck at 2.7 and does not have pip or any other easy installers.Originally posted by @jkyeung in #58 (comment)
The text was updated successfully, but these errors were encountered: