green-code-initiative / ecoCode-challenge

Emboard in the hackhatons serie for improving ecoCode
4 stars 5 forks source link

[DRAFT][Python] Packaging tools configuration (team 904000m2) #57

Open LordPatate opened 1 year ago

LordPatate commented 1 year ago

When distributing Python packages, some configurations of packaging tools (setuptools, hatchling, flit, pdm) could be more energy consuming than others.

Example: automatic package discovery using setuptools

Non compliant

Using automatic package discovery

[options]
# ...
package_dir =
    = src
    # directory containing all the packages (e.g.  src/mypkg, src/mypkg/subpkg1, ...)

Compliant

Each package is named, which saves the effort of finding the packages.

[options]
#...
packages =
    mypkg
    mypkg.subpkg1
    mypkg.subpkg2
jhertout commented 6 months ago

This issue might be interesting however documentation and measure are missing. I do not thing we can embed this rule with so few information.