Skip to content

Commit

Permalink
Sphinxのバージョンをv0.8に変更しました。 (#670)
Browse files Browse the repository at this point in the history
* update pyproject toml

* update docstring

* update

* publishできるようにする

* format

* update requests.txt
  • Loading branch information
yuji38kwmt authored Aug 14, 2024
1 parent 858f6a0 commit 5d48d93
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 165 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ jobs:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
- name: Install poetry
run: |
python -m pip install "poetry<1.7" poetry-dynamic-versioning
python -m pip install "poetry<1.9"
poetry install --only publish
- name: Publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Expand Down
2 changes: 0 additions & 2 deletions annofabapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion annofabapi/api2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

#########################################
Expand Down
8 changes: 5 additions & 3 deletions annofabapi/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
25 changes: 0 additions & 25 deletions docs/api_reference/dataclass.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,11 @@ annofabapi.dataclass.input module
:members:


annofabapi.dataclass.inspection module
--------------------------------------
.. automodule:: annofabapi.dataclass.inspection
:members:

annofabapi.dataclass.instruction module
---------------------------------------
.. automodule:: annofabapi.dataclass.instruction
:members:

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
Expand All @@ -61,11 +46,6 @@ annofabapi.dataclass.project_member module
:members:


annofabapi.dataclass.statistics module
--------------------------------------
.. automodule:: annofabapi.dataclass.statistics
:members:

annofabapi.dataclass.supplementary module
-----------------------------------------
.. automodule:: annofabapi.dataclass.supplementary
Expand All @@ -77,8 +57,3 @@ annofabapi.dataclass.task module
.. automodule:: annofabapi.dataclass.task
:members:

annofabapi.dataclass.webhook module
-----------------------------------
.. automodule:: annofabapi.dataclass.webhook
:members:

2 changes: 1 addition & 1 deletion docs/api_reference/segmentation.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
annofabapi.segmentation module
=========================
==================================================


.. automodule:: annofabapi.segmentation
Expand Down
8 changes: 3 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

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

# -- Project information -----------------------------------------------------

Expand Down Expand Up @@ -54,7 +53,6 @@
html_theme_options = {
"github_url": "https://github.com/kurusugawa-computer/annofab-api-python-client",
"use_edit_page_button": True,
"footer_items": [], # footerを空にする
}

html_logo = "img/logo_landscape.png"
Expand Down
5 changes: 3 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sphinx==6.1.3
pydata-sphinx-theme==0.13.3
Sphinx==8.0.2
pydata-sphinx-theme==0.15.4



Loading

0 comments on commit 5d48d93

Please sign in to comment.