https://github.com/KillerBOSS2019/YTMD_SDK
unable to import correctly. @rigid juniper
60 messages ยท Page 1 of 1 (latest)
https://github.com/KillerBOSS2019/YTMD_SDK
unable to import correctly. @rigid juniper
@main basin
Remember to:
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
https://github.com/KillerBOSS2019/YTMD_SDK/blob/main/pyproject.toml
this is the pyproject.toml file
So you are using setuptools are your build-backend. Do you have an additional setup.py or setup.cfg file?
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"
yup. I do deleted those setup file
I can get them back with git history thing hehe
well, right now your package doesn't have anything discoverable to import. So I suspect there might be something wonky in your extra setuptools stuff
Because even though pip can build it... if it's building nothing it'll work, just not as intended
That tells me nothing about your setup.py file
https://github.com/KillerBOSS2019/YTMD_SDK/blob/6dfe29472dced1e3e2bc96daaf773a90282bda5b/setup.py
this is what I had before with setup.py
I did also notice that when I pip install it puts parser in root of site-packages
okay, your project has since changed though. For instance your package directory name is now ytmd_sdk. So did you update your setup.py file when you changed that?
instead of within ytmd_sdk
well, one of the helper/mod ( can't remember ) told me I should switch to pyproject.toml as setup.py is old outdated
So, you don't follow either format what the setup tools auto-discovery can detect. So you need to manually list out your packages and where to find them. But you don't do that either
So I assumed you were maybe still using your setup.py or setup.cfg since you can still do a hybrid approach
you aren't though. It's close, but that's now what your project layout is
oh wait, no
hold on
You do override the automatic discovery. Why?
Right, that's an example which may not be copy-pastable for you.
Since it's assuming a very specific layout there
gotcha...
Try removing that section and relying on automatic discovery, see if that gets you closer
hmm... that worked. but also have odd behavior
I made sure to uninstall old build. and reinstall. It created 2 root folder in site-packages
a parser and ytmd_sdk
was parser specifically uninstalled previously?
yup. I made sure of that.
I also checked ytmd_sdk-1.0.0.dist-info and it does say it put parser folder in root and another one within ytmd_sdk
very odd...
I wonder if it's a namespace thing
this is what it looks like after uninstall ytmd_sdk
try this in your pyproject.toml
[tool.setuptools.packages]
find = {namespaces = false}
hurm... this is a bit past my wheel house right now. Might be worth asking in #packaging-and-distribution how to alter the auto-discovery to not pull subpackages into the root when you install it.
I think it's still namespacing because of the __init__.py in the parser
You can try, but the behavior might get a bit wonky if it's not a package
oh wait it also included test folder too??
c:\users\damie\documents\tp-ytdm-plugin\.env\lib\site-packages\test\*
(.env) PS C:\Users\Damie\Documents\TP-YTDM-Plugin> pip uninstall ytmd-sdk
Found existing installation: ytmd-sdk 1.0.0
Uninstalling ytmd-sdk-1.0.0:
Would remove:
c:\users\damie\documents\tp-ytdm-plugin\.env\lib\site-packages\parser\*
c:\users\damie\documents\tp-ytdm-plugin\.env\lib\site-packages\test\*
c:\users\damie\documents\tp-ytdm-plugin\.env\lib\site-packages\ytmd_sdk-1.0.0.dist-info\*
c:\users\damie\documents\tp-ytdm-plugin\.env\lib\site-packages\ytmd_sdk\*
Proceed (Y/n)? y
Successfully uninstalled ytmd-sdk-1.0.0
It shouldn't, test and tests are part of the flat layout default exclude
do you still have this?
yup
remove that and try again
let me delete .env and make new one to make sure...
ig it was happening before and I didn't notice it until now
I think my brain is about to explode lol
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.