Kurulum sonrası çalıştırılacak kurulum paketime (easy_install'ing veya python setup.py kurulumu yaparken) bir kanca ekleyebilmek istiyorum.Yükleme sonrası komut dosyalarını easy_install/setuptools/distutils'e nasıl ekleyebilirim?
Projemde PySmell, Vim ve Emacs için bazı destek dosyalarım var. Bir kullanıcı PySmell'i her zamanki gibi yüklediğinde, bu dosyalar gerçek yumurtaya kopyalanır ve kullanıcının bunları dışarıya çıkarması ve bunları .vim veya .emacs dizinlerine yerleştirmesi gerekir. İstediğim şey, kullanıcıdan, kurulumdan sonra, bu dosyaların nereye kopyalanmasını isterse, hatta dosyaların yerlerinin yazdırılması ve ne yapması gerektiği ile ilgili bir mesaj.
Bunu yapmanın en iyi yolu nedir?
Teşekkür
Benim setup.py öylesine benziyor:
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from setuptools import setup
version = __import__('pysmell.pysmell').pysmell.__version__
setup(
name='pysmell',
version = version,
description = 'An autocompletion library for Python',
author = 'Orestis Markou',
author_email = '[email protected]',
packages = ['pysmell'],
entry_points = {
'console_scripts': [ 'pysmell = pysmell.pysmell:main' ]
},
data_files = [
('vim', ['pysmell.vim']),
('emacs', ['pysmell.el']),
],
include_package_data = True,
keywords = 'vim autocomplete',
url = 'http://code.google.com/p/pysmell',
long_description =
"""\
PySmell is a python IDE completion helper.
It tries to statically analyze Python source code, without executing it,
and generates information about a project's structure that IDE tools can
use.
The first target is Vim, because that's what I'm using and because its
completion mechanism is very straightforward, but it's not limited to it.
""",
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development',
'Topic :: Utilities',
'Topic :: Text Editors',
]
)
DÜZENLEME: easy_install ile
from setuptools.command.install import install as _install
class install(_install):
def run(self):
_install.run(self)
print post_install_message
setup(
cmdclass={'install': install},
...
Hayır şans: Burada
python setup.py install
gösteren bir saplama var henüz rota yok.
"setuptools.install.install: run()" işlevinin "install_requires" kurulum argümanını açıkça çözmediğini ve bu – astronaut
@astronaut kullanımını yaptığınızda farklı şekilde çalıştığını öğrendim 'do_egg_install', burada açıklandığı gibi: http://stackoverflow.com/questions/21915469/python-setuptools-install-requires-is-ignored-when-overriding-cmdclass –