PySnooper icon indicating copy to clipboard operation
PySnooper copied to clipboard

Feature request: Script to pack PySnooper to single file

Open sarthak0415 opened this issue 5 years ago • 4 comments

I do not have permission to do pip install on my enterprise machine, can this be used as a regular package?

sarthak0415 avatar Apr 23 '19 06:04 sarthak0415

Feature request: Script to pack PySnooper to single file, including all of its dependencies, so it could be copy-pasted into a machine without installing.

Feel free to work on this, @sarthak0415 .

cool-RR avatar Apr 23 '19 07:04 cool-RR

If you can't run pip install globally on your machine you have two straight-forward options:

  1. Clone this repository and run python setup.py develop. This strategy will always refer to your cloned source code (you can simply run git pull in the repo location to update to the latest version). (Explanation)
  2. Install the package as a user package: pip install --user pysnooper. This strategy will install the package just for your user and doesn't require elevated privileges. (Explanation)

bittner avatar Apr 23 '19 07:04 bittner

I was reminded of this issue by the issue linked above. I'm still trying to understand why people want this kind of thing. @sarthak0415, were you able to follow the instructions by @bittner?

If it is important, it looks like https://pypi.org/project/stickytape/ can help.

alexmojaki avatar Feb 26 '21 22:02 alexmojaki

@alexmojaki I'll try to explain: Some people have shitty corporate setups, they've got code running in convoluted ways with Python files being copied in weird ways, hacks to sys.path, sometimes multiple conflicting paths in PYTHONPATH. Sometimes you've got a program that has a Python scripting capability, but you have to enter your script in a certain way because it wasn't meant to deal with packages.

In these circumstances, a single Python file has a better chance of working with no problems.

Normally, I wouldn't think it's worth it to go to such lengths for people who can't get their shit together. But, since the entire premise of PySnooper is that it's usable in bad setups... I think it's a good feature to have. I won't spend time developing it, but I'll review if anyone will work on it.

cool-RR avatar Feb 27 '21 08:02 cool-RR