-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Pylint is not using a src/ folder #5644
Comments
I'm not really a big fan of moving everything around as it will screw up -0.5 for me. |
Same. Major projects like |
FYI @DanielNoord the Also git improved quite a bit with the latest version, so renames are detected much better. Just to document this. |
After #8902 and the number of hours sunk into investigating subtle issues, I'm now a fan of doing this. We should at least have a discussion about it. |
I'm fine with it if we double check that |
I'm not worried about git blame being broken, the imports should not change, so even small files with import only should be correctly detected as moved not deleted. I'm not using the SRC folder structure in any of my project but I'll get used to it :D |
I'm also a fan of doing this after having everything come crashing down at my day job because of issues related to this. Let's do this for the next major release. @CarliJoy Are you still interested in pursuing this and potentially creating a PR? All maintainers seem aligned. |
@DanielNoord I am sorry I fell victim to But I am happy to help if there are any troubles arising from the migration. |
That's understandable. I don't think I have time to pick this up myself, but I'd like to thank you for making the original issue :) |
Bug description
Pylint does not have a src folder
Led me into problems developing and test at least from time to time.
Here an exmplaination stolen why this a good idea:
Why does PyScaffold ≥ 3 have a
src
folder which holds the actual Python package?This avoids quite many problems compared to the case when the actual Python package resides in the same folder as
your configuration and test files.
A nice blog post by Ionel gives a thorough explanation why this is so. In a nutshell, the most severe
problem comes from the fact that Python imports a package by first looking at the current working directory and then
into the
PYTHONPATH
environment variable. If your current working directory is the root of your project directoryyou are thus not testing the installation of your package but the local package directly. Eventually, this always
leads to huge confusion ("But the unit tests ran perfectly on my machine!").
Moreover, having a dedicated
src
directory to store the package files, makes it easy to comply with recent standardsin the Python community (for example
PEP 420
).Please notice that PyScaffold assumes all the files inside
src
are meant to be part of the package.Configuration
No response
Command used
Pylint output
Expected behavior
no problem because src folder prevents them
The text was updated successfully, but these errors were encountered: