Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add TES data models #196

Merged
merged 13 commits into from
Jul 10, 2024
56 changes: 28 additions & 28 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,43 @@

import tomli

sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath("../.."))


# -- Project information -----------------------------------------------------
def _get_project_meta():
_pyproject_path = Path(__file__).parents[2] / 'pyproject.toml'
with open(_pyproject_path, mode='rb') as pyproject:
return tomli.load(pyproject)['tool']['poetry']
_pyproject_path = Path(__file__).parents[2] / "pyproject.toml"
with open(_pyproject_path, mode="rb") as pyproject:
return tomli.load(pyproject)["tool"]["poetry"]


pkg_meta = _get_project_meta()
current_year = datetime.datetime.now().year
project = str(pkg_meta['name'])
project = str(pkg_meta["name"])
project_copyright = f"{current_year}, {str(pkg_meta['authors'][0])}"
author = str(pkg_meta['authors'][0])
author = str(pkg_meta["authors"][0])

version = str(pkg_meta['version'])
version = str(pkg_meta["version"])
release = version

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
# Used to write beautiful docstrings:
'sphinx.ext.napoleon',
# Used to include .md files:
'm2r2',
# Used to insert typehints into the final docs:
'sphinx_autodoc_typehints',
# Used to embed values from the source code into the docs:
'added_value',
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
"sphinx.ext.autosummary",
# Used to write beautiful docstrings:
"sphinx.ext.napoleon",
# Used to include .md files:
"m2r2",
# Used to insert typehints into the final docs:
"sphinx_autodoc_typehints",
# Used to embed values from the source code into the docs:
"added_value",
]

# Set `typing.TYPE_CHECKING` to `True`:
Expand All @@ -57,39 +57,39 @@ def _get_project_meta():
always_document_param_types = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
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", ".md"]

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# 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 = 'en'
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#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 = 'furo'
html_theme = "furo"

# 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']
html_static_path = ["_static"]

# -- Extension configuration -------------------------------------------------
napoleon_numpy_docstring = False
Expand Down
29 changes: 14 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ types-urllib3 = "^1.26.25.14"
types-werkzeug = "^1.0.9"

[tool.poetry.scripts]
api = 'tesk.app:main'
filer = 'tesk.services.filer:main'
taskmaster = 'tesk.services.taskmaster:main'
api = "tesk.app:main"
filer = "tesk.services.filer:main"
taskmaster = "tesk.services.taskmaster:main"

[tool.pytest_env]
FTP_FIXTURE_SCOPE = "function"
Expand All @@ -83,17 +83,20 @@ FTP_USER = "user"
TESK_FTP_PASSWORD = "pass"
TESK_FTP_USERNAME = "user"

[tool.ruff]
exclude = [
"tesk/services/*",
"tests/test_unit/test_services/*",
]
indent-width = 2

[tool.ruff.format]
docstring-code-format = true
indent-style = "tab"
quote-style = "single"
indent-style = "space"
line-ending = "lf"
quote-style = "double"

[tool.ruff.lint]
ignore = [
"D203", # conflicts with D202 as formatter removes black line before class docstring
"D206", # conflicts with E101, `format.indent-style="tab"`
"D213", # conflicts with D212, would have been ignored regardless
]
select = [
"B", # flake8-bugbear
"D", # pydocstyle
Expand All @@ -105,12 +108,8 @@ select = [
"UP", # pyupgrade
]

[tool.ruff.lint.per-file-ignores] # ignore all pydocstyle errors in test and services modules
"tesk/services/**/*.py" = ["D"]
"tests/test_unit/test_services/**/*.py" = ["D"]

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.typos.default.extend-words]
mke = 'mke'
mke = "mke"
66 changes: 33 additions & 33 deletions tesk/api/ga4gh/tes/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,60 @@
# POST /tasks/{id}:cancel
@log_traffic
def CancelTask(id, *args, **kwargs) -> dict: # type: ignore
"""Cancel unfinished task.
"""Cancel unfinished task.

Args:
id: Task identifier.
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
"""
pass
Args:
id: Task identifier.
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
"""
pass


# POST /tasks
@log_traffic
def CreateTask(*args, **kwargs) -> dict: # type: ignore
"""Create task.
"""Create task.

Args:
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
"""
pass
Args:
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
"""
pass


# GET /tasks/service-info
@log_traffic
def GetServiceInfo(*args, **kwargs) -> dict: # type: ignore
"""Get service info.
"""Get service info.

Args:
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
"""
pass
Args:
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
"""
pass


# GET /tasks
@log_traffic
def ListTasks(*args, **kwargs) -> dict: # type: ignore
"""List all available tasks.
"""List all available tasks.

Args:
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
"""
pass
Args:
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
"""
pass


# GET /tasks
@log_traffic
def GetTask(*args, **kwargs) -> dict: # type: ignore
"""Get info for individual task.

Args:
id: Task identifier.
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
"""
pass
"""Get info for individual task.

Args:
id: Task identifier.
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
"""
pass
Loading