You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that, currently, kondo only deletes __pycache__ directories located in the root of a Python project, but this is not the only place they can occur (and often there isn't even one in the root). A __pycache__ directory can be created in any directory containing a .py file, and .py files can be organized in any arbitrary assortment of directories with any depth.
The text was updated successfully, but these errors were encountered:
Do you have any good resources I could read about python project structures?
Not really. In a perfect world, this would all be documented at https://packaging.python.org, but that site is still lacking in many respects after many years.
Note that __pycache__ technically isn't specific to Python "projects" (if you're defining a project as anything more than a quick script) but rather something created by the python interpreter itself when an import statement is processed1; this link seems like a good overview.
For example is it possible to "nest" python projects, or are all directories underneath considered part of the same "project"?
I believe best practice is against trying to nest projects, but there are various ways to abuse some of the tooling to achieve nested projects. However, I don't think I've ever actually seen nested Python projects, and you should be fine with not trying to support such a (mis)feature.
Footnotes
Unlike in Rust, in Python it's perfectly normal to write code without involving the packaging systems. ↩
It seems that, currently,
kondo
only deletes__pycache__
directories located in the root of a Python project, but this is not the only place they can occur (and often there isn't even one in the root). A__pycache__
directory can be created in any directory containing a.py
file, and.py
files can be organized in any arbitrary assortment of directories with any depth.The text was updated successfully, but these errors were encountered: