beancount / smart_importer

Augment Beancount importers with machine learning functionality.
MIT License
248 stars 29 forks source link

pylint fails, tox depends on wrong version of beancount? #100

Closed johannesjh closed 3 years ago

johannesjh commented 3 years ago

tox -e lint fails, locally as well as in the github ci workflow.

Note: directly calling pylint smart_importer tests succeeds.

Output of running tox -e lint:

$ tox -e lint
...
lint run-test: commands[2] | pylint smart_importer tests
************* Module smart_importer.detector
smart_importer/detector.py:4:0: E0611: No name 'ingest' in module 'beancount' (no-name-in-module)
smart_importer/detector.py:4:0: E0401: Unable to import 'beancount.ingest' (import-error)
************* Module tests.predictors_test
tests/predictors_test.py:3:0: E0611: No name 'ingest' in module 'beancount' (no-name-in-module)
tests/predictors_test.py:3:0: E0401: Unable to import 'beancount.ingest.importer' (import-error)
tests/predictors_test.py:123:28: W0613: Unused argument 'existing_entries' (unused-argument)
tests/predictors_test.py:123:4: R0201: Method could be a function (no-self-use)
tests/predictors_test.py:131:27: W0613: Unused argument 'file' (unused-argument)
tests/predictors_test.py:131:4: R0201: Method could be a function (no-self-use)
************* Module tests.data_test
tests/data_test.py:9:0: E0611: No name 'ingest' in module 'beancount' (no-name-in-module)
tests/data_test.py:9:0: E0401: Unable to import 'beancount.ingest.importer' (import-error)
tests/data_test.py:43:26: W0613: Unused argument 'file' (unused-argument)
tests/data_test.py:43:32: W0613: Unused argument 'existing_entries' (unused-argument)
tests/data_test.py:43:8: R0201: Method could be a function (no-self-use)

------------------------------------------------------------------
Your code has been rated at 8.94/10 (previous run: 8.94/10, +0.00)

ERROR: InvocationError for command /home/jh/repos/beancount/smart_importer/.tox/lint/bin/pylint smart_importer tests (exited with code 14)
_______________________________________________________________________ summary ________________________________________________________________________
ERROR:   lint: commands failed

I think the problem is that tox -e lint uses a different version of beancount https://github.com/beancount/smart_importer/blob/master/tox.ini#L20

yagebu commented 3 years ago

I think the problem is that tox -e lint uses a different version of beancount

Yes, installing the latest release from PyPI would be better (and removing it from the deps in tox.ini). I assume the git install was done to temporarily work around something at some point.

johannesjh commented 3 years ago

With commit 464f066 (pull request #101) the github-ci build succeeds. The sourcehut build fails with error message "No module named 'setuptools'". That is rather strange, setuptools should be part of the python installation, right?

EDIT: There seems to be an AUR package specifically for setuptools https://archlinux.org/packages/extra/any/python-setuptools/ maybe this is missing

yagebu commented 3 years ago

Fixed by #101