ソースディレクトリで卵モジュールをpackage: [dependencies,]
解凍し、setup.py に追加します。py2Exe Docsの py2exe docs に従って、ソース実行で最も実行するこのスクリプトを実行しました: python unpackEgg.py eggsmodule
:
import os
import pkg_resources
import sys
from setuptools.archive_util import unpack_archive
def unpackEgg(modulo):
eggs = pkg_resources.require(modulo)
for egg in eggs:
if os.path.isdir(egg.location):
sys.path.insert(0, egg.location)
continue
unpack_archive(egg.location, ".")
eggpacks = set()
eggspth = open("./eggs.pth", "w")
for egg in eggs:
print egg
eggspth.write(os.path.basename(egg.location))
eggspth.write("\n")
eggpacks.update(egg.get_metadata_lines("top_level.txt"))
eggspth.close()
eggpacks.clear()
if __name__ == '__main__':
unpackEgg(sys.argv[1])