-
Notifications
You must be signed in to change notification settings - Fork 167
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
Fix LibP2P-Daemon installation in setup.py #186
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, let's use binaries in install mode, we just need to figure out how best to store them
:note from @mryab :
|
setup.py
Outdated
def install_libp2p_daemon(build=False): | ||
# verify golang installation if build flag is specified | ||
if build: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In essence, you have two functions with entirely different code. It's best to separate them into two functions with different names
setup.py
Outdated
with cd(os.path.join(tempdir, 'go-libp2p-daemon-master', 'p2pd')): | ||
status = os.system(f'go build -o {os.path.join(here, "hivemind/hivemind_cli", "p2pd")}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure whether the class cd
is necessary. You can use the cwd
argument for subprocess.run if you need to change the directory for your command
setup.py
Outdated
url = 'https://github.com/libp2p/go-libp2p-daemon/archive/master.tar.gz' | ||
dest = os.path.join(tempdir, 'libp2p-daemon.tar.gz') | ||
dest = os.path.join(tempdir, 'libp2p-daemon.tar.gz') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to change the URL to learning-at-home and to pin the version
.circleci/config.yml
Outdated
- run: | | ||
wget https://golang.org/dl/go1.16.2.linux-amd64.tar.gz | ||
tar -C ~/ -xzf go1.16.2.linux-amd64.tar.gz | ||
echo "export PATH=~/go/bin:$PATH" >> $BASH_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to parametrize Go versions for all three pipelines with something like pipeline variables
setup.py
Outdated
def md5(fname): | ||
hash_md5 = hashlib.md5() | ||
with open(fname, "rb") as f: | ||
for chunk in iter(lambda: f.read(4096), b""): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move 4096 to a constant or at least an argument with default value
* Rename ProtoCompileInstall and ProtoCompileDevelop to Install and Develop * Install LibP2P-Daemon on setup install and setup develop * Install Golang in Circle CI builds * Add P2PD binary to gitignore
* Rename ProtoCompileInstall and ProtoCompileDevelop to Install and Develop * Install LibP2P-Daemon on setup install and setup develop * Install Golang in Circle CI builds * Add P2PD binary to gitignore
* Rename ProtoCompileInstall and ProtoCompileDevelop to Install and Develop * Install LibP2P-Daemon on setup install and setup develop * Install Golang in Circle CI builds * Add P2PD binary to gitignore
* Rename ProtoCompileInstall and ProtoCompileDevelop to Install and Develop * Install LibP2P-Daemon on setup install and setup develop * Install Golang in Circle CI builds * Add P2PD binary to gitignore
ProtoCompileInstall
andProtoCompileDevelop
toInstall
andDevelop