lbryio / lbry-sdk

The LBRY SDK for building decentralized, censorship resistant, monetized, digital content apps.
https://lbry.com
MIT License
7.19k stars 483 forks source link

libtorrent installation #3379

Closed calebtuttle closed 3 years ago

calebtuttle commented 3 years ago

When running the integration tests during installation, I got a ModuleNotFoundError for libtorrent. INSTALL.md doesn't contain anything pertaining to libtorrent. Is it assumed most systems already have libtorrent installed?

I'm on Ubuntu 20.04 by the way.

belikor commented 3 years ago

There is a Makefile which has an install target.

make install

This target runs pip install -e ., which will use the existing setup.py. One of the Python packages that is listed there is lbry-libtorrent.

In the past, this library would be installed before running the rest of pip install.

pip install lbry-libtorrent
pip install -e .

This was changed recently but I am not sure why. So you can install lbry-torrent manually (inside the virtual environment preferably).

pip install -e . lbry-libtorrent

https://github.com/lbryio/lbry-sdk/commit/34fc530fba4aadd3101a072c9b849105e6c00714#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52

calebtuttle commented 3 years ago

Interesting. That fixed it. Thank you.

belikor commented 3 years ago

Interesting. That fixed it. Thank you.

How are you running the integration tests?

You are supposed to run

make test-integration

Which basically just runs tox, and lbry-libtorrent seems to be installed there.

calebtuttle commented 3 years ago

I'm running python -m unittest discover tests.integration which is the command listed in INSTALL.md.

I had to install tox, but the tests ran successfully with make test-integration. It seems this command should be in the INSTALL doc? Did I miss this command somewhere else in the documentation?

belikor commented 3 years ago

It seems this command should be in the INSTALL doc?

Yes, I think so. I edited the INSTALL.md recently to clarify the build instructions, but the LBRY main developers also did some changes. I think they should give more clarity to the information, as I believe it has changed over the years.

eukreign commented 3 years ago

To install for unit testing you can combine ., torrent and test:

pip install -e .[torrent,test]

That's how it's done in the github actions workflow: https://github.com/lbryio/lbry-sdk/blob/8304102136526e42000246a05255ae942dda5083/.github/workflows/main.yml#L52