Filtering out directories in the case of flat layout #3403
Replies: 4 comments 9 replies
-
Just to clarify: I do understand that enabling scanning for namespace packages will include any packages without an |
Beta Was this translation helpful? Give feedback.
-
Thank you very much @codeandfire for starting this discussion. I think this topic is related to #3259. My view on the subject is the following:
I think that if we want to improve user experience we could go here with a more pedagogical approach, e.g. identify when the scanning results in multiple top-level packages + the user did not specify a |
Beta Was this translation helpful? Give feedback.
-
@abravalheri, if I may ask you another somewhat related question in this thread: shouldn't developers, typically, not require to configure the If I have understood the src-layout correctly, the There might be special cases ... For example, I recall an example you had suggested for Please feel free to correct me in case I have missed understanding anything here. |
Beta Was this translation helpful? Give feedback.
-
Hi @codeandfire, I will try my best to reply to the questions 😅. I think there might be a problem with the terminology I am currently using and/or the terminology in the docs. We might want to change terms to facilitate the understanding.
I agree with the following:
Indeed if the user is using the I see the manual discovery as a escape hatch for the cases when the project layout is too customised and automatic discovery does not work. For the sake of simplicity/consistency it makes sense to me that Do you have a different view or suggestion of how this should work? I would like to keep the decision tree as small as possible (there is already too many choices...). I am also baking on the hope that moving forward people will simply leave the |
Beta Was this translation helpful? Give feedback.
-
Hi,
The Package Discovery docs page states that
and names such as
docs
,tests
,examples
etc. are listed below as names of files/folders which will be filtered out.There is also a warning note on that page which states the following:
and goes on to give an example of a project containing a namespace package that has top-level directories such as
docs
andtests
which end up getting installed along with the actual package.So in summary, if we use a flat layout, as long as we do not enable scanning for namespace packages, Setuptools will filter out directories such as
docs
,tests
, etc., but if we do enable scanning for namespace packages, such directories will end up getting included unless we add some more configuration such as theexclude
argument (or move to an src-layout). I also ran some tests to confirm whether the actual behaviour matches that stated in the docs and indeed this is the case.My question is: what is stopping us from filtering out directories such as
docs
,tests
etc. even in the case of namespace packages? Is this just a feature that hasn't been implemented yet, or is any of this intentional and there is something I am missing here?Beta Was this translation helpful? Give feedback.
All reactions