diff --git a/docs/conf.py b/docs/conf.py index 0f380d1..540e86a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -31,7 +31,9 @@ # -- Options for HTML output -html_theme = "sphinx_rtd_theme" +html_title = "SaagieAPI" +html_theme = "sphinx_book_theme" +html_theme_options = {"show_toc_level": 2, "toc_title": "On this page"} # -- Options for EPUB output epub_show_urls = "footnote" diff --git a/docs/index.rst b/docs/index.rst index ef362c8..0dbd1a2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -160,11 +160,12 @@ Your Saagie projects homepage has the following structure -Contents --------- +.. Contents +.. -------- .. toctree:: :titlesonly: + :hidden: Platform/index Projects/index diff --git a/poetry.lock b/poetry.lock index e9d8632..beb3646 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,5 +1,19 @@ # This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +[[package]] +name = "accessible-pygments" +version = "0.0.4" +description = "A collection of accessible pygments styles" +optional = false +python-versions = "*" +files = [ + {file = "accessible-pygments-0.0.4.tar.gz", hash = "sha256:e7b57a9b15958e9601c7e9eb07a440c813283545a20973f2574a5f453d0e953e"}, + {file = "accessible_pygments-0.0.4-py2.py3-none-any.whl", hash = "sha256:416c6d8c1ea1c5ad8701903a20fcedf953c6e720d64f33dc47bfb2d3f2fa4e8d"}, +] + +[package.dependencies] +pygments = ">=1.5" + [[package]] name = "alabaster" version = "0.7.13" @@ -55,6 +69,24 @@ files = [ {file = "backoff-2.2.1.tar.gz", hash = "sha256:03f829f5bb1923180821643f8753b0502c3b682293992485b0eef2807afa5cba"}, ] +[[package]] +name = "beautifulsoup4" +version = "4.12.2" +description = "Screen-scraping library" +optional = false +python-versions = ">=3.6.0" +files = [ + {file = "beautifulsoup4-4.12.2-py3-none-any.whl", hash = "sha256:bd2520ca0d9d7d12694a53d44ac482d181b4ec1888909b035a3dbf40d0f57d4a"}, + {file = "beautifulsoup4-4.12.2.tar.gz", hash = "sha256:492bbc69dca35d12daac71c4db1bfff0c876c00ef4a2ffacce226d4638eb72da"}, +] + +[package.dependencies] +soupsieve = ">1.2" + +[package.extras] +html5lib = ["html5lib"] +lxml = ["lxml"] + [[package]] name = "black" version = "23.9.1" @@ -1104,6 +1136,33 @@ files = [ {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, ] +[[package]] +name = "pydata-sphinx-theme" +version = "0.14.3" +description = "Bootstrap-based Sphinx theme from the PyData community" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydata_sphinx_theme-0.14.3-py3-none-any.whl", hash = "sha256:b7e40cd75a20449adfe2d7525be379b9fe92f6d31e5233e449fa34ddcd4398d9"}, + {file = "pydata_sphinx_theme-0.14.3.tar.gz", hash = "sha256:bd474f347895f3fc5b6ce87390af64330ee54f11ebf9660d5bc3f87d532d4e5c"}, +] + +[package.dependencies] +accessible-pygments = "*" +Babel = "*" +beautifulsoup4 = "*" +docutils = "!=0.17.0" +packaging = "*" +pygments = ">=2.7" +sphinx = ">=5.0" +typing-extensions = "*" + +[package.extras] +a11y = ["pytest-playwright"] +dev = ["nox", "pre-commit", "pydata-sphinx-theme[doc,test]", "pyyaml"] +doc = ["ablog (>=0.11.0rc2)", "colorama", "ipykernel", "ipyleaflet", "jupyter_sphinx", "jupyterlite-sphinx", "linkify-it-py", "matplotlib", "myst-parser", "nbsphinx", "numpy", "numpydoc", "pandas", "plotly", "rich", "sphinx-autoapi (>=3.0.0)", "sphinx-copybutton", "sphinx-design", "sphinx-favicon (>=1.0.1)", "sphinx-sitemap", "sphinx-togglebutton", "sphinxcontrib-youtube (<1.4)", "sphinxext-rediraffe", "xarray"] +test = ["pytest", "pytest-cov", "pytest-regressions"] + [[package]] name = "pygments" version = "2.16.1" @@ -1475,22 +1534,33 @@ files = [ {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, ] +[[package]] +name = "soupsieve" +version = "2.5" +description = "A modern CSS selector implementation for Beautiful Soup." +optional = false +python-versions = ">=3.8" +files = [ + {file = "soupsieve-2.5-py3-none-any.whl", hash = "sha256:eaa337ff55a1579b6549dc679565eac1e3d000563bcb1c8ab0d0fefbc0c2cdc7"}, + {file = "soupsieve-2.5.tar.gz", hash = "sha256:5663d5a7b3bfaeee0bc4372e7fc48f9cff4940b3eec54a6451cc5299f1097690"}, +] + [[package]] name = "sphinx" -version = "7.1.2" +version = "6.2.1" description = "Python documentation generator" optional = false python-versions = ">=3.8" files = [ - {file = "sphinx-7.1.2-py3-none-any.whl", hash = "sha256:d170a81825b2fcacb6dfd5a0d7f578a053e45d3f2b153fecc948c37344eb4cbe"}, - {file = "sphinx-7.1.2.tar.gz", hash = "sha256:780f4d32f1d7d1126576e0e5ecc19dc32ab76cd24e950228dcf7b1f6d3d9e22f"}, + {file = "Sphinx-6.2.1.tar.gz", hash = "sha256:6d56a34697bb749ffa0152feafc4b19836c755d90a7c59b72bc7dfd371b9cc6b"}, + {file = "sphinx-6.2.1-py3-none-any.whl", hash = "sha256:97787ff1fa3256a3eef9eda523a63dbf299f7b47e053cfcf684a1c2a8380c912"}, ] [package.dependencies] alabaster = ">=0.7,<0.8" babel = ">=2.9" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} -docutils = ">=0.18.1,<0.21" +docutils = ">=0.18.1,<0.20" imagesize = ">=1.3" importlib-metadata = {version = ">=4.8", markers = "python_version < \"3.10\""} Jinja2 = ">=3.0" @@ -1510,6 +1580,26 @@ docs = ["sphinxcontrib-websupport"] lint = ["docutils-stubs", "flake8 (>=3.5.0)", "flake8-simplify", "isort", "mypy (>=0.990)", "ruff", "sphinx-lint", "types-requests"] test = ["cython", "filelock", "html5lib", "pytest (>=4.6)"] +[[package]] +name = "sphinx-book-theme" +version = "1.0.1" +description = "A clean book theme for scientific explanations and documentation with Sphinx" +optional = false +python-versions = ">=3.7" +files = [ + {file = "sphinx_book_theme-1.0.1-py3-none-any.whl", hash = "sha256:d15f8248b3718a9a6be0ba617a32d1591f9fa39c614469bface777ba06a73b75"}, + {file = "sphinx_book_theme-1.0.1.tar.gz", hash = "sha256:927b399a6906be067e49c11ef1a87472f1b1964075c9eea30fb82c64b20aedee"}, +] + +[package.dependencies] +pydata-sphinx-theme = ">=0.13.3" +sphinx = ">=4,<7" + +[package.extras] +code-style = ["pre-commit"] +doc = ["ablog", "docutils (==0.17.1)", "folium", "ipywidgets", "matplotlib", "myst-nb", "nbclient", "numpy", "numpydoc", "pandas", "plotly", "sphinx-copybutton", "sphinx-design", "sphinx-examples", "sphinx-tabs (<=3.4.0)", "sphinx-thebe", "sphinx-togglebutton", "sphinxcontrib-bibtex", "sphinxcontrib-youtube", "sphinxext-opengraph"] +test = ["beautifulsoup4", "coverage", "myst-nb", "pytest", "pytest-cov", "pytest-regressions", "sphinx_thebe"] + [[package]] name = "sphinx-rtd-theme" version = "1.3.0" @@ -1947,4 +2037,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "0f014df1dac47ecaf87385db9a65a90027ecede8aa5c78d7a92796a198462cb2" +content-hash = "c9b95116972385e736df8920c6a48032c9a9562fd374e193ddfa1d3adef26a93" diff --git a/pyproject.toml b/pyproject.toml index 6179f66..fd2c820 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ isort = "^5.12.0" black = "^23.7.0" pre-commit = "^3.3.3" sphinx-rtd-theme = "^1.3.0" +sphinx-book-theme = "^1.0.1" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/saagieapi/gql_queries.py b/saagieapi/gql_queries.py index b84815b..433e6e0 100644 --- a/saagieapi/gql_queries.py +++ b/saagieapi/gql_queries.py @@ -27,6 +27,7 @@ { platform{ id + name counts{ projects jobs diff --git a/saagieapi/jobs/jobs.py b/saagieapi/jobs/jobs.py index 649a732..1a1d555 100644 --- a/saagieapi/jobs/jobs.py +++ b/saagieapi/jobs/jobs.py @@ -1877,7 +1877,7 @@ def count_deletable_instances_by_date(self, job_id: str, date_before: str): Examples -------- - >>> saagie_api.jobs.count_instances_by_date(job_id=job_id, date_before="2023-06-01T00:00:00+01:00") + >>> saagie_api.jobs.count_deletable_instances_by_date(job_id=job_id, date_before="2023-06-01T00:00:00+01:00") { 'countJobInstancesByDate': 3 } @@ -1929,7 +1929,7 @@ def move_job(self, job_id: str, target_platform_id: int, target_project_id: str) }, ) - def generate_description_by_AI(self, job_id: str): + def generate_description_by_ai(self, job_id: str): """Generate a description for a job using AI. Be careful, by calling this function the code contained in the job package will be sent to OpenAI and thus will not be secured anymore by Saagie DataOps Platform. @@ -1947,7 +1947,7 @@ def generate_description_by_AI(self, job_id: str): Examples -------- - >>> saagie_api.jobs.generate_description_by_AI(job_id=job_id) + >>> saagie_api.jobs.generate_description_by_ai(job_id=job_id) { 'editJobWithAiGeneratedDescription': { 'id': 'bfa25e4a-1796-4ebb-8c3d-138f74146973', diff --git a/tests/integration/jobs_integration_test.py b/tests/integration/jobs_integration_test.py index f894755..26c1cad 100644 --- a/tests/integration/jobs_integration_test.py +++ b/tests/integration/jobs_integration_test.py @@ -447,7 +447,7 @@ def test_generate_description_by_ai(create_then_delete_job, create_global_projec conf = create_global_project job_id = create_then_delete_job - result = conf.saagie_api.jobs.generate_description_by_AI(job_id=job_id) + result = conf.saagie_api.jobs.generate_description_by_ai(job_id=job_id) assert "editJobWithAiGeneratedDescription" in result assert result["editJobWithAiGeneratedDescription"]["id"] == job_id