我有一个目录,里面有很多 *.py 文件(脚本(和 *.py 文件的子目录。
如何将根目录中的所有*.py文件添加到软件包中?
现在我的 setup.py 是
from setuptools import setup, find_packages
setup(
name='my-awesome-helloworld-script', # This is the name of your PyPI-package.
version='0.1', # Update the version number for new releases
scripts=['????????????????????'], # The name of your scipt, and also the command you'll be using for calling it
# Packages
packages=find_packages(),
)
如您所见,我已经解决了带有find_packages()
文件夹的附加问题。
但是如何从根目录添加 *.py 文件?
我正在使用命令python.exe setup.py sdist
打包.
谢谢!
用代码解决:
from setuptools import setup, find_packages
pckgs=find_packages()
pckgs.append('.')
setup(
name='my-awesome-helloworld-script', # This is the name of your PyPI-package.
version='0.1', # Update the version number for new releases
# scripts=[''], # The name of your scipt, and also the command you'll be using for calling it
# Packages
packages=pckgs,
)