donnemartin / gitsome

A supercharged Git/GitHub command line interface (CLI). An official integration for GitHub and GitHub Enterprise: https://github.com/works-with/category/desktop-tools
Other
7.54k stars 437 forks source link

Xonsh dependency #25

Open CJ-Wright opened 8 years ago

CJ-Wright commented 8 years ago

Would it be possible to have xonsh as a dependency? I run my own copy of bleeding edge xonsh and would love to layer this on top of my existing copy.

scopatz commented 8 years ago

I would also like to see this happen, if possible. I fully understand the motivation for wanting to have few hard dependencies. For example, in xonsh we bundle our own copy of PLY, in case the user doens't have it installed. We try-except all of the PLY imports to test this. See https://github.com/scopatz/xonsh/blob/master/xonsh/parsers/base.py#L5

donnemartin commented 8 years ago

Thanks for filing this.

I'd like to move towards having xonsh as a dependency instead of bundled with gitsome. I think this will take a fair amount of work and some PRs to xonsh, so it might take some time.

CJ-Wright commented 8 years ago

Could you outline what work you are expecting it to take/what changes to xonsh need to be made?

donnemartin commented 8 years ago

This needs some curating, but for now here's the raw list of changes to the bundled xonsh:

https://github.com/donnemartin/gitsome/commits/master/xonsh?page=1

I'll also need to look at the initial xonsh merge e1a96860885c96d74dcadd77c2a052b380b170d0 to verify I didn't include any additional changes with that commit.

The xonsh merge was from back in November 2015, so some patches might be needed to get the latest xonsh version working with gitsome.

I also intend to move gitsome to prompt-toolkit 1.0.0, not sure if xonsh is compatible with the latest prompt-toolkit.

scopatz commented 8 years ago

Thanks @donnemartin! It looks like some of these may have been implemented in upstream xonsh, though others have not.

I also intend to move gitsome to prompt-toolkit 1.0.0, not sure if xonsh is compatible with the latest prompt-toolkit.

Yes we are!

scopatz commented 8 years ago

Please let us know if there is anything specific that you'd like help with.

donnemartin commented 8 years ago

Sounds good thanks @scopatz.

jankatins commented 8 years ago

So, do I understand that right that the most important problem right now is that gitsome uses xonsh to start gitsome, so to make it useable in a plain xonsh it would need some hooks in xonsh so that it can be started there?

I did some naive grepping in the included version of xonsh:

c:\data\external\gitsome\xonsh (master)
λ grep -R "gitsome"
base_shell.py:        self.gitsome = None
base_shell.py:        t = 'gitsome'
main.py:from gitsome import __version__ as gitsome_version
main.py:                    version='/'.join(('gitsome', gitsome_version)),
main.py:    click.echo('Version: ' + gitsome_version)
prompt_toolkit_completer.py:from gitsome.completer import CompleterGitsome
prompt_toolkit_completer.py:        self.completer_gitsome = CompleterGitsome()
prompt_toolkit_completer.py:        completions_gitsome = \
prompt_toolkit_completer.py:            self.completer_gitsome.get_completions(document,
prompt_toolkit_completer.py:            self.completer_gitsome.build_completions_with_meta(line,

prompt_toolkit_completer.py:        completions_gitsome.extend(completions_with_meta)
prompt_toolkit_completer.py:        for comp in completions_gitsome:

If this looks right, then there needs to be an extension point for completions and it would be nice to include the version numbers of the extension in the xonsh version information?

donnemartin commented 8 years ago

@janschulz thanks for the quick investigation! That does seem like it might be a hurdle.

I'm currently working on GitHub Enterprise support and fixing some bugs. Next I'd like to go through these actions to identify other TODOs to have xonsh as a dependency.

mrsipan commented 8 years ago

Making xonsh a dependency will also make vi-mode available which gitsome seems to be missing.

donnemartin commented 8 years ago

@mrsipan you're right :)

Here's a quick update on some TODOs.

I'm currently working on GitHub Enterprise support and fixing some bugs. Next I'd like to go through these actions to identify other TODOs to have xonsh as a dependency.

GitHub Enterprise support is now complete with https://github.com/donnemartin/gitsome/pull/36, https://github.com/donnemartin/gitsome/pull/42, https://github.com/donnemartin/gitsome/pull/43.

I also intend to move gitsome to prompt-toolkit 1.0.0, not sure if xonsh is compatible with the latest prompt-toolkit.

Updating to prompt-toolkit v1.0.0 is also complete with https://github.com/donnemartin/gitsome/pull/54.

I'll try to start looking into the actions from the following comment later this week.

scopatz commented 7 years ago

Pinging this again as it seems to have become a problem for the debian package: http://git.net/ml/general/2017-02/msg22441.html

donnemartin commented 7 years ago

Hi @scopatz, sorry just been really busy to make progress on this ticket. It might be a few months before I free up to make a dent.

ghost commented 6 years ago

Any updates? I can't run gitsome when many of my other apps require python3.6 (And I dunno much about python to figure out how to have 2 python3 versions at once :( )