From 8661a7eb7fd3cd4851141021686b401e46e4b635 Mon Sep 17 00:00:00 2001 From: hahirvon Date: Fri, 26 May 2017 17:37:08 +0200 Subject: [PATCH] docs: initial release * add initial documentation structure, with license authors, etc. (closes #1) * basic functionality to test client-server connection with ping Signed-off-by: Harri Hirvonsalo --- .gitignore | 83 +++++++++++++++ .travis.yml | 44 ++++++++ AUTHORS.rst | 6 ++ CHANGES.rst | 13 +++ CONTRIBUTING.rst | 33 ++++++ MANIFEST.in | 28 +++++ README.rst | 28 ++++- docs/_static/logo-reana.png | Bin 0 -> 8970 bytes docs/authors.rst | 1 + docs/changes.rst | 1 + docs/conf.py | 204 ++++++++++++++++++++++++++++++++++++ docs/contributing.rst | 1 + docs/gettingstarted.rst | 4 + docs/index.rst | 11 ++ docs/license.rst | 18 ++++ pytest.ini | 21 ++++ reana_server/__init__.py | 28 +++++ reana_server/app.py | 62 +++++++++++ reana_server/config.py | 22 ++++ reana_server/version.py | 30 ++++++ run-tests.sh | 27 +++++ setup.cfg | 29 +++++ setup.py | 100 ++++++++++++++++++ tests/test_version.py | 30 ++++++ 24 files changed, 819 insertions(+), 5 deletions(-) create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 AUTHORS.rst create mode 100644 CHANGES.rst create mode 100644 CONTRIBUTING.rst create mode 100644 MANIFEST.in create mode 100644 docs/_static/logo-reana.png create mode 100644 docs/authors.rst create mode 100644 docs/changes.rst create mode 100644 docs/conf.py create mode 100644 docs/contributing.rst create mode 100644 docs/gettingstarted.rst create mode 100644 docs/index.rst create mode 100644 docs/license.rst create mode 100644 pytest.ini create mode 100644 reana_server/__init__.py create mode 100644 reana_server/app.py create mode 100644 reana_server/config.py create mode 100644 reana_server/version.py create mode 100755 run-tests.sh create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 tests/test_version.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..3b1a1663 --- /dev/null +++ b/.gitignore @@ -0,0 +1,83 @@ +# This file is part of REANA. +# Copyright (C) 2017 CERN. +# +# REANA is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# REANA is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with REANA; if not, see . +# +# In applying this license, CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization or +# submit itself to any jurisdiction. + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Vagrant +.vagrant + +# IntelliJ project files +.idea +*.iml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..1abb64ac --- /dev/null +++ b/.travis.yml @@ -0,0 +1,44 @@ +# This file is part of REANA. +# Copyright (C) 2017 CERN. +# +# REANA is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# REANA is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Invenio; if not, see . +# +# In applying this license, CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization or +# submit itself to any jurisdiction. + +notifications: + email: false + +sudo: true + +language: python + +cache: + - pip + +python: + - "3.5" + +before_install: + - travis_retry pip install --upgrade pip setuptools py + - travis_retry pip install twine wheel coveralls + +install: + - travis_retry pip install -e .[all] + +script: + - ./run-tests.sh + +after_success: + - coveralls \ No newline at end of file diff --git a/AUTHORS.rst b/AUTHORS.rst new file mode 100644 index 00000000..cbeca7c0 --- /dev/null +++ b/AUTHORS.rst @@ -0,0 +1,6 @@ +Authors +======= + +* Diego Rodriguez +* Harri Hirvonsalo +* Tibor Simko diff --git a/CHANGES.rst b/CHANGES.rst new file mode 100644 index 00000000..62720cd2 --- /dev/null +++ b/CHANGES.rst @@ -0,0 +1,13 @@ +Changes +======= + +Version 0.0.1 (YYYY-MM-DD) +-------------------------- + +- Initial public release. + + +.. admonition:: CAVEAT LECTOR + + Please note that REANA Server is in an early developer preview alpha stage. + No detailed changelog is provided yet. \ No newline at end of file diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst new file mode 100644 index 00000000..2f38817e --- /dev/null +++ b/CONTRIBUTING.rst @@ -0,0 +1,33 @@ +Contributing +============ + +Issues +------ + +Bug reports, feature requests, and other contributions are welcome. If you find +a demonstrable problem that is caused by the REANA code, please: + +1. Search for `already reported problems + `_. +2. Check if the issue has been fixed or is still reproducible on the + latest `master` branch. +3. Create an issue, ideally with **a test case**. + +Pull requests +------------- + +If you create a feature branch, you can run the tests to ensure that everything +is operating correctly: + +.. code-block:: console + + $ ./run-tests.sh + +Each pull request should preserve or increase code coverage. + +Kanban +------ + +We are using Kanban technique for keeping track of ongoing tasks. Please see our +`Kanban board `_ and look for issues that are +labelled as "ready for work". diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..808462c4 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,28 @@ +# This file is part of REANA. +# Copyright (C) 2017 CERN. +# +# REANA is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# REANA is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with REANA; if not, see . +# +# In applying this license, CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization or +# submit itself to any jurisdiction. + +include COPYING +include *.rst +include *.sh +include pytest.ini +prune docs/_build +recursive-include docs *.py +recursive-include docs *.png +recursive-include docs *.rst +recursive-include tests *.py diff --git a/README.rst b/README.rst index f3612ca1..94442bc3 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,24 @@ -============== - REANA server -============== +============ +REANA Server +============ -This repository provides the REANA server that takes and performs REST API calls -issued by REANA client. +.. image:: https://img.shields.io/travis/reanahub/reana-server.svg + :target: https://travis-ci.org/reanahub/reana-server + +.. image:: https://img.shields.io/coveralls/reanahub/reana-server.svg + :target: https://coveralls.io/r/reanahub/reana-server + +.. image:: https://readthedocs.org/projects/docs/badge/?version=latest + :target: https://reana-server.readthedocs.io/en/latest/?badge=latest + +.. image:: https://badge.waffle.io/reanahub/reana.svg?label=Status%3A%20ready%20for%20work&title=Issues%20ready%20for%20work + :target: https://waffle.io/reanahub/reana + +.. image:: https://badges.gitter.im/Join%20Chat.svg + :target: https://gitter.im/reanahub/reana?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge + +.. image:: https://img.shields.io/github/license/reanahub/reana-server.svg + :target: https://github.com/reanahub/reana-server/blob/master/COPYING + +This repository provides the REANA server that takes and performs REST API calls issued by REANA client. +Reana Server is part of the REANA system. diff --git a/docs/_static/logo-reana.png b/docs/_static/logo-reana.png new file mode 100644 index 0000000000000000000000000000000000000000..e2781ab7be104240ab445ffd0403c5d4c3a137df GIT binary patch literal 8970 zcmcgy_cNSrxL$UxwyP&Pt49gKYC$X^AxZ?%d+%LzcGcBMv>=Gyd+#k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lx4Mt6Lec#sFqcGpEU%ScAt-+I?V zJ9hfA;m)9@IRyUn1X?%2SM~f5UC-7%3TB3apx?eowd-2;U_N1^r|7&r@i9e8n|U&giUU4@r(F1dUg!L@Z(> o1~Z8v0r`KJ)abbk!~z5QOgNSr=4_8Jb1VP_IThIo8RMY;0p0NXJOBUy literal 0 HcmV?d00001 diff --git a/docs/authors.rst b/docs/authors.rst new file mode 100644 index 00000000..94292d01 --- /dev/null +++ b/docs/authors.rst @@ -0,0 +1 @@ +.. include:: ../AUTHORS.rst \ No newline at end of file diff --git a/docs/changes.rst b/docs/changes.rst new file mode 100644 index 00000000..6beafabd --- /dev/null +++ b/docs/changes.rst @@ -0,0 +1 @@ +.. include:: ../CHANGES.rst \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 00000000..0d9d1db4 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,204 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# This file is part of Invenio. +# Copyright (C) 2017 CERN. +# +# Invenio is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# Invenio is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with REANA; if not, see . +# +# In applying this license, CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization +# or submit itself to any jurisdiction. + +from __future__ import print_function + +import os +import sphinx.environment + +# 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.insert(0, os.path.abspath('.')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Do not warn on external images. +suppress_warnings = ['image.nonlocal_uri'] + +# 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.coverage', + 'sphinx.ext.doctest', + 'sphinx.ext.graphviz', + 'sphinx.ext.intersphinx', + 'sphinx.ext.viewcode', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'reana' +copyright = '2017, info@reana.io' +author = 'info@reana.io' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. + +# Get the version string. Cannot be done with import! +g = {} +with open(os.path.join('..', 'reana_server', 'version.py'), 'rt') as fp: + exec(fp.read(), g) + version = g['__version__'] + +# The full version, including alpha/beta/rc tags. +release = version + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# 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', 'Thumbs.db', '.DS_Store'] + +# 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 + + +# -- 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 = 'alabaster' + +# 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 = { + 'logo': 'logo-reana.png', + 'description': 'REANA Server', + 'github_user': 'reanahub', + 'github_repo': 'reana-server', + 'github_button': False, + 'github_banner': True, + 'show_powered_by': False, + 'extra_nav_links': { + 'REANA@GitHub': 'https://github.com/reanahub', + 'REANA@DockerHub': 'https://hub.docker.com/u/reanahub/', + } +} + +# 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, maps document names to template names. +html_sidebars = { + '**': [ + 'about.html', + 'navigation.html', + 'relations.html', + 'searchbox.html', + 'donate.html', + ] +} + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = 'reanadoc' + + +# -- 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, 'reana.tex', 'reana Documentation', + 'info@reana.io', '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, 'reana', 'reana 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, 'reana', 'reana Documentation', + author, 'reana', 'One line description of project.', + 'Miscellaneous'), +] diff --git a/docs/contributing.rst b/docs/contributing.rst new file mode 100644 index 00000000..3bdd7dc2 --- /dev/null +++ b/docs/contributing.rst @@ -0,0 +1 @@ +.. include:: ../CONTRIBUTING.rst \ No newline at end of file diff --git a/docs/gettingstarted.rst b/docs/gettingstarted.rst new file mode 100644 index 00000000..adee6e43 --- /dev/null +++ b/docs/gettingstarted.rst @@ -0,0 +1,4 @@ +Getting started +=============== + +FIXME \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 00000000..e46fad17 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,11 @@ +.. include:: ../README.rst + +.. toctree:: + :numbered: + :maxdepth: 2 + + gettingstarted + contributing + changes + license + authors diff --git a/docs/license.rst b/docs/license.rst new file mode 100644 index 00000000..cf90d830 --- /dev/null +++ b/docs/license.rst @@ -0,0 +1,18 @@ +License +======= + +REANA is free software; you can redistribute it and/or modify it under the +terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +REANA is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with REANA; if not, see . + +In applying this license, CERN does not waive the privileges and immunities +granted to it by virtue of its status as an Intergovernmental Organization or +submit itself to any jurisdiction. \ No newline at end of file diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..acc604dd --- /dev/null +++ b/pytest.ini @@ -0,0 +1,21 @@ +# This file is part of REANA. +# Copyright (C) 2017 CERN. +# +# REANA is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# REANA is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with REANA; if not, see . +# +# In applying this license, CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization or +# submit itself to any jurisdiction. + +[pytest] +addopts = --pep8 --ignore=docs --cov=reana_server --cov-report=term-missing diff --git a/reana_server/__init__.py b/reana_server/__init__.py new file mode 100644 index 00000000..7aa45e80 --- /dev/null +++ b/reana_server/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# +# This file is part of REANA. +# Copyright (C) 2017 CERN. +# +# REANA is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# REANA is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with REANA; if not, see . +# +# In applying this license, CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization or +# submit itself to any jurisdiction. + +"""REANA-Server.""" + +from __future__ import absolute_import, print_function + +from .version import __version__ + +__all__ = ('__version__', ) diff --git a/reana_server/app.py b/reana_server/app.py new file mode 100644 index 00000000..e98e8141 --- /dev/null +++ b/reana_server/app.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +# +# This file is part of REANA. +# Copyright (C) 2017 CERN. +# +# REANA is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# REANA is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with REANA; if not, see . +# +# In applying this license, CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization or +# submit itself to any jurisdiction. + +"""Reana-Server.""" + +import logging +from flask import Flask + +app = Flask(__name__) +app.secret_key = "hyper secret key" + + +@app.route('/ping', methods=['GET']) +def ping(): # noqa + r"""Endpoint to ping the server. Responds with a pong. + + --- + get: + summary: Ping the server (healthcheck) + description: >- + Ping the server. + produces: + - application/text + responses: + 200: + description: >- + Ping succeeded. + examples: + application/text: + pong + """ + return 'pong', 200 + + +if __name__ == '__main__': + logging.basicConfig( + level=logging.DEBUG, + format='%(asctime)s - %(threadName)s - %(levelname)s: %(message)s' + ) + + app.config.from_object('config') + + app.run(debug=True, port=5000, + host='0.0.0.0') diff --git a/reana_server/config.py b/reana_server/config.py new file mode 100644 index 00000000..cd391371 --- /dev/null +++ b/reana_server/config.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# +# This file is part of REANA. +# Copyright (C) 2017 CERN. +# +# REANA is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# REANA is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with REANA; if not, see . +# +# In applying this license, CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization or +# submit itself to any jurisdiction. + +"""Flask application configuration.""" diff --git a/reana_server/version.py b/reana_server/version.py new file mode 100644 index 00000000..8ba7dd98 --- /dev/null +++ b/reana_server/version.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# +# This file is part of REANA. +# Copyright (C) 2017 CERN. +# +# REANA is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# REANA is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with REANA; if not, see . +# +# In applying this license, CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization or +# submit itself to any jurisdiction. + +"""Version information for REANA-Server. + +This file is imported by ``reana_server.__init__`` +and parsed by ``setup.py``. +""" + +from __future__ import absolute_import, print_function + +__version__ = "0.0.1.dev20170526" diff --git a/run-tests.sh b/run-tests.sh new file mode 100755 index 00000000..bc95d7a5 --- /dev/null +++ b/run-tests.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# +# This file is part of REANA. +# Copyright (C) 2017 CERN. +# +# REANA is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# REANA is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with REANA; if not, see . +# +# In applying this license, CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization or +# submit itself to any jurisdiction. + +pydocstyle reana_server && \ +isort -rc -c -df **/*.py && \ +check-manifest --ignore ".travis-*" && \ +sphinx-build -qnNW docs docs/_build/html && \ +python setup.py test && \ +sphinx-build -qnNW -b doctest docs docs/_build/doctest diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..6396c8b7 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,29 @@ +# This file is part of REANA. +# Copyright (C) 2017 CERN. +# +# REANA is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# REANA is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with REANA; if not, see . +# +# In applying this license, CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization or +# submit itself to any jurisdiction. + +[aliases] +test = pytest + +[build_sphinx] +source-dir = docs/ +build-dir = docs/_build +all_files = 1 + +[bdist_wheel] +universal = 1 \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..30876cbc --- /dev/null +++ b/setup.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +# +# This file is part of REANA. +# Copyright (C) 2017 CERN. +# +# REANA is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# REANA is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with REANA; if not, see . +# +# In applying this license, CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization or +# submit itself to any jurisdiction. + +"""REANA-Server.""" + +from __future__ import absolute_import, print_function + +import os +import re + +from setuptools import find_packages, setup + +readme = open('README.rst').read() +history = open('CHANGES.rst').read() + +tests_require = [ + 'check-manifest>=0.25', + 'coverage>=4.0', + 'isort>=4.2.2', + 'pydocstyle>=1.0.0', + 'pytest-cache>=1.0', + 'pytest-cov>=1.8.0', + 'pytest-pep8>=1.0.6', + 'pytest>=2.8.0', +] + +extras_require = { + 'docs': [ + 'Sphinx>=1.4.4,<1.6', + 'sphinx-rtd-theme>=0.1.9', + ], + 'tests': tests_require, +} + +extras_require['all'] = [] +for key, reqs in extras_require.items(): + if ':' == key[0]: + continue + extras_require['all'].extend(reqs) + +setup_requires = [ + 'pytest-runner>=2.7', +] + +install_requires = [ + 'Flask>=0.11', +] + +packages = find_packages() + + +# Get the version string. Cannot be done with import! +with open(os.path.join('reana_server', 'version.py'), 'rt') as f: + version = re.search( + '__version__\s*=\s*"(?P.*)"\n', + f.read() + ).group('version') + +setup( + name='reana-server', + version=version, + description=__doc__, + long_description=readme + '\n\n' + history, + author='REANA', + author_email='info@reana.io', + url='https://github.com/reanahub/reana-server', + packages=['reana_server'], + zip_safe=False, + extras_require=extras_require, + setup_requires=setup_requires, + tests_require=tests_require, + classifiers=[ + 'Environment :: Web Environment', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Development Status :: 3 - Alpha', + ], +) diff --git a/tests/test_version.py b/tests/test_version.py new file mode 100644 index 00000000..6bcce3cf --- /dev/null +++ b/tests/test_version.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# +# This file is part of REANA. +# Copyright (C) 2017 CERN. +# +# REANA is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# REANA is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with REANA; if not, see . +# +# In applying this license, CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization or +# submit itself to any jurisdiction. + +"""REANA-Server tests.""" + +from __future__ import absolute_import, print_function + + +def test_version(): + """Test version import.""" + from reana_server import __version__ + assert __version__