Setting up setup.py for packaging of a single .py file and a single data file without needing to create any folders

前端 未结 2 1698
时光说笑
时光说笑 2021-02-02 07:07

Project tree:

$.
├── happy_birthday-art.txt
├── happy_birthday.py
├── MANIFEST.in
├── README.rst
└── setup.py

setup.py

2条回答
  •  盖世英雄少女心
    2021-02-02 07:39

    If you have a single-file module like this, no folder will be created, your .py file will be moved directly into the directory which contains the other python modules (/usr/lib/pythonX.X/site-packages/, for example). That's why you have to create a directory:

    $ .
    |-- happy_birthday/
        |-- __init__.py
        |-- art.txt
    |-- MANIFEST.in
    |-- README.rst
    |-- setup.py
    

提交回复
热议问题