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

Adds module pylru to list of test dependencies #1652

Closed
wants to merge 2 commits into from

Conversation

osilkin98
Copy link
Contributor

Description

This pull request includes pylru as one of the extra dependencies in setup.py.
Previously, when installing lbrynet from source, once you run the verification step, you'll encounter errors about not being able to find the pylru module.

The tests that encounter this error are the following:

  1. tests.unit.wallet.test_headers
  2. tests.unit.wallet.test_account
  3. tests.unit.wallet.test_ledger
  4. tests.unit.wallet.test_transaction

Here's an example of one such stack trace:

[ERROR]
Traceback (most recent call last):
  File "/home/oleg/PycharmProjects/lbrynet/lbry-venv/lib/python3.7/site-packages/twisted/trial/runner.py", line 530, in loadPackage
    module = modinfo.load()
  File "/home/oleg/PycharmProjects/lbrynet/lbry-venv/lib/python3.7/site-packages/twisted/python/modules.py", line 392, in load
    return self.pathEntry.pythonPath.moduleLoader(self.name)
  File "/home/oleg/PycharmProjects/lbrynet/lbry-venv/lib/python3.7/site-packages/twisted/python/reflect.py", line 308, in namedAny
    topLevelPackage = _importAndCheckStack(trialname)
  File "/home/oleg/PycharmProjects/lbrynet/lbry-venv/lib/python3.7/site-packages/twisted/python/reflect.py", line 255, in _importAndCheckStack
    reraise(excValue, excTraceback)
  File "/home/oleg/PycharmProjects/lbrynet/tests/unit/wallet/test_transaction.py", line 4, in <module>
    from torba.testcase import AsyncioTestCase
  File "/home/oleg/PycharmProjects/lbrynet/lbry-venv/lib/python3.7/site-packages/torba/testcase.py", line 6, in <module>
    from torba.orchstr8 import Conductor
  File "/home/oleg/PycharmProjects/lbrynet/lbry-venv/lib/python3.7/site-packages/torba/orchstr8/__init__.py", line 1, in <module>
    from .node import Conductor
  File "/home/oleg/PycharmProjects/lbrynet/lbry-venv/lib/python3.7/site-packages/torba/orchstr8/node.py", line 15, in <module>
    from torba.server.server import Server
  File "/home/oleg/PycharmProjects/lbrynet/lbry-venv/lib/python3.7/site-packages/torba/server/__init__.py", line 1, in <module>
    from .server import Server
  File "/home/oleg/PycharmProjects/lbrynet/lbry-venv/lib/python3.7/site-packages/torba/server/server.py", line 7, in <module>
    from torba.server.session import SessionManager
  File "/home/oleg/PycharmProjects/lbrynet/lbry-venv/lib/python3.7/site-packages/torba/server/session.py", line 16, in <module>
    import pylru
builtins.ModuleNotFoundError: No module named 'pylru'

tests.unit.wallet.test_transaction

Fixes

The module pylru is simply added as one of the extra dependencies to setup.py and is installed automatically when the user runs pip install --editable .[test].

@codecov
Copy link

codecov bot commented Nov 20, 2018

Codecov Report

Merging #1652 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1652   +/-   ##
=======================================
  Coverage   71.06%   71.06%           
=======================================
  Files         156      156           
  Lines       14049    14049           
=======================================
  Hits         9984     9984           
  Misses       4065     4065

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 8d507c4...478f0f1. Read the comment docs.

@eukreign
Copy link
Member

eukreign commented Nov 20, 2018

This should not be necessary, you may have hit a bug in pip which does not install extras after you've installed without extras initially: pypa/pip#4957

Try running pip install -e .[test] in a fresh python virtual env and pylru will get installed automatically. If look in setup.py you'll see torba[server] and if you look in torba's setup.py you'll see [server] install pylru:

https://github.com/lbryio/torba/blob/ed880be3e5c5bee0f33c3404103a2e9822f98880/setup.py#L49-L53

@eukreign eukreign closed this Nov 20, 2018
@osilkin98
Copy link
Contributor Author

I'm still having this issue and so is @ocornoc

@ocornoc
Copy link
Contributor

ocornoc commented Nov 24, 2018

I followed the INSTALL.md file to the word and got this error. Either INSTALL.md or setup.py needs to be fixed, regardless of whose bug it is.

@eukreign
Copy link
Member

I uploaded a new version of torba to pypi which has the fix for this. I recommend that you guys run torba from source though since it'll always be more up to date than relying on pypi.

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.

3 participants