From fb07a27e5b925d199a2f6adac2fc5ababf3acb36 Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Wed, 14 Aug 2024 10:41:37 +0900 Subject: [PATCH] update docstring --- annofabapi/api.py | 2 -- annofabapi/api2.py | 4 ++- annofabapi/resource.py | 8 +++-- docs/api_reference/dataclass.rst | 5 --- poetry.lock | 56 ++++++++++++++++---------------- 5 files changed, 36 insertions(+), 39 deletions(-) diff --git a/annofabapi/api.py b/annofabapi/api.py index 738a8666..98bfa183 100644 --- a/annofabapi/api.py +++ b/annofabapi/api.py @@ -257,10 +257,8 @@ def __init__( self.url_prefix = f"{endpoint_url}/api/v1" self.session = requests.Session() - #: login, refresh_tokenで取得したtoken情報 self.token_dict: Optional[Dict[str, Any]] = None - #: Signed Cookie情報 self.cookies: Optional[RequestsCookieJar] = None self.__account_id: Optional[str] = None diff --git a/annofabapi/api2.py b/annofabapi/api2.py index 5d5495b6..14598494 100644 --- a/annofabapi/api2.py +++ b/annofabapi/api2.py @@ -29,13 +29,15 @@ class AnnofabApi2(AbstractAnnofabApi2): Args: api: API v1のインスタンス(一部のAPIは、v1のログインメソッドを利用するため) + Attributes: + cookies: Signed Cookie情報 + """ def __init__(self, api: AnnofabApi) -> None: self.api = api self.url_prefix = f"{api.endpoint_url}/api/v2" - #: Signed Cookie情報 cookies: Optional[RequestsCookieJar] = None ######################################### diff --git a/annofabapi/resource.py b/annofabapi/resource.py index d7f7a726..62bbec65 100644 --- a/annofabapi/resource.py +++ b/annofabapi/resource.py @@ -21,20 +21,22 @@ class Resource: endpoint_url: Annofab APIのエンドポイント。 input_mfa_code_via_stdin: MFAコードを標準入力から入力するかどうか + Attributes: + api: ``annofabapi.AnnofabApi`` のインスタンス + wrapper: ``annofabapi.Wrapper`` のインスタンス + api2: ``annofabapi.AnnofabApi2`` のインスタンス + """ def __init__( self, login_user_id: str, login_password: str, *, endpoint_url: str = DEFAULT_ENDPOINT_URL, input_mfa_code_via_stdin: bool = False ) -> None: - #: AnnofabApi Instance self.api = AnnofabApi( login_user_id=login_user_id, login_password=login_password, endpoint_url=endpoint_url, input_mfa_code_via_stdin=input_mfa_code_via_stdin ) - #: Wrapper Instance self.wrapper = Wrapper(self.api) - #: AnnofabApi2 Instance self.api2 = AnnofabApi2(self.api) logger.debug("Create annofabapi resource instance :: %s", {"login_user_id": login_user_id, "endpoint_url": endpoint_url}) diff --git a/docs/api_reference/dataclass.rst b/docs/api_reference/dataclass.rst index e112d59d..d98b69cd 100644 --- a/docs/api_reference/dataclass.rst +++ b/docs/api_reference/dataclass.rst @@ -22,11 +22,6 @@ annofabapi.dataclass.job module .. automodule:: annofabapi.dataclass.job :members: -annofabapi.dataclass.my module ------------------------------- -.. automodule:: annofabapi.dataclass.my - :members: - annofabapi.dataclass.organization module ---------------------------------------- .. automodule:: annofabapi.dataclass.organization diff --git a/poetry.lock b/poetry.lock index 3248de84..13092d58 100644 --- a/poetry.lock +++ b/poetry.lock @@ -20,13 +20,13 @@ tests = ["hypothesis", "pytest"] [[package]] name = "alabaster" -version = "0.7.16" +version = "1.0.0" description = "A light, configurable Sphinx theme" optional = false -python-versions = ">=3.9" +python-versions = ">=3.10" files = [ - {file = "alabaster-0.7.16-py3-none-any.whl", hash = "sha256:b46733c07dce03ae4e150330b975c75737fa60f0a7c591b6c8bf4928a28e2c92"}, - {file = "alabaster-0.7.16.tar.gz", hash = "sha256:75a8b99c28a5dad50dd7f8ccdd447a121ddb3892da9e53d1ca5cca3106d58d65"}, + {file = "alabaster-1.0.0-py3-none-any.whl", hash = "sha256:fc6786402dc3fcb2de3cabd5fe455a2db534b371124f1f21de8731783dec828b"}, + {file = "alabaster-1.0.0.tar.gz", hash = "sha256:c00dca57bca26fa62a6d7d0a9fcce65f3e026e9bfe33e9c538fd3fbb2144fd9e"}, ] [[package]] @@ -377,13 +377,13 @@ profile = ["gprof2dot (>=2022.7.29)"] [[package]] name = "docutils" -version = "0.20.1" +version = "0.21.2" description = "Docutils -- Python Documentation Utilities" optional = false -python-versions = ">=3.7" +python-versions = ">=3.9" files = [ - {file = "docutils-0.20.1-py3-none-any.whl", hash = "sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6"}, - {file = "docutils-0.20.1.tar.gz", hash = "sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b"}, + {file = "docutils-0.21.2-py3-none-any.whl", hash = "sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2"}, + {file = "docutils-0.21.2.tar.gz", hash = "sha256:3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f"}, ] [[package]] @@ -1252,48 +1252,48 @@ files = [ [[package]] name = "soupsieve" -version = "2.5" +version = "2.6" 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"}, + {file = "soupsieve-2.6-py3-none-any.whl", hash = "sha256:e72c4ff06e4fb6e4b5a9f0f55fe6e81514581fca1515028625d0f299c602ccc9"}, + {file = "soupsieve-2.6.tar.gz", hash = "sha256:e2e68417777af359ec65daac1057404a3c8a5455bb8abc36f1a9866ab1a51abb"}, ] [[package]] name = "sphinx" -version = "7.1.2" +version = "8.0.2" description = "Python documentation generator" optional = false -python-versions = ">=3.8" +python-versions = ">=3.10" 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-8.0.2-py3-none-any.whl", hash = "sha256:56173572ae6c1b9a38911786e206a110c9749116745873feae4f9ce88e59391d"}, + {file = "sphinx-8.0.2.tar.gz", hash = "sha256:0cce1ddcc4fd3532cf1dd283bc7d886758362c5c1de6598696579ce96d8ffa5b"}, ] [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" +alabaster = ">=0.7.14" +babel = ">=2.13" +colorama = {version = ">=0.4.6", markers = "sys_platform == \"win32\""} +docutils = ">=0.20,<0.22" imagesize = ">=1.3" -Jinja2 = ">=3.0" -packaging = ">=21.0" -Pygments = ">=2.13" -requests = ">=2.25.0" -snowballstemmer = ">=2.0" +Jinja2 = ">=3.1" +packaging = ">=23.0" +Pygments = ">=2.17" +requests = ">=2.30.0" +snowballstemmer = ">=2.2" sphinxcontrib-applehelp = "*" sphinxcontrib-devhelp = "*" sphinxcontrib-htmlhelp = ">=2.0.0" sphinxcontrib-jsmath = "*" sphinxcontrib-qthelp = "*" -sphinxcontrib-serializinghtml = ">=1.1.5" +sphinxcontrib-serializinghtml = ">=1.1.9" [package.extras] 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)"] +lint = ["flake8 (>=6.0)", "mypy (==1.11.0)", "pytest (>=6.0)", "ruff (==0.5.5)", "sphinx-lint (>=0.9)", "tomli (>=2)", "types-Pillow (==10.2.0.20240520)", "types-Pygments (==2.18.0.20240506)", "types-colorama (==0.4.15.20240311)", "types-defusedxml (==0.7.0.20240218)", "types-docutils (==0.21.0.20240724)", "types-requests (>=2.30.0)"] +test = ["cython (>=3.0)", "defusedxml (>=0.7.1)", "pytest (>=8.0)", "setuptools (>=70.0)", "typing_extensions (>=4.9)"] [[package]] name = "sphinxcontrib-applehelp" @@ -1541,4 +1541,4 @@ segmentation = ["numpy", "numpy", "pillow"] [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "d1949fd8ae82f1dafae0dc1d96ebd0fb91ad570c258f1cf286fcc54013c56f09" +content-hash = "71528989e99f91bdaa011eda85f4ca0b67a8828bc95baafffe280c361b384b35"