What's the minimal directory structure to make setuptools work with one_file.py?

梦想的初衷 提交于 2019-12-02 06:20:12

You can get away with this with just a setup.py and your module--no additional directories. In your setup.py just use setup(..., py_modules=['one_file'], ...) (you might want to check on the exact spelling). To install the script you can use the console_scripts entry-point:

from setuptools import setup
setup(
    name='one-file',
    version='1.0',
    py_modules=['one_file'],
    entry_points={'console_scripts': ['one-file = one_file:main']}
)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!