From 09cf3428756693549e58b19a30b42d91bf366162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Weber?= Date: Wed, 4 Sep 2024 20:40:46 +0200 Subject: [PATCH] using common setup.py file from pymodaq --- setup.py | 63 ++------------------------------------------------------ 1 file changed, 2 insertions(+), 61 deletions(-) diff --git a/setup.py b/setup.py index 2fbcafa..f9d5474 100644 --- a/setup.py +++ b/setup.py @@ -1,63 +1,4 @@ -from setuptools import setup, find_packages -import toml - -config = toml.load('./plugin_info.toml') -SHORT_PLUGIN_NAME = config['plugin-info']['SHORT_PLUGIN_NAME'] -PLUGIN_NAME = f"pymodaq_plugins_{config['plugin-info']['SHORT_PLUGIN_NAME']}" - - +from pymodaq.resources.setup_plugin import setup from pathlib import Path -with open(str(Path(__file__).parent.joinpath(f'src/{PLUGIN_NAME}/resources/VERSION')), 'r') as fvers: - version = fvers.read().strip() - - -with open('README.rst') as fd: - long_description = fd.read() - -setupOpts = dict( - name=PLUGIN_NAME, - description=config['plugin-info']['description'], - long_description=long_description, - license=config['plugin-info']['license'], - url=config['plugin-info']['package-url'], - author=config['plugin-info']['author'], - author_email=config['plugin-info']['author-email'], - classifiers=[ - "Programming Language :: Python :: 3", - "Development Status :: 5 - Production/Stable", - "Environment :: Other Environment", - "Intended Audience :: Science/Research", - "Topic :: Scientific/Engineering :: Human Machine Interfaces", - "Topic :: Scientific/Engineering :: Visualization", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Topic :: Software Development :: Libraries :: Python Modules", - "Topic :: Software Development :: User Interfaces", - ], ) - - -entrypoints = {} -if 'features' in config: - if config['features'].get('instruments', False): - entrypoints['pymodaq.instruments'] = f'{SHORT_PLUGIN_NAME} = {PLUGIN_NAME}' - if config['features'].get('extensions', False): - entrypoints['pymodaq.extensions'] = f'{SHORT_PLUGIN_NAME} = {PLUGIN_NAME}' - if config['features'].get('pid_models', False): - entrypoints['pymodaq.pid_models'] = f'{SHORT_PLUGIN_NAME} = {PLUGIN_NAME}' - if config['features'].get('h5exporters', False): - entrypoints['pymodaq.h5exporters'] = f'{SHORT_PLUGIN_NAME} = {PLUGIN_NAME}' - if config['features'].get('scanners', False): - entrypoints['pymodaq.scanners'] = f'{SHORT_PLUGIN_NAME} = {PLUGIN_NAME}' -else: - entrypoints['pymodaq.instruments'] = f'{SHORT_PLUGIN_NAME} = {PLUGIN_NAME}' - -setup( - version=version, - packages=find_packages(where='./src'), - package_dir={'': 'src'}, - include_package_data=True, - entry_points=entrypoints, - install_requires=['toml', ]+config['plugin-install']['packages-required'], - **setupOpts -) +setup(Path(__file__).parent) \ No newline at end of file