After reading part of the source code of old version distribution tool ‘setuptools/distutils’ and current packaging tool ‘Packaging’, there are some good findings for me, and that’s why I just write them here. With the reading day after day, many interesting things will be found, so this post is just in a ‘To Be Continue’ status.
Rename two different distribution/packaging tool here: name ‘setuptools/distribution’ as ‘D1’, name ‘packaging’ as ‘D2’
1 from the point of file structure, the kernel of D1 is Cmd.py, while D2 is Run.py
D1: everything is done by different commands, which must derive from Command class
D2: every command should run if things wantted to be done, and that’s why there is an important Dispatcher class in Run.py
2 install is just a kind of Command in D1, while building blocks in D2
D1: install is a subclass of Command, and all subcommands will be excuated in its run function, e.g. install_lib, install_data, install_scripts, and so on.
D2: install is just a building block for different installers, and it also support three install methods here – packaging-install, setuptools-install, distributions-install, just for backward compatibility reason. Install.py can also be run as script and all of the corresponding subcommands, e.g. install_lib, install_data, will be run in the Install_dist.py
To be continue…