git / github workflow in stash
stashconf py_traceback 1
then run the command
Thanks. As I started stash to do this, I got a tip with that exact same line for enabling tracebacks. Funny - or scary, depending on how you see the world.
Here's the trace:
Traceback (most recent call last): File "/private/var/mobile/Containers/Shared/AppGroup/447A26CB-FA57-4E8A-8C34-082F55AD274F/Pythonista3/Documents/site-packages/stash/system/shruntime.py", line 498, in exec_py_file exec code in namespace, namespace File "site-packages/stash/bin/gh.py", line 44, in <module> import github File "/private/var/mobile/Containers/Shared/AppGroup/447A26CB-FA57-4E8A-8C34-082F55AD274F/Pythonista3/Documents/site-packages/stash/lib/github/__init__.py", line 37, in <module> from MainClass import Github, GithubIntegration File "/private/var/mobile/Containers/Shared/AppGroup/447A26CB-FA57-4E8A-8C34-082F55AD274F/Pythonista3/Documents/site-packages/stash/lib/github/MainClass.py", line 34, in <module> import jwt ImportError: No module named jwt
Hmm, okay, pygithub now depends on pyjwt. It used to be dependency free, so could just install it directly.
pip install pyjwt
should fix the issue, though i will have to update gh to maybe use pip to install pygithub (or install a specific version).
@JonB, thanks, installing pyjwt - not jwt - fixed the issue.
Does gh actually work for you? I note that jwt requires
cryptographyfor certain algorithms, you can be forced to use pycrypto/ecsda instead. Just curious if anything we are using requires that.
@JonB, yes, it worked, to the extent that new key was added to the github account. Further testing later.
shtek last edited by
just tried git push.
first generate rsa key using ssh-keygen
then add the generated pub key to my site,
[pythonistascripts]$ git push Attempting to push to: email@example.com:shtek/pythonistascripts.git, branch: refs/heads/master stash: <type 'exceptions.TypeError'>: expected a string or other character buffer object
I don't know what this error means, but after I check the code site, I find that everything has been successfully pushed.
so this is an ignorable error?
Yes, it is. Or just update StaSh to dev (selfupdate -f dev) where this is fixed already.
shtek last edited by shtek
edit readme on GH and forget to pull before push, my GH changes are lost
tested on my git site, same problem.
never thought this could happen. maybe sometimes this is useful ...... I don't need to delete the repo and rebuild it to change history :)
It's a bug. Never ever do this in repos where someone else has access as well.