Checkpoint: 4/9/2019
[margebot.git] / setup.py
1 """
2 Setup.py
3 """
4 # pragma pylint: disable=invalid-name
5 from distutils.errors import DistutilsSetupError
6 from setuptools import setup
7 import setuptools.command.sdist
8 import setuptools.command.upload
9 import setuptools.command.install
10
11
12 # Errbot plugins aren't distributed as eggs so stub out the sdist, install and upload commands
13 class ErrbotSdistCommand(setuptools.command.sdist.sdist):
14 """
15 No sdist command for now.
16 """
17 def run(self):
18 raise DistutilsSetupError("No sdist for Errbot plugins.")
19
20
21 class ErrbotUploadCommand(setuptools.command.upload.upload):
22 """
23 Don't try uploading Errbot plugins to pypi
24 """
25 def run(self):
26 raise DistutilsSetupError("No uploading Errbot plugins to pypi.")
27
28
29 class ErrbotInstallCommand(setuptools.command.install.install):
30 """
31 Short circuit the install command
32 """
33 def run(self):
34 raise DistutilsSetupError("No install command - copy the ./plugin files to a 'Marge' directory under your Errbot's plugins directory.")
35
36
37 with open('requirements.txt') as f:
38 install_required = f.read().splitlines()
39
40 with open('test-requirements.txt') as f:
41 tests_required = f.read().splitlines()
42
43 setup(
44 name='Marge',
45 version='1.0.0',
46 license='GPLv3',
47 description='A Errbot plugin for reminding you about outstanding Gitlab merge requests',
48 long_description=open('README.md').read(),
49 url='https://pwan.org/git/?p=margebot.git;a=summary',
50 author='JudeN',
51 author_email='margebot_spam@pwan.org',
52
53 include_package_data=True,
54 install_requires=install_required,
55
56 setup_requires=['pytest-runner'],
57 tests_require=tests_required,
58
59 cmdclass={
60 'install': ErrbotInstallCommand,
61 'sdist': ErrbotSdistCommand,
62 'upload': ErrbotUploadCommand,
63 }
64 )