#๐Ÿ”’ python package

60 messages ยท Page 1 of 1 (latest)

main basin
orchid helmBOT
#

@main basin

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

main basin
rigid juniper
main basin
#
[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

rigid juniper
#

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

main basin
rigid juniper
#

That tells me nothing about your setup.py file

main basin
#

I did also notice that when I pip install it puts parser in root of site-packages

rigid juniper
#

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?

main basin
#

instead of within ytmd_sdk

main basin
rigid juniper
#

So I assumed you were maybe still using your setup.py or setup.cfg since you can still do a hybrid approach

main basin
#

so I guess I am using adhoc aka flat-layout

#

interesting...

rigid juniper
#

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?

main basin
#

not sure

#

#python-discussion message

rigid juniper
#

Right, that's an example which may not be copy-pastable for you.

#

Since it's assuming a very specific layout there

main basin
#

gotcha...

rigid juniper
#

Try removing that section and relying on automatic discovery, see if that gets you closer

main basin
#

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

rigid juniper
#

was parser specifically uninstalled previously?

main basin
#

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...

rigid juniper
#

I wonder if it's a namespace thing

main basin
#

this is what it looks like after uninstall ytmd_sdk

rigid juniper
#

try this in your pyproject.toml

[tool.setuptools.packages]
find = {namespaces = false}
main basin
#

same result

#

( I just copy and pasted. not sure if I was suppose to change anything )

rigid juniper
#

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

main basin
#

I can remove __init__.py if that helps

#

It's just a habit to create __init__.py

rigid juniper
#

You can try, but the behavior might get a bit wonky if it's not a package

main basin
#

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
rigid juniper
#

It shouldn't, test and tests are part of the flat layout default exclude

main basin
#

yea it did

#

this is so messed up lol

main basin
#

yup

rigid juniper
#

remove that and try again

main basin
#

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

orchid helmBOT
#
Python help channel closed

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.