-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add support for part query from TME #164
Conversation
I am very glad to see this PR. I am stuck with tow broken and casted forearms, so I am grateful that you work on this.
I would simply add this as a submodule. |
5996336
to
d3116f3
Compare
Oh no. Get well soon!
Works for me. I've added it as a submodule. |
Thanks @spike77453 I will need to review this PR soon, in the meantime do you mind fixing the style? |
41cc23e
to
ee135d8
Compare
Sure thing! Style checks should now pass. |
c492004
to
e102f80
Compare
Thanks for fixing the style. Two things:
$ python -m kintree_gui
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/francois/development/Ki-nTree/kintree_gui.py", line 2, in <module>
from kintree.kintree_gui import main
File "/home/francois/development/Ki-nTree/kintree/kintree_gui.py", line 3, in <module>
from .gui.gui import kintree_gui
File "/home/francois/development/Ki-nTree/kintree/gui/gui.py", line 4, in <module>
from .views.main import (
File "/home/francois/development/Ki-nTree/kintree/gui/views/main.py", line 19, in <module>
from ...database import inventree_interface
File "/home/francois/development/Ki-nTree/kintree/database/inventree_interface.py", line 8, in <module>
from ..search import search_api, digikey_api, mouser_api, element14_api, lcsc_api, tme_api
File "/home/francois/development/Ki-nTree/kintree/search/tme_api.py", line 3, in <module>
from .tme.tmeapi import Client
ModuleNotFoundError: No module named 'kintree.search.tme.tmeapi'
|
Did you initialise the submodule or clone the branch with
That should work just fine.
I'll open an issue at https://github.com/krzych82/api-client-python3 and ask. |
@spike77453 Following up on that, did you ask the owner of the package if it's fine to use his code and/or rewrite it? |
Request had been made: However it seems that there is a code with similar functionality in this repo which has proper licensing: Maybe it would be easier to port to this? |
Hi. |
Thanks @krzych82 👍 @spike77453 Can you please pull the |
ebd5a7b
to
90b0451
Compare
@eeintech I've updated the submodule to its remote master (to include the license file) and rebased this feature branch to main. Let me know if that works for you. Since https://github.com/krzych82/api-client-python3/ was licensed under GPLv3.0 is should be permissible to just copy tmeapi.py into |
@spike77453 The GUI is still failing to run, try to store the file inside the project in in this case? I'd rather that option than a submodule. Thanks! |
104b1d0
to
3443c77
Compare
I've opted to reimplement the functionality of https://github.com/krzych82/api-client-python3. The API examples/snippets TME give in their documentation are MIT licensed (https://github.com/tme-dev/TME-API/blob/master/Python/call.py) so that should be fine. Hope that works for you. |
327debe
to
e8a20dd
Compare
@spike77453 Works for me! There still is an error in the CI: Traceback (most recent call last):
File "/home/runner/work/Ki-nTree/Ki-nTree/kintree_gui.py", line 2, in <module>
from kintree.kintree_gui import main
File "/home/runner/work/Ki-nTree/Ki-nTree/kintree/kintree_gui.py", line 3, in <module>
from .gui.gui import kintree_gui
File "/home/runner/work/Ki-nTree/Ki-nTree/kintree/gui/gui.py", line 10, in <module>
from .views.settings import (
File "/home/runner/work/Ki-nTree/Ki-nTree/kintree/gui/views/settings.py", line 87, in <module>
tme_api_settings['TME_API_TOKEN'],
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
Error: Process completed with exit code 1. |
I'm afraid that's nothing I can fix. You'd have to specify an API token, probably via an encrypted secret: https://github.com/sparkmicro/Ki-nTree/blob/main/.github/workflows/test_deploy.yaml#L43-L53 |
@spike77453 I think the right syntax would be: |
e8a20dd
to
822f0ef
Compare
My bad! I added default configuration files but forgot to load them in: https://github.com/sparkmicro/Ki-nTree/compare/e8a20dd8c7caa95673c3ec8da173892d0752275d..822f0ef1703c47081e062c83bb781e718e1de302 |
Great, thanks @spike77453 I'll prepare a new release |
This adds support for part query from TME (Transfer Multisort Elektronik: https://www.tme.eu, headquartered in Poland).
kintree/search/tme_api.py is taken directly from #115. I hope @martonmiklos doesn't mind.
I'm not entirely sure how to handle the dependency on https://github.com/krzych82/api-client-python3 here:
https://github.com/sparkmicro/Ki-nTree/compare/main...spike77453:Ki-nTree:feature_tme_support?expand=1#diff-b2540e137995506e90ad635a1dbee24c1017fae8e8ade9e7da60628af46da9f8R6
Upstream neither provides a pypi release nor a
seutp.py
orpyproject.toml
so it cannot be easily installed via pip, etc.Feedback, pointers, and suggestions are welcome.