-
Notifications
You must be signed in to change notification settings - Fork 112
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
Convert this to a Python package so it becomes a CLI installable by pipx #55
Comments
Hello. Thanks for suggesting this! I am totally on board with the wish to make the project easier to use for less technical people. But does this suggestion simplify the installation? Previously they had to:
With this suggestion they have to:
It does avoid the save-as issue (#17) that some people are hitting. But now people have to read two sets of installation instructions: for Python and then pipx. And for devs there's a maintenance burden of keep the pipx version up to date? Edit: Also, it makes it harder for users to tweak the script. You don't even need to understand python to change I'd appreciate others' thoughts on this. |
From the perspective of someone not used to handle Python scripts: the first (and current) scenario is simpler to understand in my eyes because it doesn't require and Python-specific tools (what's pipx?).
Yes, because you also have to do this when dealing with scripts written in other languages. That's common ground. |
Hi @timhutton You're welcome to take it or leave it depending on how you see it improving or degrading the experience. But I think it is simpler in this regard. You suggested the steps are:
But pipx can be installed by package managers so it's:
Compared to the current:
That said, I don't know if pipx is available in winget (thought it would be easy to make it so I'm sure). One other thing that occurred to me after posting this: This is not a replacement of how things work. It's flexibility. There is no reason you couldn't say: To use this tool, just download parse.py and .... Or if you use pipx, you can simply Having it available to install as a CLI tool for Python doesn't mean they can't do what you are recommending now. |
@mikeckennedy Yes, it could live alongside our current instructions, it's a good point. Can we talk about the maintenance of a pipx package? It's not something I've done before. Does it require manual updates? Could we need to set up a github actions for it? |
That's a good question. pipx doesn't own or maintain packages. It is simply a tool that installs python packages from pypi.org by automatically creating isolated venvs and puts them commands in the path. So the question becomes: How is the maintenance of a python package on pypi. It can be automated. Have a look at these GH Action details:
So if you can get that action set up (sorry I have zero experience with it), then it would be pretty automatic I think. |
Alternatively, you could have a more complex install statement:
Rather than just |
The more I think about this, I would recommend just letting it pipx install out of the github repo. It's adds zero extra effort to maintain and keep in sync. And it still allows the pipx install + global command experience. |
See #58 for an idea how to implment it (it works on my machine :-)). |
Thanks @jankatins I already have it implemented with pyproject.toml and hatch (the latest recommendation from python) in the branch I referenced before: https://github.com/mikeckennedy/twitter-archive-parser/tree/installable I just needed two things from @timhutton before I did a PR.
BTW, yours and mine are quite similar but I chose shorter CLI names and use hatchling rather than setuptools (based on this guidance from python). But I don't really care which one Tim wants to adopt. |
What am I doing wrong on Ubuntu WSL?
Edit: Ah, this one worked:
|
So I have it running via pipx, which is great. But I must be missing something, because this seems much easier:
And has the advantage that the user gets the source code and can edit it locally. Is the problem that python is harder to install than pipx on macOS? |
I think this has a name clash on your system: it tries to import it from the so file instead of the parser.py one :-( The other branch puts the parser.py into a subdir and thats how that works . So the problematic part is that the file is named 'parser.py' and in the root of the repo instead of a package or having a more specific name. Advantages of pipx from my perspective:
|
Hey @timhutton Agree with everything @jankatins said above. And, it's easier in a sense. But you're assuming several things are preconditions.
pipx handles all of these in a single Moreover, as Jan said about the clean API, it also allows them to run the command in multiple directories without copying the parser.py over and over. It becomes a global command. |
I recommend that you convert this to a Python package so it becomes a CLI installable by pipx. This will dramatically simplify usage for end users.
Let's assume you want to name it
twitter_archive
on pypi.org, then:I created a proof of concept with these CLI names but they are just a name in a file, we can call them whatever you'd like.
https://github.com/mikeckennedy/twitter-archive-parser/tree/installable
Here it is in action:
Are you interested in this? Just let me know what you want the package name, and CLI command names to be and I'll send you a PR.
The text was updated successfully, but these errors were encountered: