Skip to content

Commit

Permalink
src layout and autopublih on release
Browse files Browse the repository at this point in the history
  • Loading branch information
seb5g committed Feb 10, 2021
1 parent 66efa02 commit 79f3377
Show file tree
Hide file tree
Showing 21 changed files with 103 additions and 143 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine toml
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
52 changes: 44 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,48 @@
# PyMoDAQ National Instrument DAQmx Plugin
pymodaq_plugins_daqmx (National Instrument DAQmx)
#################################################

PyMoDAQ, Modular Data Acquisition with Python, is a set of **python** modules used to perform automated
measurements. This repository contains the NI DAQmx plugins compatible with PyMoDAQ to generate and acquire
signals using National Instruments acquisition cards
.. image:: https://img.shields.io/pypi/v/pymodaq_plugins_daqmx.svg
:target: https://pypi.org/project/pymodaq_plugins_daqmx/
:alt: Latest Version

PyMoDAQ repo: https://github.com/CEMES-CNRS
Plugin repo: https://github.com/CEMES-CNRS/pymodaq_plugins_daqmx
.. image:: https://readthedocs.org/projects/pymodaq/badge/?version=latest
:target: https://pymodaq.readthedocs.io/en/stable/?badge=latest
:alt: Documentation Status

.. image:: https://github.com/CEMES-CNRS/pymodaq_plugins_daqmx/workflows/Upload%20Python%20Package/badge.svg
:target: https://github.com/CEMES-CNRS/pymodaq_plugins_daqmx

Plugin devoted to the National Instrument signal acquisition and generation using the NiDAQmx library. Includes an
actuator plugin for signal generation, a 1D viewer plugin for data acquisition as a function of time and a 0D viewer
plugin for quick time averaging acquisition

Authors
=======

* Sébastien J. Weber

Contributors
============

* Amelie Jarnac

Instruments
===========
Below is the list of instruments included in this plugin

Actuators
+++++++++

* **DAQmx**: Analog output DC, Sinus, Ramp...

Viewer0D
++++++++

* **DAQmx**: Analog acquisition, Counting

Viewer1D
++++++++

* **DAQmx**: Analog acquisition

Documentation: http://pymodaq.cnrs.fr/

For an exhaustive list of the available plugins, see https://github.com/CEMES-CNRS/pymodaq_plugin_manager/blob/main/pymodaq_plugin_manager/doc/PluginList.md
11 changes: 0 additions & 11 deletions plugin_info.py

This file was deleted.

15 changes: 15 additions & 0 deletions plugin_info.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## To modify by developper(s) of the plugin

[plugin-info]
SHORT_PLUGIN_NAME = 'daqmx' #for instance daqmx
package-url = 'https://github.com/CEMES-CNRS/pymodaq_plugins_daqmx' #to modify
description = 'Hardware plugins for PyMoDAQ using the NiDAQmx framework (pydaqmx wrapper)'

author = 'Sébastien Weber'
author-email = '[email protected]'
license = 'MIT'

[plugin-install]
#packages required for your plugin:
packages-required = ['pydaqmx']
##
106 changes: 0 additions & 106 deletions pymodaq_plugins_daqmx/version.py

This file was deleted.

30 changes: 12 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
from plugin_info import SHORT_PLUGIN_NAME, packages_required, package_url, author_email, author, description
PLUGIN_NAME = f'pymodaq_plugins_{SHORT_PLUGIN_NAME}'
from setuptools import setup, find_packages
import toml

config = toml.load('./plugin_info.toml')
PLUGIN_NAME = f"pymodaq_plugins_{config['plugin-info']['SHORT_PLUGIN_NAME']}"

import importlib
import sys
try:
import setuptools
from setuptools import setup, find_packages
from setuptools.command import install
except ImportError:
sys.stderr.write("Warning: could not import setuptools; falling back to distutils.\n")
from distutils.core import setup
from distutils.command import install

version = importlib.import_module('.version', PLUGIN_NAME)
from pathlib import Path

with open(str(Path(__file__).parent.joinpath(f'src/{PLUGIN_NAME}/VERSION')), 'r') as fvers:
version = fvers.read().strip()


with open('README.rst') as fd:
long_description = fd.read()
Expand Down Expand Up @@ -41,14 +37,12 @@


setup(
version=version.get_version(),
packages=find_packages(),
version=version,
packages=find_packages(where='./src'),
package_data={'': ['*.dll']},
include_package_data=True,
entry_points={'pymodaq.plugins': f'{SHORT_PLUGIN_NAME} = {PLUGIN_NAME}'},
install_requires=[
'pymodaq>=2.0',
]+packages_required,
install_requires=['toml', ]+config['plugin-install']['packages-required'],
**setupOpts
)

1 change: 1 addition & 0 deletions src/pymodaq_plugins_daqmx/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.3
File renamed without changes.
File renamed without changes.

0 comments on commit 79f3377

Please sign in to comment.