We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently only the 'version' is in a py import file.
I would suggest to add more variables in there, those that are shared between the init.py and the setup.py
setup.py:
def get_pluginvar(variable,rel_path): for line in read(rel_path).splitlines(): if line.startswith(f'__{variable}__'): delim = '"' if '"' in line else "'" return line.split(delim)[1] else: raise RuntimeError(f"Unable to find {variable} string in f{rel_path}.") setup( name=get_pluginvar('name','netbox_newplugin/pluginvars.py'), version=get_pluginvar('version','netbox_newplugin/pluginvars.py'), description=get_pluginvar('description','netbox_newplugin/pluginvars.py'), long_description=long_description, long_description_content_type="text/markdown", url=get_pluginvar('url','netbox_newplugin/pluginvars.py'), author=get_pluginvar('author','netbox_newplugin/pluginvars.py'), author_email=get_pluginvar('author_email','netbox_newplugin/pluginvars.py'), install_requires=[], packages=find_packages(), include_package_data=True, classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Framework :: Django', 'Programming Language :: Python :: 3', ] )
pluginvars.py:
__name__ = 'netbox_newplugin' __version__ = '0.0.0' __description__ = '' __author__ = '' __author_email__ = '' __url__ = ''
_ _ init _ _.py
from extras.plugins import PluginConfig from .pluginvars import __name__ from .pluginvars import __version__ from .pluginvars import __description__ from .pluginvars import __author__ from .pluginvars import __author_email__ class NewpluginConfig(PluginConfig): name = __name__ verbose_name = '' description = __description__ version = __version__ author = __author__ author_email = __author_email__ required_settings = [] default_settings = {} config = NewpluginConfig # noqa
(did not test this yet, so excuse any codos or typos)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently only the 'version' is in a py import file.
I would suggest to add more variables in there, those that are shared between the init.py and the setup.py
setup.py:
pluginvars.py:
_ _ init _ _.py
(did not test this yet, so excuse any codos or typos)
The text was updated successfully, but these errors were encountered: