X-Git-Url: https://pwan.org/git/?p=margebot.git;a=blobdiff_plain;f=setup.py;h=06eac90b5a10e743a37c0ce4a0832be75256c555;hp=7a5bb9291638db5602026e66b4e2a47ccd68a783;hb=ffa092d66bc20fd84d556ae341cc2a60e06d933b;hpb=ea189b9619448d87c2333bed0559a166d6f53193 diff --git a/setup.py b/setup.py index 7a5bb92..06eac90 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,39 @@ Setup.py """ # pragma pylint: disable=invalid-name +from distutils.errors import DistutilsSetupError +from distutils.filelist import FileList +import os from setuptools import setup +import setuptools.command.sdist +import setuptools.command.upload +import setuptools.command.install + +# Errbot plugins aren't distributed as eggs so stub out the sdist, install and upload commands + +class ErrbotSdistCommand(setuptools.command.sdist.sdist): + """ + No sdist command for now. + """ + def run(self): + raise DistutilsSetupError("No sdist for Errbot plugins.") + + +class ErrbotUploadCommand(setuptools.command.upload.upload): + """ + Don't try uploading Errbot plugins to pypi + """ + def run(self): + raise DistutilsSetupError("No uploading Errbot plugins to pypi.") + + +class ErrbotInstallCommand(setuptools.command.install.install): + """ + Short circuit the install command + """ + def run(self): + raise DistutilsSetupError("No install command - copy the ./plugin files to a 'Marge' directory under your Errbot's plugins directory.") + with open('requirements.txt') as f: install_required = f.read().splitlines() @@ -11,25 +43,24 @@ with open('test-requirements.txt') as f: tests_required = f.read().splitlines() setup( - name='Margebot', + name='Marge', version='1.0.0', - # packages=['plugins'], - data_files=[('/opt/errbot/plugins/Marge', - ['./plugins/marge.plug', - './plugins/marge.py', - './plugins//templates/reviews.md', - 'README.md', - 'LICENCE'])], license='GPLv3', description='A Errbot plugin for reminding you about outstanding Gitlab merge requests', long_description=open('README.md').read(), url='https://pwan.org/git/?p=margebot.git;a=summary', author='JudeN', author_email='margebot_spam@pwan.org', - include_package_data=True, + include_package_data=True, install_requires=install_required, setup_requires=['pytest-runner'], tests_require=tests_required, + + cmdclass={ + 'install' : ErrbotInstallCommand, + 'sdist' : ErrbotSdistCommand, + 'upload' : ErrbotUploadCommand, + } )