Skip to content

Add Python version#12

Open
kontrolunitesi wants to merge 2 commits intoislemci:mainfrom
kontrolunitesi:main
Open

Add Python version#12
kontrolunitesi wants to merge 2 commits intoislemci:mainfrom
kontrolunitesi:main

Conversation

@kontrolunitesi
Copy link

The code has been turned into Python, you told me that you would be fixing the docs and README accordingly, so I didn't touch it.

Tests might fail too! You will need to change them (sorry)

This code completes the Python transition with CLIwrap.
This is not needed, as it might create problems when downloaded with cliwrap.py.
@islemci islemci self-assigned this Dec 21, 2024
@islemci islemci added the enhancement New feature or request label Dec 21, 2024
@islemci
Copy link
Owner

islemci commented Dec 21, 2024

And all tests fail, lol.

@nxjosephofficial can we test the code in your system (FreeBSD/csh-tcsh) if possible?

Code runs great on zsh and bash.

@ghost
Copy link

ghost commented Dec 21, 2024

Can we keep both shell version together with python version or are we going to keep only python? Workflow test are failing because shell version of cliwrap has been deleted and it tries to run chmod +x ./cliwrap which should have been chmod +x ./cliwrap.py instead. Also, python version of cliwrap does not have a python shebang, that makes it less likely to be run it with ./cliwrap.py, it has to be run with python ./cliwrap.py. I will test the python version on FreeBSD, csh/tcsh and let you know if it works. Workflow should run cliwrap.py with python to be able to test python version. Are we going to package cliwrap in python? That would make it easier to install like via pip. I don't know how to package a python project.

@ghost
Copy link

ghost commented Dec 21, 2024

Shell version

yusuf@hale ~/Documents/cliwrap % ./cliwrap -csh

   _____ _      _____
  / ____| |    |_   _|
 | |    | |      | |_      ___ __ __ _ _ __
 | |    | |      | \ \ /\ / / '__/ _` | '_ \
 | |____| |____ _| |\ V  V /| | | (_| | |_) |
  \_____|______|_____\_/\_/ |_|  \__,_| .__/
                                      | |
                                      |_|

Parsing history file: /home/yusuf/.history


Top Tools
---------------------------------
Usage Count | Command
---------------------------------
 151 ls
  91 sudo
  81 git
  50 pkg
  49 doas
  48 tmux
  48 ssh
  44 cd
  40 msync
  36 go
---------------------------------


Top Full Commands
---------------------------------
Usage Count | Command
---------------------------------
  63 sudo su
  42 tmux a
  28 doas -s
  19 ssh nxjoseph.com
  19 go run .
  11 ssh debian
  11 go run ./
  11 git status
  10 edit .config/tmux/tmux.conf
   8 zfs list -t snapshot
---------------------------------

Your top tool is 'sudo'. Keep rocking your terminal!
Total Commands Executed:     2000
yusuf@hale ~/Documents/cliwrap %

Python version

yusuf@hale ~/Documents/cliwrap % python cliwrap.py


   _____ _      _____
  / ____| |    |_   _|
 | |    | |      | |_      ___ __ __ _ _ __
 | |    | |      | \ \ /\ / / '__/ _` | '_ \
 | |____| |____ _| |\ V  V /| | | (_| | |_) |
  \_____|______|_____\_/\_/ |_|  \__,_| .__/
                                      | |
                                      |_|


Parsing history file: /home/yusuf/.history


Top Tools
---------------------------------
Usage Count | Command
---------------------------------
151 | ls
91 | sudo
81 | git
50 | pkg
49 | doas
48 | ssh
48 | tmux
44 | cd
40 | msync
36 | go
---------------------------------


Top Full Commands
---------------------------------
Usage Count | Command
---------------------------------
111 | ls
63 | sudo su
42 | tmux a
40 | msync
28 | doas -s
19 | ssh nxjoseph.com
19 | go run .
12 | clear
11 | git status
11 | ssh debian
---------------------------------

Your top tool is sudo su. Keep rocking your terminal!
Total Commands Executed: 2000
yusuf@hale ~/Documents/cliwrap %

Python version doesn't seem to work correctly. Should cliwrap count top tool from "top tools" or "top full commands"?

@kontrolunitesi
Copy link
Author

Can we keep both shell version together with python version or are we going to keep only python? Workflow test are failing because shell version of cliwrap has been deleted and it tries to run chmod +x ./cliwrap which should have been chmod +x ./cliwrap.py instead.

Feel like two seperate files would be harder to maintain. And for workflow issues, I am sure @islemci will fix in the .github/ directory.

Are we going to package cliwrap in python? That would make it easier to install like via pip. I don't know how to package a python project.

Homebrew supports Python projects (just a little edit in the ruby config is enough), and pretty sure it will be supported in AUR too (i think it was maintained by @xeyossr, he probably would know it better). This just makes it a bit harder to setup project without package managers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants