Skip to content

Instantly share code, notes, and snippets.

@forslund
Created August 6, 2020 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forslund/8e51cba0ffd4e671dfc188e4e33fdbd7 to your computer and use it in GitHub Desktop.
Save forslund/8e51cba0ffd4e671dfc188e4e33fdbd7 to your computer and use it in GitHub Desktop.
Mycroft Plugin setup template
#!/usr/bin/env python3
from os.path import join, abspath, dirname, exists
from setuptools import setup
"""Template for mycroft plugin setup.py.
Fill in constants below and change the setup metadata to suite your module.
"""
PLUGIN_TYPE = '' # tts, stt or audioservice
PLUGIN_MODULE_NAME = '' # Mycroft configuration module name for plugin
PLUGIN_TARGET '' # class to use, ex. my_module:MyTTS
PLUGIN_KEYWORDS = 'Mycroft plugin {}'.format(PLUGIN_TYPE)
PLUGIN_NAMESPACE = 'mycroft.plugin.{}'.format(PLUGIN_TYPE)
PLUGIN_ENTRY_POINT = '{} = {}'.format(PLUGIN_MODULE_NAME, PLUGIN_TARGET)
req_file = join(dirname(abspath(__file__)), 'requirements.txt')
if exists(req_file):
with open(req_file) as f:
requirements = f.readlines()
else:
requirements = []
setup(
name='plugin name',
version='0.1',
description='A plugin for mycroft',
url='http://example.com',
author='Your Name',
author_email='your@email.com',
license='Apache-2.0',
packages=['package_subdir'],
install_requires=requirements,
zip_safe=True,
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
keywords=PLUGIN_KEYWORDS,
entry_points={PLUGIN_NAMESPACE: PLUGIN_ENTRY_POINT}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment