diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..647ef4a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +# Ignore Git- and GitHub-specific files and dirs +.git +.github +.gitignore + +# Remove all docs but README.md from root directory +*.md +!README*.md + +# Ignore build-specific files and dirs +**/*.egg-info +src + +# Ignore CI-related files and dirs +.travis.yml \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..db42ac1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,224 @@ +########################### +### AUTOMATIC ADDITIONS ### +########################### + +# Created by https://www.gitignore.io/api/vim,linux,emacs,python,visualstudiocode + +### Emacs ### +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +### Linux ### + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# 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 +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + +### Python Patch ### +.venv/ + +### Python.VirtualEnv Stack ### +# Virtualenv +# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ +[Bb]in +[Ii]nclude +[Ll]ib +[Ll]ib64 +[Ll]ocal +[Ss]cripts +pyvenv.cfg +pip-selfcheck.json + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + + +# End of https://www.gitignore.io/api/vim,linux,emacs,python,visualstudiocode + +######################## +### Custom additions ### +######################## + +# Add any custom additions below +!.gitkeep +.vscode/ +*.modified.yaml +.idea/* \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..02ad1b2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +os: + - linux +dist: bionic +language: python +python: + - "3.6" + - "3.7" + - "3.8" + +# Build once for pushes to the repo, and once for PR from forks +if: (type == push) OR (type == pull_request AND fork == true) + +script: + - flake8 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..75ff072 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +##### BASE IMAGE ##### +FROM elixircloud/foca:latest + +##### METADATA ##### +LABEL software="TRS-filer" +LABEL software.description="Tool Registry Service with FOCA" +LABEL software.website="https://github.com/elixir-cloud-aai/trs-filer" +LABEL software.license="https://spdx.org/licenses/Apache-2.0" +LABEL maintainer="alexander.kanitz@alumni.ethz.ch" +LABEL maintainer.organisation="ELIXIR Cloud & AAI" + +# Python UserID workaround for OpenShift/K8S +ENV LOGNAME=ipython +ENV USER=ipython +ENV HOME=/tmp/user + +# Install general dependencies +RUN apt-get update && apt-get install -y nodejs openssl git build-essential python3-dev curl jq + +## Set working directory +WORKDIR /app + +## Copy Python requirements +COPY ./requirements.txt /app/requirements.txt + +## Install Python dependencies - (TODO: Refer cwl-wes later) +RUN cd /app \ + && pip install -r requirements.txt \ + +## Copy remaining app files +COPY ./ /app + +## Install app +RUN cd /app \ + && python setup.py develop \ \ No newline at end of file diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..df559d2 --- /dev/null +++ b/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,26 @@ +## Description + +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. + +Fixes # (issue) + +## Type of change + +Please delete options that are not relevant. + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] Documentation update + +## Checklist: + +- [ ] My code follows the [style guidelines](https://github.com/elixir-cloud-aai/elixir-cloud-aai/blob/dev/resources/contributing_guidelines.md#language-specific-guidelines) of this project +- [ ] I have performed a self-review of my own code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] My changes generate no new warnings +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] New and existing unit tests pass locally with my changes +- [ ] I have not reduced the existing code coverage +- [ ] I have added docstrings following the [Python style guidelines](https://github.com/elixir-cloud-aai/elixir-cloud-aai/blob/dev/resources/python.md) of this project to all new modules, classes, methods and functions are documented with docstrings following; I have updated any previously existing docstrings, if applicable +- [ ] I have updated any sections of the app's documentation that are affected by the proposed changes, if applicable \ No newline at end of file diff --git a/README.md b/README.md index 483556b..f1178f9 100644 --- a/README.md +++ b/README.md @@ -1 +1,56 @@ -# trs-filer +# TRS-filer + +[![License][badge-license]][badge-url-license] +[![Build_status][badge-build-status]][badge-url-build-status] +[![Coverage][badge-coverage]][badge-url-coverage] + +## Synopsis + + +## Description + + +## Usage + + +## Contributing + +This project is a community effort and lives off your contributions, be it in +the form of bug reports, feature requests, discussions, or fixes and other code +changes. Please refer to our organization's [contributing +guidelines][res-elixir-cloud-contributing] if you are interested to contribute. +Please mind the [code of conduct][res-elixir-cloud-coc] for all interactions +with the community. + +## Versioning + +The project adopts the [semantic versioning][res-semver] scheme for versioning. +Currently the service is in beta stage, so the API may change without further +notice. + +## License + +This project is covered by the [Apache License 2.0][license-apache] also +[shipped with this repository][license]. + +## Contact + +The project is a collaborative effort under the umbrella of [ELIXIR Cloud & +AAI][org-elixir-cloud]. Follow the link to get in touch with us via chat or +email. Please mention the name of this service for any inquiry, proposal, +question etc. + +[badge-build-status]: +[badge-coverage]: +[badge-github-tag]: +[badge-license]: +[badge-url-build-status]: +[badge-url-coverage]: +[badge-url-github-tag]: +[badge-url-license]: +[license]: LICENSE +[license-apache]: +[org-elixir-cloud]: +[res-elixir-cloud-coc]: +[res-elixir-cloud-contributing]: +[res-semver]: \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..6ab220a --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +flake8==3.7.9 +Flask==1.1.2 +foca==0.1.0 +pylint==2.4.4 +PyYAML==5.3 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..84ee385 --- /dev/null +++ b/setup.py @@ -0,0 +1,34 @@ +from setuptools import (setup, find_packages) +from trs_filer import __version__ + +with open('README.md', 'r') as fh: + long_description = fh.read() + +setup( + name='trs-filer', + version=__version__, + author='ELIXIR Cloud & AAI', + author_email='nagorikushagra9@gmail.com', + description='Lightweight, flexible Flask/Gunicorn-based \ + GA4GH TRS implementation', + long_description=long_description, + long_description_content_type="text/markdown", + license='Apache License 2.0', + url='https://github.com/elixir-cloud-aai/trs-filer.git', + packages=find_packages(), + keywords=( + 'ga4gh trs elixir rest restful api app server openapi ' + 'swagger mongodb python flask' + ), + classifiers=[ + 'License :: OSI Approved :: Apache Software License', + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Science/Research', + 'Topic :: Scientific/Engineering :: Bio-Informatics', + 'Natural Language :: English', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + ], + install_requires=[], +) diff --git a/trs_filer/__init__.py b/trs_filer/__init__.py new file mode 100644 index 0000000..b794fd4 --- /dev/null +++ b/trs_filer/__init__.py @@ -0,0 +1 @@ +__version__ = '0.1.0'