Things like httpie, jupyter, etc should be provided as pyz and binaries as well, not just pip installable, but python devs don't do that really often.
It's a shame, because cli tools should be black boxes, people should not have to think about the implementation. I regularly see cli python tools that output stack traces on errors, and it should not happen.
Anyway, if you want those tools to be always around, I really encourage you to grap a usb stick, and put them on there as pyz and binaries. It's always nice to have them at hand.
Here is an example procedure for both (run them in a venv).
For pyz files:
python -m pip install shiv --user # (Yes, I realize how ironic this is).
Then:
python -m shiv httpie -o http.pyz -c http
(download httpie, and creates a http.pyz file that will contains httpie and all it's dependancies, plus code to trigger the http command when called)
This will let you do "python http.pyz" anywhere you have a modern python and enjoy httpie without the need to pip install it.
For an exe (this is an example on linux, the commands are a bit different for windows and mac):
python -m pip install nuitka httpie --user
You need to have a C compiler and python headers around as well (gcc on linux will do, E.G: sudo apt install build-essential python3-dev on ubuntu).
Now you have a nice stand alone AppImage you can call with ./http.bin to be used on any linux system, and not care if Python is installed to play with httpie.
Here are the resulting files (available for 5 days) so you can see what it looks like:
My first attempt, and I get "AttributeError: module 'toml.decoder' has no attribute 'TomlPreserveCommentDecoder'"
So careful, far from stable.
I reported it (https://github.com/frostming/pdm/issues/247) because the project is great and I want it to succeed, but I won't put it in prod any time soon. I prefer my package manager to be stable than fancy.
It's also why I don't use poetry and so on in training. There is always some bug that students will encounter later because there are so many config combinations they can encounter, but recent tools have not been as battle tested as we think: the enterprise world is a wild beast.
True, bugs can't be exposed by a few users. People have vastly different environment setup for their Python development. System python, in-venv, pyenv, asdf, homebrew, etc. So I post it here to seek for help testing.
The sematic versioning may be a bit misleading, it is just because there was a big breaking change to support PEP 621, and I marked it as "Alpha" stage.
Poetry shell doesn't work on windows, and it doesn't have named venv which matters for some users. Also it's very slow, require to be installed and use proprietary fields in pyproject.toml.
It's a great tool but there are reasons you might want something else.
Alternative like raw pip, pip tools, or dephell all have various pros and cons.
>doesn't set the name of the project in the prompt
I agree with you there, it's very annoying and I've fallen for it a few times. Having not used Poetry on other platforms yet (still using Pipenv in a few projects), I wasn't even aware that this was a feature.
Not a solution, more a workaround, but on Windows I highly recommend developing using WSL, especially for Python. WSL + pyenv + poetry + VS Code with Remote WSL works amazingly well.
Bit of a plug, but if you crave for that, and more, you can use AutoKey on Linux (not AutoHotKey which is Windows only): https://github.com/autokey/autokey
It will let you bind custom Python scripts to any mouse/keyboard sequence, including words on the fly. It can trigger word replacements just like Espanso (I use it to fill in emails, dates, addresses, timestamps et phone numbers), and of course, Python being Python, it lets you do a lot more.
The UI is probably not as good as Espanso's, and it may be harder to use (you need to script). On the other hand, it provides an API for prompting you with UI to select dates, files, input, etc., has timers and the whole Python 3 stdlib.
Some nice stuff I do with it:
- typing $email/$ phone present me with a list of email addresses/phone num (I have a lot of them) to insert one. Prevents typo. By pass web form limitations.
- $now and $date does something similar with dates (listing of various formats for the current date and a calendar). Very handy for documents and file name. Most of them don't have automated fields set up.
- $paste paste the clip board content, by passing any UI preventing me to do so, and screen/tmux limitations.
- I'm a heavy dynalist users (dynalist.io/) I love this software, but it lacks a lot of features, which are easy to add with AutoKey: just make a macro that inputs a serie of actions.
Hey,
AutoKey is awesome indeed! I've used it myself for a while before developing espanso. In fact, I went through the code-base multiple times to understand how it could be so fast. I learned plenty of things about how the X server works thanks to you :)
You're welcome! Espanso on Linux wouldn't be possible without other open-source projects, so that's the least I can do to give something back to the community :)
> Do you plan to add scripting capabilities to Espanso or do you prefer to focus on the current use case ?
We might add a "macro" feature to add delays and combine multiple keypresses, but I don't see espanso becoming a general "automation" tool. There are already plenty of great options for that (including AutoKey)!
Things like httpie, jupyter, etc should be provided as pyz and binaries as well, not just pip installable, but python devs don't do that really often.
It's a shame, because cli tools should be black boxes, people should not have to think about the implementation. I regularly see cli python tools that output stack traces on errors, and it should not happen.
Anyway, if you want those tools to be always around, I really encourage you to grap a usb stick, and put them on there as pyz and binaries. It's always nice to have them at hand.
Here is an example procedure for both (run them in a venv).
For pyz files:
Then: (download httpie, and creates a http.pyz file that will contains httpie and all it's dependancies, plus code to trigger the http command when called)This will let you do "python http.pyz" anywhere you have a modern python and enjoy httpie without the need to pip install it.
For an exe (this is an example on linux, the commands are a bit different for windows and mac):
You need to have a C compiler and python headers around as well (gcc on linux will do, E.G: sudo apt install build-essential python3-dev on ubuntu).Then:
Wait quite a bit.Now you have a nice stand alone AppImage you can call with ./http.bin to be used on any linux system, and not care if Python is installed to play with httpie.
Here are the resulting files (available for 5 days) so you can see what it looks like:
https://drop.chapril.org/download/a335a8e92f98ee02/#fHC1SvOw...