プロジェクトツリー:
$.
├── happy_birthday-art.txt
├── happy_birthday.py
├── MANIFEST.in
├── README.rst
└── setup.py
setup.py
from setuptools import setup
setup(
name='Happy_birthday',
py_modules=['happy_birthday'],
data_files=['happy_birthday-art.txt'],
entry_points={
'console_scripts': ['happy_birthday = happy_birthday:main', ],},
long_description=open('README.rst').read(),
)
仮想環境で作成したファイルを実行するpython setup.py sdist
と、次のメッセージが表示されます。pip install
.tar.gz
warning: install_data: setup script did not provide a directory for 'happy-birthday-art.txt' -- installing right in '/home/username/.virtualenvs/happy_birthday'
プログラムはその .txt ファイルを使用するため、後で実行しようとすると失敗します。
happy_birthday-art.txt
しかし、別のフォルダーにインストールしたくありません。がインストールされているフォルダにインストールしたいhappy_birthday.py
。また、絶対パスを使用する必要はありませんsetup.py
。ファイルを最適に設定するにはどうすればよいsetup.py
ですか?