0
sdist
/wheel
で作成したパッケージにファイルを生成してインクルードする方法を探しています。sdistのファイルを生成する
ビルド中にピックアップされる新しいファイルを作成するプロセスにフックする方法はありますか?
sdist
/wheel
で作成したパッケージにファイルを生成してインクルードする方法を探しています。sdistのファイルを生成する
ビルド中にピックアップされる新しいファイルを作成するプロセスにフックする方法はありますか?
build
フェーズオーバーライドcmdclass
の間にファイルをビルドします。 https://stackoverflow.com/a/43728788/7976758を参照してください:
import distutils.command.build
# Override build command
class BuildCommand(distutils.command.build.build):
def run(self):
# Run the original build command
distutils.command.build.build.run(self)
# Custom build stuff goes here
# Replace the build command with ours
setup(...,
cmdclass={"build": BuildCommand})
MANIFEST
またはMANIFEST.in
中でsdist
リスト内の非コードファイルを含めるには。 https://docs.python.org/3/distutils/sourcedist.html#specifying-the-files-to-distribute
wheel
に非コードファイルを含めるには、setup.py
にpackage_data
と記載してください。 https://docs.python.org/3/distutils/setupscript.html#installing-package-data:
setup(...,
packages=['mypkg'],
package_data={'mypkg': ['*.dat']},
)