어떻게 추가할 수 있습니시-설치 스크립트를 easy_install/과 함께 진행됩/실행할 필터?

StackOverflow https://stackoverflow.com/questions/250038

  •  05-07-2019
  •  | 
  •  

문제

하고 싶을 추가할 수 있을 걸이를 나 setup.py 실행 되는 설치후(어느 때 easy_install'ing 또는 일을 할 때 python setup.py install).

내 프로젝트 PySmell, 가 지원파일을 위한 정력과 Emacs.사용자가 설치 PySmell 일반적인 방법으로,이러한 파일에서 복사한 실제적인 계란,사용자가 물고기들과 장소들에서 그분의 것입니다.vim 또는.emacs 디렉토리입니다.내가 원하는 것이나 사용자 요구,설치 후,어디에 그는 것과 같은 이러한 파일 복사,또는 다만 메시지가 인쇄하는 파일의 위치하고 그는 어떻게 해야 할 그들과 함께.

는 가장 좋은 방법은 무엇입니까?

감사

나 setup.py 그래서 다음과 같:

#!/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 = 'orestis@orestis.gr',
    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',
    ]


)

편집:

여기에 스텁는 방법을 보여 줍 python setup.py install:

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},
    ...

와 함께 행운 easy_install 로 아직입니다.

도움이 되었습니까?

해결책

하는 방법에 따라 사용자가 패키지를 설치하.는 경우 사용자가 실제로 실행"setup.py "를 설치,그것은 매우 쉽습니다:추 하위 명령 위치 명령(예,install_vim),는 run()메소드가 파일을 복사에서 당신이 원하는 장소 당신이 원하는 위치.추가할 수 있습니다 당신의 하위 명령을 설치합니다.sub_commands 고,전달하는 명령으로 설치 프로그램().

당신이 원하는 경우 게시물을 설치하는 스크립트에서 이진,그것은 유형에 따라 달라의 바이너리를 만들 수 있습니다.예를 들어,bdist_rpm,bdist_wininst 및 bdist_msi 지원에 대한 후 스크립트를 설치하기 때문에 근본적인 포장의 형식을 지원 post-설치 스크립트가 있습니다.

bdist_egg 지원하지 않는 게시물을 설치하는 메커니즘 디자인:

http://bugs.python.org/setuptools/issue41

다른 팁

으로서,주위에 설정할 수 있습 zip_ok 옵션을 false 로도록 귀하의 프로젝트는 설치 디렉토리에 압축을 푼 후,그것은 좀 더 쉽게 될 것입을 위해 당신을 찾기 위해 사용자 편집자 config 파일에 있습니다.

에 distutils2 것,그것이 가능한 것을 설치하기 위하여 더 많은 디렉토리를 포함하여 사용자 지정 디렉토리를 전/후 설치/제거 후크.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top