问题
How pip
decide to run setup.py bdist_wheel
againest legacy setup.py install
on a package?
回答1:
I think it is described somewhere! but I dont know exacly where. maybe in one PEP.
The main check of whether to create a wheel or not is in https://github.com/pypa/pip/blob/develop/pip/wheel.py#L773
the pip.index.egg_info_matches
checks basename of your package with r'([a-z0-9_.]+)-([a-z0-9_.!+-]+)'
. That means setup.py
containing folder name must be in form of mypackage-anything
in first place! otherwise the above check will fail and the legacy installation will starts.
来源:https://stackoverflow.com/questions/35589293/how-pip-recognize-to-create-wheel-for-a-package