donnemartin/gitsome

Xonsh dependency

Opened this issue · 14 comments

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.

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

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.

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

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 e1a9686 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.

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!

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

Sounds good thanks @scopatz.

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?

@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.

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

@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 #36, #42, #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 #54.

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

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

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.

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 :( )