narwhals-dev / narwhals

Lightweight and extensible compatibility layer between dataframe libraries!
https://narwhals-dev.github.io/narwhals/
MIT License
391 stars 51 forks source link

[Enh]: consider switching to `src` layout #881

Open EdAbati opened 2 weeks ago

EdAbati commented 2 weeks ago

We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below?

No response

Please describe the purpose of the new feature or describe the problem to solve.

AFAIK the "src-layout" should be preferred to the "flat-layout"

Some opinions:

  • The src layout helps prevent accidental usage of the in-development copy of the code.
  • The src layout helps enforce that an editable installation is only able to import files that were meant to be importable.

source

If you use the ad hoc layout without an src directory, your tests do not run against the package as it will be installed by its users.

source

I think it will also simplify the build and make sure we don't include files/directories we don't need. (see #879)

Of course, if we merge this change, all the open PRs will have to fix conflicts. It will be better to schedule well a change like this one (before a sprint for example :) )

Suggest a solution if possible.

No response

If you have tried alternatives, please describe them below.

No response

Additional information that may help us understand your needs.

Happy to hear what you all think! 👀

FBruzzesi commented 2 weeks ago

As mentioned in the community call, I don't have any strong opinion on the topic. I never had issues with the flat layout, yet if you see advantages switching to the source one, I won't be opposing 🙌🏼

It will be better to schedule well a change like this one (before a sprint for example :) )

You have my full support on this 😂