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
You should do git mv dcm2bids src/dcm2bids, and fix up all things that breaks. Not doing this means any code run from the root of the directory (which is..most dev code) will use the uninstalled version, and that will not always be correct, particularly when trying to use relative imports or package-installed data. #110 is exactly the sort of bug this quirk (bug? problem?) of python leads to, and src/ is a workaround for it.
Your tests do not run against the package as it will be installed by its users. They run against whatever the situation in your project directory is.
But this is not just about tests: the same is true for your application. The behavior can change completely once you package and install it somewhere else.
The first link summarizes a PyPA summit from last year:
single module packages should use flat layout.
*REPL breaks when using src/ (you can't import module) and we considered this to be an important detail for first-time packagers who only want to share a script.
Anything beyond a single module being packaged, should use the src/ directory.
The text was updated successfully, but these errors were encountered:
Repeating the advice I found for spinalcordtoolbox/spinalcordtoolbox#3161:
You should do
git mv dcm2bids src/dcm2bids
, and fix up all things that breaks. Not doing this means any code run from the root of the directory (which is..most dev code) will use the uninstalled version, and that will not always be correct, particularly when trying to use relative imports or package-installed data. #110 is exactly the sort of bug this quirk (bug? problem?) of python leads to, andsrc/
is a workaround for it.See:
The first link summarizes a PyPA summit from last year:
The text was updated successfully, but these errors were encountered: