Skip to content

Commit

Permalink
Merge pull request #1 from PyMoDAQ/feature/renaming
Browse files Browse the repository at this point in the history
renamed with correct templating name
  • Loading branch information
seb5g authored May 14, 2024
2 parents b2f9487 + 174e32f commit f1c0b68
Show file tree
Hide file tree
Showing 22 changed files with 5 additions and 76 deletions.
4 changes: 2 additions & 2 deletions plugin_info.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## To modify by developper(s) of the plugin

[plugin-info]
SHORT_PLUGIN_NAME = 'srs' #to be modified, for instance daqmx then rename the module name:
# (pymodaq_plugins_srs become pymodaq_plugins_daqmx for instance)
SHORT_PLUGIN_NAME = 'stanford_research_systems' #to be modified, for instance daqmx then rename the module name:
# (pymodaq_plugins_stanford_research_systems become pymodaq_plugins_daqmx for instance)

package-url = 'https://github.com/PyMoDAQ/pymodaq_plugins_stanford_research_systems' #to modify
description = 'Set of plugins for the Stanford Research Systems (SRS) Instruments'
Expand Down
75 changes: 2 additions & 73 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,75 +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_{SHORT_PLUGIN_NAME}"


from pymodaq.resources.setup_plugin import setup
from pathlib import Path

if not SHORT_PLUGIN_NAME.isidentifier():
raise ValueError("'SHORT_PLUGIN_NAME = %s' is not a valid python identifier." % SHORT_PLUGIN_NAME)

version_file = Path(__file__).parent.joinpath(f'src/{PLUGIN_NAME}/resources/VERSION') # new location of the version file
if not version_file.is_file():
version_file = Path(__file__).parent.joinpath(f'src/{PLUGIN_NAME}/VERSION')

with open(str(version_file), '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",
], )

#instrument
#extension = false # true if plugins contains dashboard extensions
#pid_models = false # true if plugins contains pid models
#h5exporters = false # true if plugin contains custom h5 file exporters
#scans

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}'
entrypoints['pymodaq.plugins'] = f'{SHORT_PLUGIN_NAME} = {PLUGIN_NAME}' # generic plugin, usefull for the plugin manager
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)
1 change: 0 additions & 1 deletion src/pymodaq_plugins_srs/resources/VERSION

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.3
File renamed without changes.

0 comments on commit f1c0b68

Please sign in to comment.