gitsome icon indicating copy to clipboard operation
gitsome copied to clipboard

Xonsh dependency

Open CJ-Wright opened this issue 8 years ago • 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.

CJ-Wright avatar May 13 '16 19:05 CJ-Wright

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

scopatz avatar May 13 '16 19:05 scopatz

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.

donnemartin avatar May 14 '16 00:05 donnemartin

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

CJ-Wright avatar May 14 '16 00:05 CJ-Wright

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.

donnemartin avatar May 14 '16 22:05 donnemartin

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 avatar May 16 '16 16:05 scopatz

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

scopatz avatar May 16 '16 16:05 scopatz

Sounds good thanks @scopatz.

donnemartin avatar May 17 '16 11:05 donnemartin

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?

jankatins avatar May 25 '16 14:05 jankatins

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

donnemartin avatar May 26 '16 02:05 donnemartin

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

mrsipan avatar May 26 '16 04:05 mrsipan

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

donnemartin avatar Jun 01 '16 03:06 donnemartin

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

scopatz avatar Feb 20 '17 17:02 scopatz

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.

donnemartin avatar Feb 21 '17 02:02 donnemartin

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

ghost avatar Nov 29 '17 07:11 ghost