From e2abebbee33fe31014065a77b51fcaf95b5fdc23 Mon Sep 17 00:00:00 2001 From: Lan Dam <ldam@passcal.nmt.edu> Date: Wed, 16 Jun 2021 13:26:50 -0600 Subject: [PATCH] Gitlab CI pipeline and setup files --- .gitlab-ci.yml | 56 ++++++++++++++++++++++++++++ setup.py | 51 +++++++++++++++++++++++++ sohstationviewer/sohstationviewer.py | 12 ++++++ 3 files changed, 119 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 setup.py create mode 100644 sohstationviewer/sohstationviewer.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..f87f9cad3 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,56 @@ +# Official language image. Look for the different tagged releases at: +# https://hub.docker.com/r/library/python/tags/ +image: python + +# Change pip's cache directory to be inside the project directory since we can +# only cache local items. +variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" + +# Pip's cache doesn't store the python packages +# https://pip.pypa.io/en/stable/reference/pip_install/#caching +# +# If you want to also cache the installed packages, you have to install +# them in a virtualenv and cache it as well. +cache: + paths: + - .cache/pip + +stages: + - Build Env and Test +before_script: + - python setup.py + +flake8: + image: python 3.8 + tags: + - soh + stage: Build Env and Test + script: + - flake8 sohstationviewer + - flake8 tests + +python3.7: + image: python:3.7 + tags: + - passoft + stage: Build Env and Test + script: + - python -m unittest + +python3.8: + image: python:3.8 + tags: + - passoft + stage: Build Env and Test + script: + - python -m unittest + +python3.9: + image: python:3.9 + tags: + - passoft + stage: Build Env and Test + script: + - python -m unittest + diff --git a/setup.py b/setup.py new file mode 100644 index 000000000..f014dc613 --- /dev/null +++ b/setup.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +"""The setup script.""" + +from setuptools import setup, find_packages + +with open('README.rst', 'rt') as readme_file: + readme = readme_file.read() + +with open('HISTORY.rst', 'rt') as history_file: + history = history_file.read() + + +setup( + author="IRIS PASSCAL", + author_email='software-support@passcal.nmt.edu', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', + 'Natural Language :: English', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + ], + description="Visualize State-of-Health packets from raw data recorded by " + "different type of dataloggers.", + entry_points={ + 'console_scripts': [ + 'sohstationviewer=sohstationviewer.sohstationviewer:main', + ], + }, + install_requires=['obspy', + 'PySide2'], + setup_requires=[], + extras_require={ + 'dev': [ + 'flake8' + ] + }, + license="GNU General Public License v3", + long_description=readme + '\n\n' + history, + include_package_data=True, + keywords='sohstationviewer', + name='sohstationviewer', + packages=find_packages(include=['sohstationviewer']), + url='https://git.passcal.nmt.edu/passoft/sohstationviewer', + version='2021.167', + zip_safe=False, +) diff --git a/sohstationviewer/sohstationviewer.py b/sohstationviewer/sohstationviewer.py new file mode 100644 index 000000000..d0c9153db --- /dev/null +++ b/sohstationviewer/sohstationviewer.py @@ -0,0 +1,12 @@ +import sys +from PySide2 import QtWidgets + + +def main(): + app = QtWidgets.QApplication() + # gui = MainGUI + sys.exit(app.exec_()) + + +if __name__ == '__main__': + main() -- GitLab