How to make a python installation module (setup.py) python write a simple setup.py

python setup.py --help-commands

How to install Python modules:

1. Single-file module: copy the file directly to $python_dir/lib
2. Multi-file module with setup.py: python setup.py install         
3. egg file, similar to Java jar:
1) Download ez_setup.py, run python ez_setup   
2) easy_install *.egg

Although Python modules can be copied and installed, it is generally recommended to make an installation package, that is, write a setup.py file to install.

Use of the setup.py file:
% python setup.py build #compile
% python setup.py install #install
% python setup.py sdist #make distribution package
% python setup.py bdist_wininst #make distribution package under windows
% python setup. Writing of py bdist_rpm

setup.py file:

Setup.py mainly executes a setup function, most of which are descriptive things, the most important is the packages parameter, which lists all packages, and can use the built-in find_packages to dynamically obtain packages. So the writing of the setup.py file is actually very simple.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325229363&siteId=291194637