Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
yeti-sh
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
yeti-sh
3y ago
The exception is raised if the command returns a non-zero error code. If it returns a zero error code then the return value of, say, compose.up() contains the command's stdout. In addition stdout can be redirected to a file, o
2.
▲
by
yeti-sh
3y ago
No it does not, in fact; errors or warnings will pop up as an unhandled exception and print: - command actually executed, - snippet of stdout - and snippet of stderr. They can be handled using standard exception techniques.
3.
▲
by
yeti-sh
3y ago
To change the wording in the title of this post would be improper in view of multitude of comments referring to this title. I will consider rebranding this.
4.
▲
by
yeti-sh
3y ago
I feel the majority still uses qwerty keyboards; I assumed that when choosing the name and the shortcut for the tool. Experiences differ, and de gustibus on est disputandum; in my bubble, virtualenv is a must-have for Python development. I
5.
▲
by
yeti-sh
3y ago
I see. The P key isn't that ergonomically placed though; and again, one will have to do this time and again for each virtual environment, right? Why not use native Python methods, namely endpoints, instead, and automate this away?
6.
▲
by
yeti-sh
3y ago
Regarding sync checks which Make has as a built-in feature, I am not yet positive how to best implement it. Maybe something like @pre(file_name=_file_is_in_sync) def build(file_name: Path): ... I believe such libraries
7.
▲
by
yeti-sh
3y ago
> argh & a symlink in /usr/bin. - Is putting a symlink to one of your project directories, probably residing in $HOME, to /usr/bin/ a good practice? - As an alternative one can put a symlink into ~/bin;
8.
▲
by
yeti-sh
3y ago
There are a lot of projects, both commercial and OSS, which have a Makefile for linting, version releases, etc, — and never use its dependency graph feature; or, their usage is so superficial that implementing it, say, - via direct function
9.
▲
by
yeti-sh
3y ago
That's right; Google also published a similar package named `fire`, I used it a lot. > just `python your_file.py` That's actually one of the points. j lint is shorter than python scripts.py lint and the letter
10.
▲
by
yeti-sh
3y ago
An example from the top of my head: compose = sh.docker.compose.bake('-f', 'deploy/dev.yml') … compose.down() … compose.up('--force-recreate', '-d') I feel this is a majo
11.
▲
by
yeti-sh
3y ago
Saying 'GNU Make' particularly was an automatism. When I use Make I do use GNU Make specifically. I do not have experience with BSD Make, or other Make dialects. > did actually do a suitable job of replacing gnu make The title
12.
▲
by
yeti-sh
3y ago
For a Python project, I'd recommend doing this as a dev dependency. * jeeves is the name of the project which I'm advertising, which converts a Python file to a set of commands; * `j` is the name of executable which aformentioned
13.
▲
by
yeti-sh
3y ago
You are right, jeeves doesn't do that. Your example reminds me of how I first learnt to use Make; I built my LaTeX stuff from source when in university. However, dealing with Python mostly in my time in the industry, I scarcely ever ha
14.
▲
by
yeti-sh
3y ago
You can also install a jeeves plugin with pip. Say, pip install jeeves-yeti-pyproject will provide you with jeeves, a bunch of commands, and a pack of dev dependencies which I personally happen to like and to use in my projects. I
15.
▲
by
yeti-sh
3y ago
I looked at pyinvoke before I started jeeves. Roughly, as much as I can recall, there were a few reservations: - no type hints for docs & validation, I wanted them - Makefile in its basic form is very concise and doesn't require a
16.
▲
by
yeti-sh
3y ago
Please elaborate. Do you mean submitting commands via ssh to remote servers from the script? The way I'd recommend to run shell commands from jeeves is `sh` library. It has features for ssh support: https://sh.readthedocs.io
17.
▲
by
yeti-sh
3y ago
I like sh for brevity of its API. I often have to use `_tty_out=False`, but this is easy to fix once and for all commands in a script: my_sh = sh.bake(_tty_out=False) my_sh.do_whatever() The way how sh captures output can appar
18.
▲
by
yeti-sh
3y ago
Thanks, will check this out!
19.
▲
by
yeti-sh
3y ago
Thanks for the point. I've had to deal with argparse-based code (not finding it very enjoyable) but didn't recognize the resemblance.
20.
▲
by
yeti-sh
3y ago
That's right. For projects which only use subset of Make features described by (1) jeeves can be considered an alternative for Make, and I would believe there are quite a few such projects.
21.
▲
by
yeti-sh
3y ago
With interpretable languages, this feature of Make is IMHO rarely called for. Task running is; Makefile still is a standard way to do project maintenance, both locally and CI. jeeves is an attempt to extract that feature of Make, and provid
22.
▲
by
yeti-sh
3y ago
I wouldn't necessarily agree. I've seen may instances of Make particularly being used to run tedious commands — linting, testing, deployment, et cetera; for these things, jeeves can be a perfect replacement. A and B are usually ca
23.
▲
by
yeti-sh
3y ago
Indeed, they are out of scope. But I still would argue this does have something in common with Make — just as Make, jeeves can be used as a command runner, in which role Make is oftentimes used as well. Instead of `make` as entry point for
24.
▲
by
yeti-sh
3y ago
I've never used waf, but from its documentation it would seem that waf is a build system, implementing a concept of a DAG governing build of a project. That implies that waf is rather complicated. jeeves, on the other hand, does no suc
25.
▲
by
yeti-sh
3y ago
Thanks for the hint, I didn't know about this project; will check it out.
26.
▲
by
yeti-sh
3y ago
Thanks! Perhaps this particular robot is running a much more civilized version of Skynet/Cyberdyne firmware. And is sure to be speaking impeccable English.
27.
▲
Show HN: Jeeves – A Pythonic Alternative to GNU Make
(jeeves.sh)
55 points
by
yeti-sh
3y ago
|
84 comments
28.
▲
Show HN: Use Python docstrings as exception messages
(github.com)
7 points
by
yeti-sh
3y ago
|
0 comments