astropy / quantity-2.0

Prototype of Quantity 2.0 (experimental)
2 stars 3 forks source link

use src-layout #7

Open nstarman opened 5 days ago

nstarman commented 5 days ago

Let's use the modern package layout before we're too entrenched!

There are many benefits:

  1. .egg files are not dumped in the top namespace
  2. package build tools default settings are to find packages in src directories. We currently need less config and guarantee we will need less config no matter what build system we use over time.
  3. The src layout also makes having support packages much easier.

As potential examples

src/
    quantity/*  # core library
    quantity_mpl/  # installed if extra [mpl]. This manages matplotlib interop
    quantity_xarray/  # manages xarray interop
mhvk commented 6 hours ago

Despite having destroyed the src layout when I used the openastronomy template, I am fine with using it for this new package -- I still dislike that src no longer is something that needs to be put in a compiler, but not so much that I cannot see the advantages (and perhaps we're going there anyway with mypyc...).

mhvk commented 6 hours ago

That said, if we're going the walled-garden approach, it seems a little superfluous. The example is not super convincing: why would that not work without src? Or an extras/mpl and extras/xarray?

Also, checking our current pyproject.toml, I'm also not quite sure that it actually simplifies anything (especially if tests get moved out).

mhvk commented 6 hours ago

Anyway, with a bit of further thought, since I don't really care, let's just move to the src layout.