Python 使用setup.py将数据文件安装到网站包中

Python 使用setup.py将数据文件安装到网站包中,python,setuptools,Python,Setuptools,我有一个带有标准setup.py安装程序的Python包,但我一辈子都无法让它将一些预定义的配置文件安装到某个站点包中。。。my setup()函数的调用方式如下: setup( name='Hydrant', version=version, description=long_description, author='Scott Frazer', author_email='scott.d.frazer@gmail.com', packages=['hydrant'],

我有一个带有标准setup.py安装程序的Python包,但我一辈子都无法让它将一些预定义的配置文件安装到某个站点包中。。。my setup()函数的调用方式如下:

setup(
  name='Hydrant',
  version=version,
  description=long_description,
  author='Scott Frazer',
  author_email='scott.d.frazer@gmail.com',
  packages=['hydrant'],
  package_data={'hydrant': ['sql/*.sql', 'hydrant.conf', 'hydrant.deploy']},
  data_files=[('config', ['hydrant/hydrant.conf'])],
  install_requires=[
    "xtermcolor>=1.0.3",
    "pyyaml",
    "pymysql",
    "jprops"
  ],
  entry_points={
    'console_scripts': [
      'hydrant = hydrant.Main:Cli'
    ]
  },
  test_suite='hydrant.test',
  license = "MIT",
)
我在试用
包数据
数据文件
,但它们似乎什么都没做。我正在使用命令行安装到虚拟环境中:

$ python setup.py install

如有任何见解,将不胜感激

尝试在模块中添加
清单.in
文件。尽管如此,它仅用于向生成的包(eggs或tar.gz分发文件)添加数据
看看这个

其他程序员可以使用distutils,但我不推荐使用distutils,因为distribute不推荐使用它。
看看这个

可能重复的