My rssita.py python code has the following lines:
from feeds import RSS_FEEDS
from termcolors import PC
and this is the corresponding directory tree:
(rssita-py3.10) (base) bob@Roberts-Mac-mini rssita % tree
.
├── README.md
├── poetry.lock
├── pyproject.toml
├── setup.cfg
├── src
│ └── rssita
│ ├── __init__.py
│ ├── feeds.py
│ ├── rssita.py
│ └── termcolors.py
└── tests
├── __init__.py
└── test_feeds.py
With this setup I can run rssita.py fine from both the command line (from the activated poetry venv) and from Visual Studio Code (also using the right venv).
On the other end with this setup, pylint fails:
(rssita-py3.10) (base) bob@Roberts-Mac-mini rssita % pylint src
************* Module rssita.rssita
src/rssita/rssita.py:12:0: E0401: Unable to import 'feeds' (import-error)
src/rssita/rssita.py:13:0: E0401: Unable to import 'termcolors' (import-error)
Also in Visual Studio Code, those imports are flagged as:
Unable to import 'feeds' (pylint(import-error)
As a last issue, pre-commit runs passing all, including pylint, peraphs because I set 8 as a threshold under which it fails and the score is 8.47 (but the errors are there). Here is the relevant .pre-commit-configuration snippet:
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: python
types: [python]
args: [--fail-under=8, --enable="W", --recursive=y, -rn,]
What do I need to do to fix and reconcile running the script from command line and Studio, and pylint from command line and pre-commit?