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
So 1210 out of 7526 python modules have a mainProgram. And also a lot of them (most?) don't have a toPythonApplication in top-level.
So now we have 3 approaches to package a python application:
use python3Packages.buildPythonApplication, and put it in pkgs/by-name.
use buildPythonPackage and put in pkgs/development/python-modules, and add a toPythonApplication entry in all-packages.nix
use buildPythonPackage and put in pkgs/development/python-modules, and let users write python3Packages.foo
Solution
If the upstream documentation doesn't mention it can be used as a python module, then only 1 is correct. If upstream doesn't mention but there do have some examples, then toPythonModule should be used (but we can also tolerate toPythonApplication and put in python-modules).
If it's primarily used as a module, but also has some useful executables, then 2 is correct. If it's only used as a python module, or the executable doesn't have external use cases (for example, is serving the needs of the module), then only 3 is correct.
This should be explicitly documented and anti-patterns should be removed
The text was updated successfully, but these errors were encountered:
I don't think having a top-level alias is a necessity. If any of those are only tools and don't provide an API, they should be removed from python3Packages. But having mainProgram is not a sufficient condition.
Problem
I just discovered that in
pkgs/development/python-modules
:So 1210 out of 7526 python modules have a
mainProgram
. And also a lot of them (most?) don't have atoPythonApplication
in top-level.So now we have 3 approaches to package a python application:
python3Packages.buildPythonApplication
, and put it inpkgs/by-name
.buildPythonPackage
and put inpkgs/development/python-modules
, and add atoPythonApplication
entry in all-packages.nixbuildPythonPackage
and put inpkgs/development/python-modules
, and let users writepython3Packages.foo
Solution
If the upstream documentation doesn't mention it can be used as a python module, then only 1 is correct. If upstream doesn't mention but there do have some examples, then
toPythonModule
should be used (but we can also toleratetoPythonApplication
and put inpython-modules
).If it's primarily used as a module, but also has some useful executables, then 2 is correct. If it's only used as a python module, or the executable doesn't have external use cases (for example, is serving the needs of the module), then only 3 is correct.
This should be explicitly documented and anti-patterns should be removed
The text was updated successfully, but these errors were encountered: