Add suppliers Automation Direct and Jameco
Combined both new suppliers into one branch and closed #247.
As noted in PR #247, I found a few typos and exclusions that were only caught when a $HOME config directory did not exist yet. I had not tried launching the GUI without a .config/kintree directory. I tested removing the auto-created config directory, and it appears to load now without errors.
Also stripped spaces from supplier name when imported from suppliers.yaml config file to avoid problems like "AutomationDirect" vs. "Automation Direct". Might be even better to strip all non-alpha characters and then convert to lower (or upper) case so the supplier == '<suppliername>' checks can be more dependable, and not depend on user-configuration naming quite as much, but that would require changing a lot of other suppliers' code.
While working through that, I found without API keys configured for those suppliers that need them, the terminal would just indicate the part was not found. For clarity, I added a few Warning messages to the terminal that indicate API settings were not configured, etc. They don't show in the GUI, but it's nice to have some kind of message in the terminal to indicate the part wasn't found because the API config for that supplier hadn't been set yet.
I fixed some style errors from the CI checks.
Note: I ran the checks before, but it seems flake8 doesn't like the "*.py" syntax. It errored out, and therefore didn't run checks on most files. I removed the *.py from the list of directories, and it found errors.
This is what I used in tasks.py that seemed to work okay without errors:
c.run('flake8 --extend-ignore W503 \
tasks.py run_tests.py kintree_gui.py kintree/kintree_gui.py kintree/setup_inventree.py \
kintree/common/ kintree/config/ kintree/database/ kintree/kicad/ kintree/search/ \
kintree/gui/gui.py kintree/gui/views/')
Tests failed when trying to import cloudscraper. Added cloudscraper dependency with poetry. Hopefully it'll build now. Still trying to run "invoke test" locally so as to try to fix these bugs before github tests check them, but I can't figure out how to get around the error [TREE] Error connecting to InvenTree server: invalid address, username or password.
I can't figure out how to get around the error
[TREE] Error connecting to InvenTree server: invalid address, username or password.
I'm not sure either yet, right now I'm just relaunching the CI and sometimes it connects fine.
@hillsandales pllease add the modules you import to the requirements/setup.
I used cloudscraper in one section. I've added a line in requirements.txt for the version pip installed in my venv. Is there any additional location other than requirements.txt and Poetry configs that need to be changed? I updated Poetry settings in an earlier commit.
@T0jan I think you were right to disable the image/PDF download in run_tests.py, my original sample list of test parts make the CI run forever... We should make sure to update this in the next PR.
@eeintech have you changed something on the dataset or the settings? because here: https://github.com/sparkmicro/Ki-nTree/actions/runs/9716167622/job/26819561587 the run took "only" 6 minutes and apparently tested all datasheet downloads. So it seems like the problem is with the image downloads and the lengthy timeouts we have there.
@T0jan I don't believe I changed anything, or at least not intentionally... The messaging is quite new to me also.
Good news the CI passed after... 75 minutes 😅