ApeWorX / ape

The smart contract development tool for Pythonistas, Data Scientists, and Security Professionals
https://apeworx.io
Apache License 2.0
889 stars 131 forks source link

bug: plugins do not show in `ape plugins list` despite being installed with `pip install` and working to compile #98

Closed sabotagebeats closed 2 years ago

sabotagebeats commented 3 years ago

Environment information

$ docker run -it sabotagebeats/eth-ape-test
root@abe22411a892:/# ape --version
0.1.0a15
root@abe22411a892:/# ape plugins list
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
INFO: No plugins installed
root@abe22411a892:/# pip freeze | grep ape
ape-solidity==0.1.0a1
ape-vyper==0.1.0a6
eth-ape==0.1.0a15
root@abe22411a892:/# ape plugins add solidity
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
Error: Cannot add 1st class plugin 'ape_solidity'
root@abe22411a892:/# ape plugins add vyper
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
Error: Cannot add 1st class plugin 'ape_vyper'
docker run -it sabotagebeats/eth-ape-test
root@656e07a000ea:/# apt-get install git
[truncated]
root@656e07a000ea:/# git clone https://github.com/brownie-mix/vyper-token-mix && cd vyper-token-mix && ape compile
Cloning into 'vyper-token-mix'...
remote: Enumerating objects: 49, done.
remote: Counting objects: 100% (49/49), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 49 (delta 14), reused 45 (delta 11), pack-reused 0
Unpacking objects: 100% (49/49), 9.41 KiB | 1.05 MiB/s, done.
INFO: Compiling 'contracts/Token.vy'
100%|█████████████████████████████████████| 20.4M/20.4M [00:40<00:00, 502kiB/s]
root@656e07a000ea:/vyper-token-mix# ll .build/
total 20
drwxr-xr-x 2 root root  4096 Jul 19 23:40 ./
drwxr-xr-x 8 root root  4096 Jul 19 23:40 ../
-rw-r--r-- 1 root root 10667 Jul 19 23:40 __local__.json

What went wrong?

the plugins are not showing in ape plugin list but they are available and usable.

Please include information like:

How can it be fixed?

The plugin registration system will need to be reworked I believe.

sabotagebeats commented 3 years ago

after a uninstall and pip install -e .

$ pip uninstall ape-vyper ape-solidity
$ apt-get install git
$ git clone https://github.com/apeworx/ape-vyper
$ cd ape-vyper && pip install -e .

I do see the plugin in ape plugins list

root@b491be310717:/ape-vyper# ape plugins list
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
Installed plugins:
  ape_vyper (0.1.0a6)
sabotagebeats commented 3 years ago

plugins are also not showing up when added with ape plugins add

>docker run -it sabotagebeats/eth-ape-test
root@b54e2eb6fda3:/# pip uninstall ape-vyper ape-solidity
Successfully uninstalled ape-solidity-0.1.0a1
root@b54e2eb6fda3:/# ape plugins list
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
INFO: No plugins installed
root@b54e2eb6fda3:/# ape plugins add solidity
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
Install unknown 3rd party plugin 'ape_solidity'? [y/N]: y
INFO: Installing ape_solidity...
root@b54e2eb6fda3:/# ape plugins add vyper
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
Install unknown 3rd party plugin 'ape_vyper'? [y/N]: y
INFO: Installing ape_vyper...
root@b54e2eb6fda3:/# ape plugins list
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
INFO: No plugins installed
fubuloubu commented 3 years ago

This one is weird....

$ docker run -it sabotagebeats/eth-ape-test
root@abe22411a892:/# ape --version
0.1.0a15
root@abe22411a892:/# ape plugins list
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
INFO: No plugins installed
root@abe22411a892:/# pip freeze | grep ape
ape-solidity==0.1.0a1
ape-vyper==0.1.0a6
eth-ape==0.1.0a15
root@abe22411a892:/# ape plugins add solidity
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
Error: Cannot add 1st class plugin 'ape_solidity'
root@abe22411a892:/# ape plugins add vyper
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
Error: Cannot add 1st class plugin 'ape_vyper'

This makes sense, I don't think Docker can modify the image dynamically, at least not without additional configuration

$ docker run -it sabotagebeats/eth-ape-test
root@b54e2eb6fda3:/# pip uninstall ape-vyper ape-solidity
Successfully uninstalled ape-solidity-0.1.0a1
root@b54e2eb6fda3:/# ape plugins list
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
INFO: No plugins installed
root@b54e2eb6fda3:/# ape plugins add solidity
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
Install unknown 3rd party plugin 'ape_solidity'? [y/N]: y
INFO: Installing ape_solidity...
root@b54e2eb6fda3:/# ape plugins add vyper
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
Install unknown 3rd party plugin 'ape_vyper'? [y/N]: y
INFO: Installing ape_vyper...
root@b54e2eb6fda3:/# ape plugins list
WARNING: $GITHUB_ACCESS_TOKEN not set, skipping 2nd class plugins
INFO: No plugins installed
sabotagebeats commented 3 years ago

so I have been trying this docker run -it -v $HOME/.ape:/root/.ape -v $HOME/.vvm:/root/.vvm -v $HOME/ape/vyper-token:/root/project -w /root/project apeworx/eth-ape-docker:0.1.0a22 but then still having the issue INFO: No plugins installed

I know at least the VVM plugin is installed however because I can compile vyper

fubuloubu commented 3 years ago

so I have been trying this docker run -it -v $HOME/.ape:/root/.ape -v $HOME/.vvm:/root/.vvm -v $HOME/ape/vyper-token:/root/project -w /root/project apeworx/eth-ape-docker:0.1.0a22 but then still having the issue INFO: No plugins installed

I know at least the VVM plugin is installed however because I can compile vyper

So, this sort of makes sense. I think the image is not saving the plugin install when using docker run, and it has to be in the build file for the image

sabotagebeats commented 3 years ago

So, this sort of makes sense. I think the image is not saving the plugin install when using docker run, and it has to be in the build file for the image

oh hmm, maybe I can link the volume to the plugin install, is it not in .ape?

fubuloubu commented 3 years ago

So, this sort of makes sense. I think the image is not saving the plugin install when using docker run, and it has to be in the build file for the image

oh hmm, maybe I can link the volume to the plugin install, is it not in .ape?

The plugin install would be the python site packages folder, not the ape folder

sabotagebeats commented 3 years ago

let me play around trying to link that but i think it may break

NotPeopling2day commented 2 years ago

Adding a comment about behavior discovered during plugin installation regarding GITHUB_ACCESS_TOKEN environmental variable: The ape plugins list command won't list installed plugins without the GITHUB_ACCESS_TOKEN set Plugins can be installed without it set, but do not show they were installed

antazoey commented 2 years ago

This original issue is the same as this I am pretty sure: https://github.com/ApeWorX/ape/issues/229

It had to do with site-packages versus -e installs.

This issue has been resolved as of #230 .