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

Pipx #103

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Pipx #103

wants to merge 4 commits into from

Conversation

kohane27
Copy link

Hello @ideasman42 , hope you're doing well. Thank you for creating nerd-dictation. I'm actually using it right now as I write (speak) this paragraph!

The need for pyproject.toml

I'm on archlinux and I encountered the following problems:

  1. pip3 install vosk:

2023-07-15-14-08-43

  1. The aur vosk-api requires Java 17 to build, which I don't have, and think it's an overkill
  2. The aur nerd-dictation-git requires xdotool but I'm on Wayland

Solution

This PR is a continuation of #60. afaik, it's now favored to use pyproject.toml as a standard way of specifying project metadata, which could be used by pipx. So this PR includes a simple pyproject.toml. Then, users can just install the program with a simple command:

pipx install git+https://github.com/ideasman42/nerd-dictation.git

Thank you!

@ideasman42
Copy link
Owner

Thanks for the PR, I'm not sure what to make of this as we already have package/python from what I can see this adds a second way to package nerd-dictation in the root directory which seems odd.

Can you check if your changes can be integrated into package/python ?

@kohane27
Copy link
Author

Thanks for the PR review!

asfik, the major difference is that package/python requires vosk to be installed globally:

pip is a general-purpose package installer for both libraries and apps with no environment isolation. pipx is made specifically for application installation, as it adds isolation yet still makes the apps available in your shell: pipx creates an isolated environment for each application and its associated packages.

Reasons to favor pipx over pip:

  1. Next Debian/Ubuntu Releases Will Likely No Longer Allow pip install Ouside A Virtual Environment as per https://peps.python.org/pep-0668/ . So ubuntu users will no longer be able to install the vosk dependency with pip3 install vosk
  2. I'm on archlinux and have encountered the problem as depicted in the above pic. The package/python does not work for me because I can't installed vosk globally through pip (same issue described above). I got the ModuleNotFoundError: No module named 'vosk' error
  3. The pyproject.toml format can be adopted by poetry but I personally don't use it. Some users might prefer poetry over pipx

Simply, I just think installing nerd-dictation in an isolated environment is better than requiring and accessing vosk globally. Thank you again for this awesome software!

@ideasman42
Copy link
Owner

Could you move the pyproject.toml into a sub-directory? package/python_pipx for e.g. Since the PR in it's current state makes it seem the changes you have made is the primary/main way to install nerd-dictation, instead of one of the multiple supported ways.

@kohane27
Copy link
Author

Hello, I've looked for a solution to install nerd-dictation through pipx when pyproject.toml is not in the project root directory. It seems to be not supported. Therefore, I've updated the docs to do so manually. The solution is a bit more involved but it's much better than not being able to use the program at all.

I have also updated a bit about the pip instruction steps. Initially I thought pip install package/python means installing nerd-dictation through pypi, but searching through https://pypi.org/search/?q=nerd-dictation yielded no result. Then I reazlied pip install package/python is pointing to the local file from the project root directory to install nerd-dictation through the setup.py.

Cheers!

@kohane27
Copy link
Author

kohane27 commented Aug 5, 2023

Update on the situation: https://www.youtube.com/watch?v=35PQrzG0rG4

@lamyergeier
Copy link

@kohane27 If pipx is not supported, is it better to install vosx in a venv so that it does not clutter the package list?

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

Successfully merging this pull request may close these issues.

4 participants