2007年11月07日 星期三 20:08
hi all 我写了个c extension,通过setup.py生成了a.so 和a.egg-info,再如何写setup.py 能够把这2个安装到python目录?谢谢!
2007年11月07日 星期三 20:36
模块和脚本都是无须自己处理的, distutils 会自动把 script 弄到 /usr/bin, 把模块放到 python 目录. 而如果要自己放文件的话, 也许需要写 MANIFEST.in 文件 这里贴个例子: huahua at huahua:trunk$ cat MANIFEST.in include *.gif include *.png include *.glade include *.desktop include *.py huahua at huahua:trunk$ cat setup.py #!/usr/bin/python from distutils.core import setup import glob data_files = [ ('/usr/share/gpage', glob.glob('*.py')\ + glob.glob('*.png')\ + glob.glob('*.gif')\ + glob.glob('*.glade') ), ('/usr/share/pixmaps',['gpage.png']), ('/usr/share/applications',['gpage.desktop']), ] setup(name='gpage', version='0.0.4', description='妳的描述', long_description ="""妳的描述""", author='妳的名字', author_email='妳的邮件地址', license='GPLv3', url="妳的主页", download_url="妳的下载地址", platforms = ['Linux'], scripts=['gpage'], data_files = data_files )
2007年11月07日 星期三 21:19
谢谢! 如果要放到 python/lib/python2.5/site-packages/ 目录下该如何? Jiahua Huang 写道: > 模块和脚本都是无须自己处理的, > distutils 会自动把 script 弄到 /usr/bin, > 把模块放到 python 目录. > > > 而如果要自己放文件的话, 也许需要写 MANIFEST.in 文件 > > > > 这里贴个例子: > > huahua在huahua:trunk$ cat MANIFEST.in > include *.gif > include *.png > include *.glade > include *.desktop > include *.py > > huahua在huahua:trunk$ cat setup.py > #!/usr/bin/python > from distutils.core import setup > import glob > data_files = [ > ('/usr/share/gpage', glob.glob('*.py')\ > + glob.glob('*.png')\ > + glob.glob('*.gif')\ > + glob.glob('*.glade') ), > ('/usr/share/pixmaps',['gpage.png']), > ('/usr/share/applications',['gpage.desktop']), > ] > setup(name='gpage', > version='0.0.4', > description='妳的描述', > long_description ="""妳的描述""", > author='妳的名字', > author_email='妳的邮件地址', > license='GPLv3', > url="妳的主页", > download_url="妳的下载地址", > platforms = ['Linux'], > scripts=['gpage'], > data_files = data_files > ) > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > --~--~---------~--~----~------------~-------~--~----~ > '''邮件来自Groups "python-cn"--China Py User Group > 详情: http://groups-beta.google.com/group/python-cn > 发言: python-cn在googlegroups.com > 退订: python-cn-unsubscribe在googlegroups.com > 维基: http://wiki.woodpecker.org.cn/moin/CPUG > 珠江事务: http://groups.google.com/group/zpug > 东南事务: http://groups.google.com/group/cpug-eastchina > 北京事务: http://groups.google.com/group/bpug > 中国事务: http://groups.google.com/group/CPUG > 同质列表: http://python.cn/mailman/listinfo/python-chinese > ''' > -~----------~----~----~----~------~----~------~--~--- > >
Zeuux © 2025
京ICP备05028076号