Skip to content

Adding Plugin System #628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Nov 7, 2020
Merged

Adding Plugin System #628

merged 25 commits into from
Nov 7, 2020

Conversation

joseph-flinn
Copy link
Contributor

@joseph-flinn joseph-flinn commented Aug 30, 2020

Adding most of the logic for the Plugin System from #530. I have done some initial manual testing and it seems to be working.

Design Decisions:

  • All plugin methods run after their tmuxp config counter parts (ie. the global before_script in the tmuxp config will run before anything in the plugin.before_script method)
  • Require list type for plugins even if only a single plugin
  • Assuming that the plugin.on_window_create method is referring to when tmuxp is creating new windows versus the user creating a new window in tmux
  • Assuming that the plugin.after_window_finished method is referring to after the window is done being setup versus when the tmux user closes the window

Currently missing:

  • updated unit tests
  • updated documentation

@joseph-flinn joseph-flinn changed the title Adding Plugin System WIP: Adding Plugin System Aug 30, 2020
@codecov
Copy link

codecov bot commented Sep 27, 2020

Codecov Report

Merging #628 (ceb7b6b) into master (888b2b3) will increase coverage by 2.06%.
The diff coverage is 92.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #628      +/-   ##
==========================================
+ Coverage   73.53%   75.60%   +2.06%     
==========================================
  Files           7        8       +1     
  Lines        1043     1123      +80     
  Branches      268      283      +15     
==========================================
+ Hits          767      849      +82     
+ Misses        202      198       -4     
- Partials       74       76       +2     
Impacted Files Coverage Δ
tmuxp/config.py 85.94% <66.66%> (-0.24%) ⬇️
tmuxp/cli.py 72.20% <87.50%> (+2.55%) ⬆️
tmuxp/plugin.py 95.34% <95.34%> (ø)
tmuxp/exc.py 95.83% <100.00%> (+0.59%) ⬆️
tmuxp/workspacebuilder.py 89.08% <100.00%> (+1.65%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 888b2b3...ceb7b6b. Read the comment docs.

@joseph-flinn joseph-flinn marked this pull request as ready for review October 13, 2020 14:54
@joseph-flinn joseph-flinn requested a review from tony October 13, 2020 14:54
@joseph-flinn joseph-flinn force-pushed the plugin-system branch 2 times, most recently from fea9868 to f7f369a Compare October 13, 2020 15:14
@joseph-flinn joseph-flinn changed the title WIP: Adding Plugin System Adding Plugin System Oct 13, 2020
@joseph-flinn joseph-flinn changed the title Adding Plugin System WIP: Adding Plugin System Oct 18, 2020
@joseph-flinn joseph-flinn marked this pull request as draft October 18, 2020 23:08
Copy link
Member

@tony tony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joseph-flinn Try rebasing (I fixed an issue with poetry), running poetry install and then make black isort

@tony
Copy link
Member

tony commented Oct 24, 2020

Lets aim to get this in the next release (and last Python 2.7 release)

This will assure packaged versions of tmuxp on BSD/Linux and systems using python 2.7 have a plugin system.

@joseph-flinn joseph-flinn marked this pull request as ready for review October 24, 2020 21:35
@joseph-flinn joseph-flinn changed the title WIP: Adding Plugin System Adding Plugin System Oct 24, 2020
@joseph-flinn
Copy link
Contributor Author

Note: The bump in version is required for the extensive testing of the plugin system. The test plugins all depend on tmuxp version 1.6.0 (I believe this is the next release that will contain this feature?)

@tony
Copy link
Member

tony commented Oct 25, 2020

Note: The bump in version is required for the extensive testing of the plugin system. The test plugins all depend on tmuxp version 1.6.0 (I believe this is the next release that will contain this feature?)

Yes, this version bump and the constraint seems appropriate.

@tony
Copy link
Member

tony commented Nov 1, 2020

@joseph-flinn Can you rebase this? (I know from email you're not around today)

@tony
Copy link
Member

tony commented Nov 6, 2020

@joseph-flinn Can you try rebasing instead of merge? e.g. git pull --rebase origin master + git push --force-with-lease ?

@joseph-flinn
Copy link
Contributor Author

@joseph-flinn Can you try rebasing instead of merge? e.g. git pull --rebase origin master + git push --force-with-lease ?

Whoops, yep. I thought I did the rebase instead of the merge. I don't think I finished the complete mental context switch on Sunday

@joseph-flinn
Copy link
Contributor Author

Oh, I just remembered that I used the rebase on github.com instead of doing it locally. I guess I won't do that again.

@tony
Copy link
Member

tony commented Nov 7, 2020

@joseph-flinn technically the command (e.g. git pull origin master --autostash) depends on what tmuxp-python/tmuxp is set to

Since I don't know what your remotes are named, here is what it'd be if tmux-python and joseph-flinn are set:

git remote add tmux-python git+ssh://git@github.com/tmux-python/tmuxp.git
git remote add joseph-flinn git+ssh://git@github.com/joseph-flinn/tmuxp.git

Then:
git pull tmuxp-python master --autostash
git push --force-with-lease -u joseph-flinn plugin-system

@tony
Copy link
Member

tony commented Nov 7, 2020

@joseph-flinn Nice! You pushed it seconds after I wrote that, I guess you figured it out before! 😊

@joseph-flinn
Copy link
Contributor Author

joseph-flinn commented Nov 7, 2020

Yeah, that merge was my bad. I tried "resolving the conflicts" through github.com last weekend instead of doing it locally and must of have hit merge instead rebase + merge.

@tony
Copy link
Member

tony commented Nov 7, 2020

@joseph-flinn https://tmuxp.git-pull.com/history.html#tmuxp-1-6-0-2020-11-06

You can rebase again, there's a conflict though (tmuxp/cli.py)

Let's aim to get this in tomorrow (Sunday latest)

Once its in master we will be able to dogfood it on our local machines

@joseph-flinn
Copy link
Contributor Author

joseph-flinn commented Nov 7, 2020 via email

@tony
Copy link
Member

tony commented Nov 7, 2020

@joseph-flinn If you'd like to rebase this you can

I will try to merge this in this afternoon/evening/tomorrow

joseph-flinn and others added 24 commits November 7, 2020 11:21
…with python for testing purposes. Started rudimentary config testing. Started working on the cli.load_plugins test.
…nto the workspacebuilder and changed the reattach to take in a builder object instead of a session so that it can access those plugins.
…pdating corresponding tests. Starting on the documentation
…lugin function and corresponding tests. Add a way to skip loading a plugin if it failed to load
@tony tony merged commit 611119f into tmux-python:master Nov 7, 2020
@tony
Copy link
Member

tony commented Jan 9, 2021

@joseph-flinn

It's live :)

https://pypi.org/project/tmuxp/1.7.0/

https://tmuxp.git-pull.com/history.html#tmuxp-1-7-0-2021-01-09

@tony tony mentioned this pull request Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants