From 36980226e7c280026b2f3420bfbcc1b234036a69 Mon Sep 17 00:00:00 2001 From: Karel van Klink <karel.vanklink@geant.org> Date: Thu, 13 Apr 2023 13:55:52 +0200 Subject: [PATCH] Update name from LARP to LSO --- Jenkinsfile | 2 +- README.md | 4 ++-- docs/dump-openapi-spec.py | 4 ++-- docs/source/index.rst | 4 ++-- docs/source/quickstart.rst | 8 ++++---- {larp => lso}/__init__.py | 6 +++--- {larp => lso}/app.py | 6 +++--- {larp => lso}/config.py | 0 {larp => lso}/environment.py | 0 {larp => lso}/routes/__init__.py | 0 {larp => lso}/routes/default.py | 2 +- setup.py | 4 ++-- test/conftest.py | 4 ++-- test/test_config.py | 4 +--- tox.ini | 2 +- 15 files changed, 24 insertions(+), 26 deletions(-) rename {larp => lso}/__init__.py (93%) rename {larp => lso}/app.py (73%) rename {larp => lso}/config.py (100%) rename {larp => lso}/environment.py (100%) rename {larp => lso}/routes/__init__.py (100%) rename {larp => lso}/routes/default.py (85%) diff --git a/Jenkinsfile b/Jenkinsfile index dfc196d..8790b36 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,3 @@ library 'SWDPipeline' -SimplePythonBuild('goat-larp'); +SimplePythonBuild('goat-lso'); diff --git a/README.md b/README.md index 62845f7..6cedf58 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Lightweight Ansible Runner Provisioner +# Lightweight Service Orchestrator -LARP: an API that allows for remotely executing Ansible playbooks +LSO: an API that allows for remotely executing Ansible playbooks ## Running locally diff --git a/docs/dump-openapi-spec.py b/docs/dump-openapi-spec.py index eae0df9..7a453a1 100644 --- a/docs/dump-openapi-spec.py +++ b/docs/dump-openapi-spec.py @@ -2,7 +2,7 @@ import json import os from fastapi.testclient import TestClient -import larp +import lso config_filename = os.path.join( os.path.dirname(__file__), @@ -13,7 +13,7 @@ output_filename = os.path.join( 'source', '_static', 'openapi.json') os.environ['SETTINGS_FILENAME'] = config_filename -app = larp.create_app() +app = lso.create_app() client = TestClient(app) rsp = client.get('/openapi.json') openapi_doc = json.dumps(rsp.json(), indent=2) diff --git a/docs/source/index.rst b/docs/source/index.rst index 66746d3..3508806 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,7 +1,7 @@ -GOAT Ansible API +GOAT Lightweight Service Orchestrator ========================== -Documentation for LARP: a Lightweight Ansible Runner Provisioner +Documentation for LSO: a Lightweight Service Orchestrator .. toctree:: :maxdepth: 1 diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index f7ce68c..bc0ae93 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -15,7 +15,7 @@ Install the Module python3 -m venv my-venv-directory . my-venv-directory/bin/activate - pip install --pre --extra-index-url https://artifactory.software.geant.org/artifactory/api/pypi/geant-swd-pypi/simple goat-larp + pip install --pre --extra-index-url https://artifactory.software.geant.org/artifactory/api/pypi/geant-swd-pypi/simple goat-lso * Install the source code @@ -24,8 +24,8 @@ Install the Module python3 -m venv my-venv-directory . my-venv-directory/bin/activate - git clone https://gitlab.geant.org/goat/gap/larp.git - cd larp + git clone https://gitlab.geant.org/goat/gap/lso.git + cd lso pip install -e . # for a full dev environment @@ -39,7 +39,7 @@ Running the App .. code-block:: bash - SETTINGS_FILENAME=/absolute/path/to/config.json python -m goat_larp.app + SETTINGS_FILENAME=/absolute/path/to/config.json python -m goat_lso.app Examples diff --git a/larp/__init__.py b/lso/__init__.py similarity index 93% rename from larp/__init__.py rename to lso/__init__.py index 33ccfb7..7afbc8d 100644 --- a/larp/__init__.py +++ b/lso/__init__.py @@ -6,10 +6,10 @@ import logging from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware -from larp import environment -from larp import config +from lso import environment +from lso import config -from larp.routes import default +from lso.routes import default def create_app(): diff --git a/larp/app.py b/lso/app.py similarity index 73% rename from larp/app.py rename to lso/app.py index 5f36943..4d83e84 100644 --- a/larp/app.py +++ b/lso/app.py @@ -1,14 +1,14 @@ """ default app creation """ -import larp +import lso -app = larp.create_app() +app = lso.create_app() if __name__ == "__main__": import uvicorn uvicorn.run( - 'larp.app:app', + 'lso.app:app', host='0.0.0.0', port=44444, log_level='debug') diff --git a/larp/config.py b/lso/config.py similarity index 100% rename from larp/config.py rename to lso/config.py diff --git a/larp/environment.py b/lso/environment.py similarity index 100% rename from larp/environment.py rename to lso/environment.py diff --git a/larp/routes/__init__.py b/lso/routes/__init__.py similarity index 100% rename from larp/routes/__init__.py rename to lso/routes/__init__.py diff --git a/larp/routes/default.py b/lso/routes/default.py similarity index 85% rename from larp/routes/default.py rename to lso/routes/default.py index 51809b9..02ef1d9 100644 --- a/larp/routes/default.py +++ b/lso/routes/default.py @@ -18,5 +18,5 @@ def version() -> Version: return { 'api': API_VERSION, 'module': - pkg_resources.get_distribution('goat-larp').version + pkg_resources.get_distribution('goat-lso').version } diff --git a/setup.py b/setup.py index 061160c..9fe09dd 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,12 @@ from setuptools import setup, find_packages setup( - name='goat-larp', + name='goat-lso', version='0.0.1', author='GÉANT Orchestration & Automation Team', author_email='TBD', description='Lightweight Ansible Runner Provioner', - url='https://gitlab.geant.org/goat/gap/larp', + url='https://gitlab.geant.org/goat/gap/lso', packages=find_packages(), install_requires=[ 'jsonschema', diff --git a/test/conftest.py b/test/conftest.py index e4a5dd3..35c3b61 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -5,7 +5,7 @@ import tempfile import pytest from fastapi.testclient import TestClient -import larp +import lso @pytest.fixture @@ -42,5 +42,5 @@ def invalid_config_file(bad_config_data): @pytest.fixture def client(config_file): - app = larp.create_app() + app = lso.create_app() yield TestClient(app) # wait here until calling context ends diff --git a/test/test_config.py b/test/test_config.py index 145fdd9..b1462c6 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -2,9 +2,7 @@ import io import json import pytest -from pydantic.error_wrappers import ValidationError - -from larp import config +from lso import config def test_config_with_file(config_file): diff --git a/tox.ini b/tox.ini index 3a9b917..ab6a6bc 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ deps = commands = coverage erase - coverage run --source larp -m pytest + coverage run --source lso -m pytest coverage xml coverage html coverage report --fail-under 80 -- GitLab