Skip to content
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

What is the relationship between pypyp and pyp (by thepyedpiper / Sony)? #35

Open
nealmcb opened this issue Mar 3, 2024 · 4 comments
Open

Comments

@nealmcb
Copy link

nealmcb commented Mar 3, 2024

Over time, I've run across and used both this and pyp from https://github.com/thepyedpiper/pyp, and am now very confused.

History?
Compatibility?
Feature comparison?
Can both be installed at the same time (outside a virtualenv)?

@nealmcb
Copy link
Author

nealmcb commented Mar 3, 2024

Now I see that you do note the original pyp from thepyedpiper in your Readme - sorry to have missed it.
But the confusion has increased recently. While you say that one is "unmaintained", a new version came out in December 2023:
"Pyed Piper Celebrates its 10 Year Anniversary with an Epic Update!"
... retooled to Python 3 ...

So it might help to e.g. allow this one to be run as pypyp, so both can run at the same time, and discuss some of the similarities and differences.

@hauntsaninja
Copy link
Owner

hauntsaninja commented Mar 3, 2024

Thanks for the issue!

Wow, surprised to see Pyed Piper back from the dead after ten years :-) I'd emailed Toby Rosen at some point too, but never heard back.

I just added pypyp as an entrypoint in 4999c07. This means (once I make a release (edit: 1.2 is now released)) that you should be able to use them both in the same environment provided you install pypyp first.

I also updated the README with some more description: ab80ed9

I talk about tools in general here: https://github.com/hauntsaninja/pyp#piep--spy--pyfil--pythonpy--oneliner

I think Pyed Piper matches the following two bullet points

  • Some of them have custom syntax for in-process command chaining, which can be convenient.
  • Some of them expose the input in interesting ways with custom line / file / stream objects.

Hopefully that's of any use, and do let me know if you have more questions :-)

@nealmcb
Copy link
Author

nealmcb commented Jul 22, 2024

Excellent - I finally got back to trying to figure this out again. I need to keep better notes....

My one suggestion for now would be to refer to the command using the name used to run it. E.g. I get this with 1.2 now, which would be confusing to those running the other version of pyp.

$ pypyp
usage: pyp [-h] [--explain] [-b CODE] [-a CODE] [--define-pypprint] [--version] code [code ...]

@nealmcb
Copy link
Author

nealmcb commented Jul 22, 2024

It seems to me that in order to have both running at the same time, it needs a bit more smarts. E.g. this works when the original pyp is not installed. But when both are installed, I get:

$ seq 1 5 | pypyp 'sum(map(int, lines))'
Traceback (most recent call last):
  File "/home/neal/.local/bin/pypyp", line 5, in <module>
    from pyp import main
ImportError: cannot import name 'main' from 'pyp' (/home/neal/.local/lib/python3.10/site-packages/pyp/__init__.py)

Note also that if, on top of pypyp, you pip install pyp and then pip uninstall pyp (to fix the errors above), that will first overwrite and then delete pyp from ~/.local/bin//pyp. So I had to unistall and reinstall pypyp to get the original command back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants