To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 5a33d963 authored by Carlos Vigo's avatar Carlos Vigo

Project start

parents
Pipeline #65185 passed with stage
in 9 minutes and 31 seconds
/.idea/
/alarm_manager.egg-info/
/.eggs/
/build/
/dist/
/docs/build/
/docs/source/api/
# Based on https://docs.gitlab.com/ee/ci/examples/test-and-deploy-python-application-to-heroku.html
# This file is a template, and might need editing before it works on your project.
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/python/tags/
image: python:latest
# 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
- venv/
before_script:
- apt-get update -qy
- apt-get install -y libpq-dev
- python -V # Print out python version for debugging
- python -m pip install --upgrade pip
- python -m pip install virtualenv
- virtualenv venv
- source venv/bin/activate
#test:
# script:
# - python -m pip install .[dev]
# - python -m pip install tox flake8 # you can also use tox
# - tox -e py36,flake8
run:
script:
- python -m pip install .
only:
- master
pages:
script:
- python -m pip install .[docs]
- cd docs ; make html
- mv build/html/ ../public/
artifacts:
paths:
- public
only:
- master
\ No newline at end of file
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# Optionally build your docs in additional formats such as PDF and ePub
formats: all
# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- docs
\ No newline at end of file
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
[0.1.0]: https://gitlab.ethz.ch/exotic-matter/cw-beam/alarm-manager/tree/v0.1.0
\ No newline at end of file
# Contributing
When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
## Pull Request Process
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
2. Update the README.md with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
3. Increase the version numbers in any examples files and the README.md to the new version that this
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
do not have permission to do that, you may request the second reviewer to merge it for you.
## Code of Conduct
### Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
### Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
### Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
### Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
### Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
\ No newline at end of file
This diff is collapsed.
include README.md
include CHANGELOG.md
include LICENSE.md
include CONTRIBUTING.md
include alarm_manager/conf/*
\ No newline at end of file
# README
[![PyPI Latest Version](https://badge.fury.io/py/alarm-manager.svg)](https://badge.fury.io/py/alarm-manager)
[![pipeline status](https://gitlab.ethz.ch/exotic-matter/cw-beam/alarm-manager/badges/master/pipeline.svg)](https://gitlab.ethz.ch/exotic-matter/cw-beam/alarm-manager/-/commits/master)
[![coverage report](https://gitlab.ethz.ch/exotic-matter/cw-beam/alarm-manager/badges/master/coverage.svg)](https://gitlab.ethz.ch/exotic-matter/cw-beam/alarm-manager/-/commits/master)
[![Documentation Status](https://readthedocs.org/projects/alarm-manager/badge/?version=latest)](https://alarm-manager.readthedocs.io/en/latest/?badge=latest)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
## Alarm Manager for Python logs over TCP Socket
To be done...
## Authors
* [**Carlos Vigo**](mailto:carlosv@phys.ethz.ch?subject=[GitLab%-%alarm-manager]) - *Initial work* -
[GitLab](https://gitlab.ethz.ch/carlosv)
## Contributing
Please read our [contributing policy](CONTRIBUTING.md) for details on our code of
conduct, and the process for submitting pull requests to us.
## Versioning
We use [Git](https://git-scm.com/) for versioning. For the versions available, see the
[tags on this repository](https://gitlab.ethz.ch/exotic-matter/cw-beam/alarm-manager).
## License
This project is licensed under the [GNU GPLv3 License](LICENSE.md)
## Built With
* [PyCharm Professional 2020](https://www.jetbrains.com/pycharm//) - The IDE used
* [Sphinx](https://www.sphinx-doc.org/en/master/index.html) - Documentation
## Acknowledgments
* Nobody so far
# -*- coding: utf-8 -*-
# Author: Carlos Vigo
# Contact: carlosv@phys.ethz.ch
""" Central management tool for alarm logs over TCP.
"""
# Local imports
from . import __project__
__all__ = [
__project__.__author__,
__project__.__copyright__,
__project__.__short_version__,
__project__.__version__,
__project__.__project_name__,
]
from .alarm_manager import alarm_manager
if __name__ == "__main__":
alarm_manager()
__author__ = 'Carlos Vigo <carlosv@phys.ethz.ch>'
__email__ = '<carlosv@phys.ethz.ch>'
__short_author__ = 'Carlos Vigo'
__copyright__ = '2020, Carlos Vigo'
__module_name__ = 'alarm_manager.py'
__package_name__ = 'alarm-manager'
__project_name__ = 'Alarm Management'
__url__ = 'https://gitlab.ethz.ch/exotic-matter/cw-beam/alarm-manager'
__documentation__ = 'https://alarm-manager.readthedocs.io'
__version__ = '0.1.0'
__short_version__ = '0.1.0'
__description__ = 'Central management tool for alarm logs over TCP'
""" Alarm manager for TCP logs. """
def alarm_manager():
pass
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd
{{ objname | escape | underline}}
.. currentmodule:: {{ module }}
.. auto{{ objtype }}:: {{ objname }}
\ No newline at end of file
{{ objname | escape | underline}}
.. rubric:: Description
.. currentmodule:: {{ module }}
.. autoclass:: {{ objname }}
{% block attributes %}
{% if attributes %}
.. rubric:: Attributes
.. autosummary::
:nosignatures:
:toctree: {{ objname }}
{% for item in attributes %}
{%- if item not in inherited_members %}
{{ name }}.{{ item }}
{%- endif %}
{% endfor %}
{% endif %}
{% endblock %}
{% block methods %}
{% if methods %}
.. rubric:: Methods
.. autosummary::
:nosignatures:
:toctree: {{ objname }}
{% for item in methods %}
{%- if item not in inherited_members %}
{{ name }}.{{ item }}
{%- endif %}
{% endfor %}
{% endif %}
{% endblock %}
\ No newline at end of file
{{ name | escape | underline }}
.. rubric:: Description
.. automodule:: {{ fullname }}
.. currentmodule:: {{ fullname }}
{% if classes %}
.. rubric:: Classes
.. autosummary::
:nosignatures:
:toctree: {{ name }}
{% for class in classes %}
{{ class }}
{% endfor %}
{% endif %}
{% if functions %}
.. rubric:: Functions
.. autosummary::
:nosignatures:
:toctree: {{ name }}
{% for function in functions %}
{{ function }}
{% endfor %}
{% endif %}
{% if exceptions %}
.. rubric:: Exceptions
.. autosummary::
:nosignatures:
:toctree: {{ name }}
{% for exception in exceptions %}
{{ exception }}
{% endfor %}
{% endif %}
\ No newline at end of file
API Reference
=============
.. rubric:: Description
.. automodule:: alarm_manager
.. currentmodule:: alarm_manager
.. rubric:: Modules
.. autosummary::
:toctree: api
\ No newline at end of file
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# Packages for Sphinx extensions
from recommonmark.parser import CommonMarkParser # to parse Markdown files
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os
import sys
sys.path.append(os.path.abspath('../..'))
sys.path.append(os.path.abspath('../../alarm_manager'))
# -- Project information -----------------------------------------------------
from __project__ import (
__copyright__ as copyright,
__project_name__ as project,
__package_name__ as package,
__short_author__ as author,
__short_version__ as version,
__version__ as release,
) # noqa: E402
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.inheritance_diagram',
'sphinx.ext.napoleon',
'sphinx_paramlinks',
"sphinx_rtd_theme",
'recommonmark'
]
# Napoleon settings
napoleon_google_docstring = True
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = True
napoleon_include_private_with_doc = True
napoleon_include_special_with_doc = True
napoleon_use_admonition_for_examples = False
napoleon_use_admonition_for_notes = False
napoleon_use_admonition_for_references = False
napoleon_use_ivar = False
napoleon_use_param = True
napoleon_use_rtype = True
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# Markdown support
source_parsers = {
'.md': CommonMarkParser,
}
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}
# The master toctree document.
master_doc = 'index'
# The front page document.
index_doc = 'index'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', '**tests**', '**setup**', '**extern**']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
autosummary_generate = True
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
# html_sidebars = {
# '**': [
# 'relations.html', # needs 'show_related': True theme option to display
# 'searchbox.html',
# ]
# }
# The api document: extension: relbar_links
relbar_links_doc = [
('toc', 'contents'),
('api', 'api'),
]
# If false, no module index is generated.
html_domain_indices = True
# If false, no index is generated.
html_use_index = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
html_show_copyright = True
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'LabUtilsDoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'lab_utils.tex', project + ' Documentation',
author, 'manual'),
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, package, project + ' Documentation',
author, 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, package, project + ' Documentation',
author, package, 'One line description of project.',
'Miscellaneous'),
]
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'psycopg2': ('https://www.psycopg.org/docs', None),
}
\ No newline at end of file
Welcome to the Alarm Manager Documentation!
===========================================
.. image:: https://badge.fury.io/py/alarm-manager.svg
:target: https://badge.fury.io/py/alarm-manager
:alt: PyPI Latest Version
.. image:: https://gitlab.ethz.ch/exotic-matter/cw-beam/alarm-manager/badges/master/pipeline.svg
:target: https://gitlab.ethz.ch/exotic-matter/cw-beam/alarm-manager/-/commits/master
:alt: Pipeline Status
.. image:: https://gitlab.ethz.ch/exotic-matter/cw-beam/alarm-manager/badges/master/coverage.svg
:target: https://gitlab.ethz.ch/exotic-matter/cw-beam/alarm-manager/-/commits/master
:alt: Coverage Report
.. image:: https://readthedocs.org/projects/alarm-manager/badge/?version=latest
:target: https://alarm-manager.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://img.shields.io/badge/License-GPLv3-blue.svg
:target: https://www.gnu.org/licenses/gpl-3.0
:alt: License: GPL v3
:obj:`alarm_manager` is ...
If this is your first time using :obj:`alarm_manager`, have a look at our :doc:`Readme<project/README>` for a more
detailed summary and installation instructions. If you're already familiar with this package, or you want to dive
straight in, you can jump to the :doc:`API reference <api>`.
.. toctree::
:maxdepth: 1
Welcome <self>
Readme <project/README.md>
api
Changelog <project/CHANGELOG.md>
Contributing <project/CONTRIBUTING.md>
License <project/LICENSE.md>
../../../CHANGELOG.md
\ No newline at end of file
../../../CONTRIBUTING.md
\ No newline at end of file
../../../LICENSE.md
\ No newline at end of file
../../../README.md
\ No newline at end of file
[build-system]
# Minimum requirements for the build system to execute.
requires = [
"setuptools",
"wheel",
"pip>=10.0.0",
]
build-backend = "setuptools.build_meta:__legacy__"
[aliases]
test=pytest
check=flake8
[flake8]
max-line-length=120
\ No newline at end of file
# -*- coding: utf-8 -*-
# Author: Carlos Vigo
# Contact: carlosv@phys.ethz.ch
from setuptools import setup
from os.path import join, dirname, abspath
from sys import path as sys_path
sys_path.append(abspath('alarm_manager'))