Skip to content
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

Requirements #138

Closed
dcrystalj opened this issue May 27, 2023 · 7 comments
Closed

Requirements #138

dcrystalj opened this issue May 27, 2023 · 7 comments
Assignees
Labels
🐛 - bug Something isn't working

Comments

@dcrystalj
Copy link

dcrystalj commented May 27, 2023

When I read the following statement

The idea that we have for Coffee is to be the de facto tool to install and build a plugin in Core Lightning

I would expect to have plugins work out of the box but looks like dependencies are not installed but at least for official repo should be ?

Example:

Fresh install

$ coffe remote install backup
...
$ coffee list
● Plugin installed
╭──────────────────────────────────────────────────────────────────────────────────────╮
│ ●   Language   Name     Exec path                                                    │
├──────────────────────────────────────────────────────────────────────────────────────┤
│ ●   python     backup   /home/bitcoin/.coffee/repositories/official/backup/backup.py │
╰──────────────────────────────────────────────────────────────────────────────────────╯

Run

$ lightningd --network=bitcoin --log-level=debug
Traceback (most recent call last):
  File "/home/bitcoin/.coffee/repositories/official/backup/backup.py", line 2, in <module>
    from pyln.client import Plugin
ModuleNotFoundError: No module named 'pyln'

Expectation

I had to manually run pip3 install pyln-client but would expect to coffee handle this for me.

I would also somewhat expect to not need to go to backup dir and need to run.

./backup-cli init --lightning-dir ~/.lightning/bitcoin file:///mypath/lightning.bkp
@vincenzopalazzo
Copy link
Contributor

vincenzopalazzo commented May 27, 2023

Mh you are right, but you paste the wrong command. coffee remote install backup will never work

Assuming that you add the remote in the correct way (check with coffee remote list)

Can you post the result of the following command?

coffee --network <bitcoin network> install backup -v

If I ran the current master I get

➜  coffee git:(master) coffee --network testnet install backup -v                             

Usage:   
  pip3 install [options] <requirement specifier> [package-index-options] ...
  pip3 install [options] -r <requirements file> [package-index-options] ...
  pip3 install [options] [-e] <vcs project url> ...
  pip3 install [options] [-e] <local project path> ...
  pip3 install [options] <archive url/path> ...

no such option: --output
✓ Plugin backup Compiled and Installed
➜  coffee git:(master) 

and this looks like a bug

I had to manually run pip3 install pyln-client but would expect to coffee handle this for me.

You are right

I would also somewhat expect to not need to go to backup dir and need to run.

Mh this looks like more difficult to do currently, there are too many parameters that depends from the user, but I can think a little bit on how to do it

@vincenzopalazzo vincenzopalazzo added the 🐛 - bug Something isn't working label May 27, 2023
@vincenzopalazzo vincenzopalazzo self-assigned this May 27, 2023
vincenzopalazzo added a commit that referenced this issue May 27, 2023
This commit fix the install the poetry plugin by fixing the
command string, with the previous on there was some parsing issue.

Reported-by: @dcrystalj
Link: #138
Signed-off-by: Vincenzo Palazzo <[email protected]>
@vincenzopalazzo
Copy link
Contributor

Could you please test #139 ?

@dcrystalj
Copy link
Author

dcrystalj commented May 27, 2023

I get same output

$ coffee --network testnet install backup -v

Usage:
  pip3 install [options] <requirement specifier> [package-index-options] ...
  pip3 install [options] -r <requirements file> [package-index-options] ...
  pip3 install [options] [-e] <vcs project url> ...
  pip3 install [options] [-e] <local project path> ...
  pip3 install [options] <archive url/path> ...

no such option: --output
✓ Plugin backup Compiled and Installed

But I installed pyln-client already by myself.

🙇 for quick response

I can test this tomorrow.

@vincenzopalazzo
Copy link
Contributor

Yeah I introduced the bug while I was refactoring the code :/

So the PR will fix this for me, let me know if this will be fixed also for you :)

@dcrystalj
Copy link
Author

dcrystalj commented May 28, 2023

I can confirm that #139 fixes issue. 🎉 It also fixes broken coffee show backup command 👍
my test procedure:

pip uninstall pyln-client
sudo rm -rf /home/bitcoin/.coffee
git fetch --all
git checkout macros/poetry_dep
make install
coffee setup /home/bitcoin/.coffee
coffee remote add official https://github.com/lightningd/plugins.git
coffee install backup

regarding

Mh this looks like more difficult to do currently, there are too many parameters that depends from the user, but I can think a little bit on how to do it

What if this would be after install procedure? You get prompt to enter "path" (/mypath/lightning.bkp) and than it runs the command for you?

vincenzopalazzo added a commit that referenced this issue May 28, 2023
This commit fix the install the poetry plugin by fixing the
command string, with the previous on there was some parsing issue.

Reported-by: @dcrystalj
Link: #138
Signed-off-by: Vincenzo Palazzo <[email protected]>
@vincenzopalazzo
Copy link
Contributor

What if this would be after install procedure? You get prompt to enter "path" (/mypath/lightning.bkp) and than it runs the command for you?

Yeah maybe we can add a way with the coffee manifest https://coffee-docs.netlify.app/support-coffee.html to support this case; there are several use cases to get the input from the user, like plugin configuration.

Maybe your request can be included inside the #101

I will open the discussion on github to track this and when I have a good idea we can implement the solution, but in any case I love your suggestion.

Thanks for taking the time to test my PR :) and test coffee

@vincenzopalazzo
Copy link
Contributor

Done #140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 - bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants