NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.65k stars 13.8k forks source link

Offer way to limit python modules exposed by a package #109460

Open jonringer opened 3 years ago

jonringer commented 3 years ago

In https://github.com/NixOS/nixpkgs/issues/81482 , we had two packages which incorrectly exported a test module, we solved this with a specific shell hook which removed just that directory, but it might be nice to make this generic as now there's another issue with two packages exporting an examples modules.

maybe something like:

  removePythonModules = [ "examples" ];

and the hook would be something like:

  for module in ${removePythonModules[@]}; do
    echo "Removing @sitePackages@/${module}"
    rm -r $out/@sitePackages@/${module}
  done

cc @FRidh

FRidh commented 3 years ago

Basically extending https://github.com/NixOS/nixpkgs/pull/81538 but then with additional modules the user can add. Sounds good to me.

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info