From 9c4db628b2631a597254bc661819b520999bbfef Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Thu, 4 Mar 2021 23:08:49 +0900 Subject: [PATCH 01/19] update pyproject.toml --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 502f1947..cc3f2a62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,7 @@ classifiers = [ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Topic :: Utilities", "Operating System :: OS Independent", ] From 420040e981b6b37169d844daa9a7e3ad8affe328 Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Sun, 4 Apr 2021 15:34:21 +0900 Subject: [PATCH 02/19] annofab v0.111.0 --- annofabapi/dataclass/annotation_specs.py | 34 +-- annofabapi/generated_api.py | 94 ++++++++ annofabapi/models.py | 81 +++++++ generate/swagger/swagger-api-components.yaml | 107 +++++++-- generate/swagger/swagger.v2.yaml | 2 +- generate/swagger/swagger.yaml | 229 ++++++++++++++++++- 6 files changed, 509 insertions(+), 38 deletions(-) diff --git a/annofabapi/dataclass/annotation_specs.py b/annofabapi/dataclass/annotation_specs.py index 682c62d7..2397a232 100644 --- a/annofabapi/dataclass/annotation_specs.py +++ b/annofabapi/dataclass/annotation_specs.py @@ -183,7 +183,7 @@ class AdditionalDataDefinitionV1Choices(DataClassJsonMixin): name: InternationalizationMessage """""" - keybind: List[Keybind] + keybind: Optional[List[Keybind]] """""" @@ -194,34 +194,34 @@ class AdditionalDataDefinitionV1(DataClassJsonMixin): additional_data_definition_id: str """""" - read_only: bool + read_only: Optional[bool] """""" - name: InternationalizationMessage + name: Optional[InternationalizationMessage] """""" - default: AdditionalDataDefaultType + default: Optional[AdditionalDataDefaultType] """""" - keybind: List[Keybind] + keybind: Optional[List[Keybind]] """""" type: AdditionalDataDefinitionType """""" - choices: List[AdditionalDataDefinitionV1Choices] + choices: Optional[List[AdditionalDataDefinitionV1Choices]] """""" regex: Optional[str] """""" - label_ids: List[str] + label_ids: Optional[List[str]] """リンク属性において、リンク先として指定可能なラベルID(空の場合制限なし)""" required: Optional[bool] """リンク属性において、入力を必須とするかどうか""" - metadata: Dict[str, str] + metadata: Optional[Dict[str, str]] """ユーザーが自由に登録できるkey-value型のメタデータです。 """ @@ -232,25 +232,25 @@ class AdditionalDataDefinitionV2(DataClassJsonMixin): additional_data_definition_id: str """""" - read_only: bool + read_only: Optional[bool] """""" name: InternationalizationMessage """""" - default: AdditionalDataDefaultType + default: Optional[AdditionalDataDefaultType] """""" - keybind: List[Keybind] + keybind: Optional[List[Keybind]] """""" type: AdditionalDataDefinitionType """""" - choices: List[AdditionalDataDefinitionV1Choices] + choices: Optional[List[AdditionalDataDefinitionV1Choices]] """""" - metadata: Dict[str, str] + metadata: Optional[Dict[str, str]] """ユーザーが自由に登録できるkey-value型のメタデータです。 """ @@ -308,10 +308,10 @@ class LabelV1(DataClassJsonMixin): annotation_editor_feature: AnnotationEditorFeature """""" - allow_out_of_image_bounds: bool + allow_out_of_image_bounds: Optional[bool] """""" - metadata: Dict[str, str] + metadata: Optional[Dict[str, str]] """ユーザーが自由に登録できるkey-value型のメタデータです。 """ @@ -346,10 +346,10 @@ class LabelV2(DataClassJsonMixin): annotation_editor_feature: AnnotationEditorFeature """""" - allow_out_of_image_bounds: bool + allow_out_of_image_bounds: Optional[bool] """""" - metadata: Dict[str, str] + metadata: Optional[Dict[str, str]] """ユーザーが自由に登録できるkey-value型のメタデータです。 """ diff --git a/annofabapi/generated_api.py b/annofabapi/generated_api.py index 75aa4825..bd599bda 100644 --- a/annofabapi/generated_api.py +++ b/annofabapi/generated_api.py @@ -1430,6 +1430,33 @@ def get_projects_of_organization( # NOTE: This method is auto generated by OpenAPI Generator ######################################### + def delete_organization_input_data( + self, organization_name: str, input_data_set_id: str, input_data_id: str, **kwargs + ) -> Tuple[Any, requests.Response]: + """入力データセットの入力データ削除 + https://annofab.com/docs/api/#operation/deleteOrganizationInputData + + + authorizations: OrganizationAdministrator, ProjectOwner + + + 指定した組織の[入力データセット](#tag/af-organization-input)内で指定した入力データ情報を削除します。 + + Args: + organization_name (str): 組織名 (required) + input_data_set_id (str): 入力データセットID (required) + input_data_id (str): 入力データID (required) + + Returns: + Tuple[InputData, requests.Response] + + + """ + url_path = f"/organizations/{organization_name}/input_data_set/{input_data_set_id}/inputs/{input_data_id}" + http_method = "DELETE" + keyword_params: Dict[str, Any] = {} + return self._request_wrapper(http_method, url_path, **keyword_params) + def get_input_data_set( self, organization_name: str, input_data_set_id: str, **kwargs ) -> Tuple[Any, requests.Response]: @@ -1506,6 +1533,73 @@ def get_organization_input_data( keyword_params: Dict[str, Any] = {} return self._request_wrapper(http_method, url_path, **keyword_params) + def get_organization_input_data_list( + self, organization_name: str, input_data_set_id: str, query_params: Optional[Dict[str, Any]] = None, **kwargs + ) -> Tuple[Any, requests.Response]: + """入力データセット内の入力データ一括取得 + https://annofab.com/docs/api/#operation/getOrganizationInputDataList + + + authorizations: AllOrganizationMember + + + 指定された入力データセットの入力データを検索します。 組織オーナーまたは組織管理者でない場合は自身が所属するプロジェクトの入力データセット内の入力データのみが取得できます。 パフォーマンスのため、結果はページング形式で返ります。全件取得したい場合は、レスポンスを見て、ページ移動してください。 + + Args: + organization_name (str): 組織名 (required) + input_data_set_id (str): 入力データセットID (required) + query_params (Dict[str, Any]): Query Parameters + input_data_id (str): 入力データIDでの部分一致検索で使用。1文字以上あれば使用します。 + input_data_name (str): 入力データ名での部分一致検索で使用。1文字以上あれば使用します。 + input_data_path (str): 入力データパスでの部分一致検索で使用。1文字以上あれば使用します。 + task_id (str): 入力データが紐づくタスクIDの部分一致検索で使用。1文字以上あれば使用します。条件に合致した先頭100件のタスクに使われている入力データを検索します。 + _from (str): 更新日時での範囲検索で使用(ISO 8601 拡張形式) + to (str): 更新日時での範囲検索で使用(ISO 8601 拡張形式) + page (int): 検索結果のうち、取得したいページの番号(1始まり) + limit (int): 1ページあたりの取得するデータ件数 + + Returns: + Tuple[InputDataList, requests.Response] + + + """ + url_path = f"/organizations/{organization_name}/input_data_set/{input_data_set_id}/inputs" + http_method = "GET" + keyword_params: Dict[str, Any] = { + "query_params": query_params, + } + return self._request_wrapper(http_method, url_path, **keyword_params) + + def put_input_data_set( + self, organization_name: str, input_data_set_id: str, request_body: Optional[Any] = None, **kwargs + ) -> Tuple[Any, requests.Response]: + """入力データセット新規作成/更新 + https://annofab.com/docs/api/#operation/putInputDataSet + + + authorizations: OrganizationAdministrator, OrganizationOwner + + + 指定した組織の[入力データセット](#tag/af-organization-input)の情報を新規登録/更新します。 + + Args: + organization_name (str): 組織名 (required) + input_data_set_id (str): 入力データセットID (required) + request_body (Any): Request Body + put_input_data_set_request (PutInputDataSetRequest): + + Returns: + Tuple[InputDataSet, requests.Response] + + + """ + url_path = f"/organizations/{organization_name}/input_data_set/{input_data_set_id}" + http_method = "PUT" + keyword_params: Dict[str, Any] = { + "request_body": request_body, + } + return self._request_wrapper(http_method, url_path, **keyword_params) + ######################################### # Public Method : AfOrganizationMemberApi # NOTE: This method is auto generated by OpenAPI Generator diff --git a/annofabapi/models.py b/annofabapi/models.py index c1f6f558..f2510693 100644 --- a/annofabapi/models.py +++ b/annofabapi/models.py @@ -2763,6 +2763,8 @@ class OrganizationMemberStatus(Enum): * url: str カスタムアノテーション仕様画面の URL です。 プラグイン種別がカスタムアノテーション仕様の場合のみ有効です。 この URL には、プロジェクトを特定するための以下のパラメータを必ず埋め込んでください。 * `{projectId}` +* auth_redirect_url: str + 認証後のリダイレクト先 * compatible_input_data_types: List[InputDataType] プラグインが対応している入力データです。 プラグイン種別がカスタムアノテーションエディタ、またはカスタムアノテーション仕様の場合のみ有効です。 * type: str @@ -2778,6 +2780,8 @@ class OrganizationMemberStatus(Enum): * url: str カスタムアノテーションエディタでタスクを開くための URL です。 プラグインを使用するプロジェクトのタスク一覧などで使用されます。 プラグイン種別がカスタムアノテーションエディタの場合のみ有効です。 この URL には、タスクを特定するための以下のパラメータを必ず埋め込んでください。 * `{projectId}` * `{taskId}` 以下のパラメーターは任意で指定します。 * `{inputDataId}`: アノテーション一覧などから、特定の入力データにフォーカスした状態でタスクを開くときなどに指定します。 * `{annotationId}`: アノテーション一覧などから、特定のアノテーションにフォーカスした状態でタスクを開くときなどに指定します。 +* auth_redirect_url: str + 認証後のリダイレクト先。このURLに `?code=xxx` をつけてリダイレクトされます。 url プロパティとは異なり、 `{projectId}` や `{taskId}` といったパラメータの置換は行われません。 詳しくは [requestPluginToken API](#operation/requestPluginToken) を参照してください。 * compatible_input_data_types: List[InputDataType] プラグインが対応している入力データです。 プラグイン種別がカスタムアノテーションエディタ、またはカスタムアノテーション仕様の場合のみ有効です。 * type: str @@ -2793,6 +2797,8 @@ class OrganizationMemberStatus(Enum): * url: str カスタムアノテーション仕様画面の URL です。 プラグイン種別がカスタムアノテーション仕様の場合のみ有効です。 この URL には、プロジェクトを特定するための以下のパラメータを必ず埋め込んでください。 * `{projectId}` +* auth_redirect_url: str + 認証後のリダイレクト先 * compatible_input_data_types: List[InputDataType] プラグインが対応している入力データです。 プラグイン種別がカスタムアノテーションエディタ、またはカスタムアノテーション仕様の場合のみ有効です。 * type: str @@ -2813,6 +2819,64 @@ class OrganizationMemberStatus(Enum): """ +PluginTokenRequest = Dict[str, Any] +""" + + +Kyes of Dict + +* type: str + `RefreshToken` を指定します +* authorization_code: str + リダイレクト時にクエリパラメータ `code` として受け取った文字列 +* code_verifier: str + 認可リクエスト時に渡した `code_challenge` に対応するverifier文字列 +* refresh_token: str + 前回のトークン発行で得られた `refresh_token` + +""" + +PluginTokenRequestAuthorizationCode = Dict[str, Any] +""" + + +Kyes of Dict + +* type: str + `AuthorizationCode` を指定します +* authorization_code: str + リダイレクト時にクエリパラメータ `code` として受け取った文字列 +* code_verifier: str + 認可リクエスト時に渡した `code_challenge` に対応するverifier文字列 + +""" + +PluginTokenRequestRefreshToken = Dict[str, Any] +""" + + +Kyes of Dict + +* type: str + `RefreshToken` を指定します +* refresh_token: str + 前回のトークン発行で得られた `refresh_token` + +""" + +PluginTokenResponse = Dict[str, Any] +""" + + +Kyes of Dict + +* access_token: str + APIアクセスに用いるトークン。 リクエストヘッダにおいて `Authorization: Bearer {access_token}` の形で指定します。 +* refresh_token: str + トークンの更新に用いるトークン。 + +""" + Point = Dict[str, Any] """ 座標 @@ -3239,6 +3303,23 @@ class ProjectStatus(Enum): * tasks: List[ProjectTaskStatistics] +""" + +PutInputDataSetRequest = Dict[str, Any] +""" +入力データセット新規作成/更新 + +Kyes of Dict + +* input_data_set_name: str + 表示用の名前です。 +* input_data_type: InputDataType + +* private_storage_arn: str + AWS IAMロール。ビジネスプランでのS3プライベートストレージの認可で使います。 [S3プライベートストレージの認可の設定についてはこちら](/docs/faq/#m0b240)をご覧ください。 +* last_updated_datetime: str + 入力データセットの最終更新日時 + """ PutMarkersRequest = Dict[str, Any] diff --git a/generate/swagger/swagger-api-components.yaml b/generate/swagger/swagger-api-components.yaml index da75b679..4fc38eb4 100644 --- a/generate/swagger/swagger-api-components.yaml +++ b/generate/swagger/swagger-api-components.yaml @@ -368,6 +368,59 @@ components: properties: refresh_token: type: string + PluginTokenRequest: + oneOf: + - $ref: "#/components/schemas/PluginTokenRequestAuthorizationCode" + - $ref: "#/components/schemas/PluginTokenRequestRefreshToken" + discriminator: + propertyName: "_type" + mapping: + AuthorizationCode: "#/components/schemas/PluginTokenRequestAuthorizationCode" + RefreshToken: "#/components/schemas/PluginTokenRequestRefreshToken" + PluginTokenRequestAuthorizationCode: + type: object + required: + - _type + - authorization_code + - code_verifier + properties: + _type: + type: string + default: AuthorizationCode + description: "`AuthorizationCode` を指定します" + authorization_code: + type: string + description: リダイレクト時にクエリパラメータ `code` として受け取った文字列 + code_verifier: + type: string + description: 認可リクエスト時に渡した `code_challenge` に対応するverifier文字列 + PluginTokenRequestRefreshToken: + type: object + required: + - _type + - refresh_token + properties: + _type: + type: string + default: RefreshToken + description: "`RefreshToken` を指定します" + refresh_token: + type: string + description: 前回のトークン発行で得られた `refresh_token` + PluginTokenResponse: + type: object + required: + - access_token + - refresh_token + properties: + access_token: + type: string + description: | + APIアクセスに用いるトークン。 + リクエストヘッダにおいて `Authorization: Bearer {access_token}` の形で指定します。 + refresh_token: + type: string + description: トークンの更新に用いるトークン。 ChangePasswordRequest: type: object required: @@ -708,6 +761,14 @@ components: properties: url: $ref: "#/components/schemas/AnnotationEditorUrl" + auth_redirect_url: + type: string + description: | + 認証後のリダイレクト先。このURLに `?code=xxx` をつけてリダイレクトされます。 + url プロパティとは異なり、 `{projectId}` や `{taskId}` といったパラメータの置換は行われません。 + + 詳しくは [requestPluginToken API](#operation/requestPluginToken) を参照してください。 + example: "https://example.com/my/editors" compatible_input_data_types: $ref: "#/components/schemas/PluginCompatibleInputDataTypes" _type: @@ -738,6 +799,10 @@ components: properties: url: $ref: "#/components/schemas/AnnotationSpecsUrl" + auth_redirect_url: + type: string + description: | + 認証後のリダイレクト先 compatible_input_data_types: $ref: "#/components/schemas/PluginCompatibleInputDataTypes" _type: @@ -2285,8 +2350,6 @@ components: - additional_data_definitions - color - annotation_editor_feature - - allow_out_of_image_bounds - - metadata properties: label_id: $ref: "#/components/schemas/LabelId" @@ -2375,8 +2438,6 @@ components: - additional_data_definitions - color - annotation_editor_feature - - allow_out_of_image_bounds - - metadata properties: label_id: $ref: "#/components/schemas/LabelId" @@ -2500,14 +2561,9 @@ components: type: object required: - additional_data_definition_id - - read_only - - name - - default - - keybind + # 正確にはnameもrequiredだが、annofab-api-js-clientでAnnotationSpecsV2を読む際に支障があるので消している #8590 + # - name - type - - choices - - label_ids - - metadata properties: additional_data_definition_id: $ref: "#/components/schemas/AdditionalDataDefinitionId" @@ -2531,7 +2587,6 @@ components: required: - choice_id - name - - keybind properties: choice_id: $ref: "#/components/schemas/ChoiceId" @@ -2561,13 +2616,8 @@ components: type: object required: - additional_data_definition_id - - read_only - name - - default - - keybind - type - - choices - - metadata properties: additional_data_definition_id: $ref: "#/components/schemas/AdditionalDataDefinitionId" @@ -2591,7 +2641,6 @@ components: required: - choice_id - name - - keybind properties: choice_id: $ref: "#/components/schemas/ChoiceId" @@ -3245,6 +3294,28 @@ components: type: string format: date-time description: 入力データセットの最終更新日時 + PutInputDataSetRequest: + description: 入力データセット新規作成/更新 + type: object + required: + - input_data_set_name + - input_data_type + properties: + input_data_set_name: + type: string + description: 表示用の名前です。 + input_data_type: + $ref: "#/components/schemas/InputDataType" + private_storage_arn: + type: string + description: | + AWS IAMロール。ビジネスプランでのS3プライベートストレージの認可で使います。 + [S3プライベートストレージの認可の設定についてはこちら](/docs/faq/#m0b240)をご覧ください。 + example: "arn:aws:iam::123456789012:role/AnnoFabPrivateStorageAccessor" + last_updated_datetime: + type: string + format: date-time + description: 入力データセットの最終更新日時 InputData: description: 入力データの情報を表すデータ構造です。 type: object diff --git a/generate/swagger/swagger.v2.yaml b/generate/swagger/swagger.v2.yaml index 05acf429..f2aa894b 100644 --- a/generate/swagger/swagger.v2.yaml +++ b/generate/swagger/swagger.v2.yaml @@ -115,7 +115,7 @@ info: 上記例 `account_id_count` は、タスクのフィールド `account_id` でタスクを分類したところ「`account_id` が `c5eee002` であるタスクが9件、`9f110e48` であるタスクが5件、`b25dfeb3` であるタスクが1件」だったという結果を表しています。 - version: 0.108.0 + version: 0.111.0 title: AnnoFab Web API x-logo: url: "https://annofab.com/resource/images/logo_landscape.png" diff --git a/generate/swagger/swagger.yaml b/generate/swagger/swagger.yaml index 7f1733f6..a9d8ae5b 100644 --- a/generate/swagger/swagger.yaml +++ b/generate/swagger/swagger.yaml @@ -116,7 +116,7 @@ info: 上記例 `account_id_count` は、タスクのフィールド `account_id` でタスクを分類したところ「`account_id` が `c5eee002` であるタスクが9件、`9f110e48` であるタスクが5件、`b25dfeb3` であるタスクが1件」だったという結果を表しています。 また、AggregationResultの集約の件数は、合計で10000件以下に制限されており、それを超える件数がある場合は上位10000件が取得されます。もし、省略された部分を取得したい場合は、検索条件を縛って結果に上る集約の数を減らしてください。 - version: 0.108.0 + version: 0.111.0 title: AnnoFab Web API x-logo: url: "https://annofab.com/resource/images/logo_landscape.png" @@ -175,7 +175,9 @@ tags: - name: af-organization-input x-displayName: Organization Input description: | - 組織の入力データセットと入力データに対する操作 + 入力データセットと入力データに対する操作 + + **入力データセットに関するAPIは開発中のため、予告なく変更されることがあります。** **入力データセット**とは、プロジェクトが用いる入力データの集合です。入力データセットは組織に所属します。 現時点では入力データセットはプロジェクトを新規作成するごとに一つずつ作成されるようになっています。 @@ -502,6 +504,52 @@ paths: $ref: "swagger-api-components.yaml#/components/responses/ErrorRefreshTokenExpired" "503": $ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance" + /plugin-token: + post: + tags: + - af-login + summary: プラグイン用トークン発行 + description: | + プラグイン用のトークンを発行します。 + ここで発行されるアクセストークンは、プラグインの種別に応じた範囲のAPIアクセスに使用することができます。 + + 現時点ではカスタムアノテーションエディタ用のプラグインのみに対応しています。 + + #### authorization_code を使う場合 (PluginTokenRequestAuthorizationCode) + 1. プラグイン: PKCE (RFC 7636) の code_challenge_method=S256 の場合に準ずる形で `code_verifier` `code_challenge` を生成 + 1. プラグイン: `https://annofab.com/project/{project_id}/authorize-plugin?plugin_type={plugin_type}&code_challenge={code_challenge}` へリダイレクト + - `plugin_type` はカスタムアノテーションエディタの場合は `AnnotationEditor` を、カスタムアノテーション仕様の場合は `AnnotationSpecs` を指定 + 1. AnnoFab: リクエストやユーザー権限の確認後、プラグインの auth_redirect_url に設定されたURLへクエリパラメータ `code` つきでリダイレクト + 1. プラグイン: 本APIに上記 code および1で生成した code_verifier を渡し、access_token と refresh_token を得る + + code付きでカスタムエディタにリダイレクトする際のURLは、タスク一覧等からのリダイレクトに使うURLとは別に設定し、projectIdやtaskIdは含まれません。 + AnnoFabへリダイレクトする前に `location.href` などを保存しておき、トークン取得後にURL書き換えやリダイレクトを行うことを推奨します。 + + この手順で取得したaccess_tokenを使って他のAPIをリクエストする際には `Authorization: Bearer ` としてBearer付きでアクセスしてください。 + + #### refresh_token を使う場合 (PluginTokenRequestRefreshToken) + 1. プラグイン: 前回のトークン発行時に access_token と共に発行される refresh_token を記憶しておく + 1. プラグイン: 本APIに上記 refresh_token を渡し、 access_token と refresh_token を得る + security: + - EveryoneRequestBody: [] + operationId: requestPluginToken + requestBody: + required: true + content: + application/json: + schema: + $ref: "swagger-api-components.yaml#/components/schemas/PluginTokenRequest" + responses: + "200": + description: 正常 + content: + application/json: + schema: + $ref: "swagger-api-components.yaml#/components/schemas/PluginTokenResponse" + "400": + $ref: "swagger-api-components.yaml#/components/responses/ErrorInvalidRequest" + "503": + $ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance" /sign-up: post: tags: @@ -1607,6 +1655,141 @@ paths: $ref: "swagger-api-components.yaml#/components/responses/ErrorUnauthorizedApi" "503": $ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance" + put: + operationId: putInputDataSet + summary: 入力データセット新規作成/更新 + description: | + 指定した組織の[入力データセット](#tag/af-organization-input)の情報を新規登録/更新します。 + tags: + - af-organization-input + security: + - OrganizationAdministrator: [] + - OrganizationOwner: [] + parameters: + - name: organization_name + in: path + required: true + schema: + $ref: "swagger-api-components.yaml#/components/schemas/OrganizationName" + description: 組織名 + - name: input_data_set_id + in: path + required: true + schema: + $ref: "swagger-api-components.yaml#/components/schemas/InputDataSetId" + description: 入力データセットID + requestBody: + content: + application/json: + schema: + $ref: "swagger-api-components.yaml#/components/schemas/PutInputDataSetRequest" + responses: + "200": + description: 正常 + content: + application/json: + schema: + $ref: "swagger-api-components.yaml#/components/schemas/InputDataSet" + "400": + $ref: "swagger-api-components.yaml#/components/responses/ErrorInvalidRequest" + "401": + $ref: "swagger-api-components.yaml#/components/responses/ErrorUnauthorizedApi" + "503": + $ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance" + /organizations/{organization_name}/input_data_set/{input_data_set_id}/inputs: + get: + tags: + - af-organization-input + summary: 入力データセット内の入力データ一括取得 + description: | + 指定された入力データセットの入力データを検索します。 + 組織オーナーまたは組織管理者でない場合は自身が所属するプロジェクトの入力データセット内の入力データのみが取得できます。 + + パフォーマンスのため、結果はページング形式で返ります。全件取得したい場合は、レスポンスを見て、ページ移動してください。 + security: + - AllOrganizationMember: [] + operationId: getOrganizationInputDataList + parameters: + - name: organization_name + in: path + required: true + schema: + $ref: "swagger-api-components.yaml#/components/schemas/OrganizationName" + description: 組織名 + - name: input_data_set_id + in: path + required: true + schema: + $ref: "swagger-api-components.yaml#/components/schemas/InputDataSetId" + description: 入力データセットID + - name: input_data_id + in: query + description: 入力データIDでの部分一致検索で使用。1文字以上あれば使用します。 + required: false + schema: + $ref: "swagger-api-components.yaml#/components/schemas/InputDataId" + - name: input_data_name + in: query + description: 入力データ名での部分一致検索で使用。1文字以上あれば使用します。 + required: false + schema: + type: string + - name: input_data_path + in: query + description: 入力データパスでの部分一致検索で使用。1文字以上あれば使用します。 + required: false + schema: + type: string + - name: task_id + in: query + description: 入力データが紐づくタスクIDの部分一致検索で使用。1文字以上あれば使用します。条件に合致した先頭100件のタスクに使われている入力データを検索します。 + required: false + schema: + type: string + - name: from + in: query + description: 更新日時での範囲検索で使用(ISO 8601 拡張形式) + required: false + schema: + type: string + format: date-time + - name: to + in: query + description: 更新日時での範囲検索で使用(ISO 8601 拡張形式) + required: false + schema: + type: string + format: date-time + - name: page + in: query + description: 検索結果のうち、取得したいページの番号(1始まり) + required: false + schema: + type: integer + minimum: 1 + default: 1 + - name: limit + in: query + description: 1ページあたりの取得するデータ件数 + required: false + schema: + type: integer + minimum: 1 + maximum: 200 + default: 30 + responses: + "200": + description: 指定された条件にあてはまる入力データを返します。条件にあてはまる入力データが多数に及ぶことがあるので、すべての結果を得るにはページングしてください。 + content: + application/json: + schema: + $ref: "swagger-api-components.yaml#/components/schemas/InputDataList" + "400": + $ref: "swagger-api-components.yaml#/components/responses/ErrorInvalidRequest" + "401": + $ref: "swagger-api-components.yaml#/components/responses/ErrorUnauthorizedApi" + "503": + $ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance" /organizations/{organization_name}/input_data_set/{input_data_set_id}/inputs/{input_data_id}: get: tags: @@ -1650,6 +1833,48 @@ paths: $ref: "swagger-api-components.yaml#/components/responses/ErrorMissingResource" "503": $ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance" + delete: + tags: + - af-organization-input + summary: 入力データセットの入力データ削除 + description: | + 指定した組織の[入力データセット](#tag/af-organization-input)内で指定した入力データ情報を削除します。 + security: + - OrganizationAdministrator: [] + - ProjectOwner: [] + operationId: deleteOrganizationInputData + parameters: + - name: organization_name + in: path + required: true + schema: + $ref: "swagger-api-components.yaml#/components/schemas/OrganizationName" + description: 組織名 + - name: input_data_set_id + in: path + required: true + schema: + $ref: "swagger-api-components.yaml#/components/schemas/InputDataSetId" + description: 入力データセットID + - name: input_data_id + in: path + description: 入力データID + required: true + schema: + $ref: "swagger-api-components.yaml#/components/schemas/InputDataId" + responses: + "200": + description: 正常 + content: + application/json: + schema: + $ref: "swagger-api-components.yaml#/components/schemas/InputData" + "401": + $ref: "swagger-api-components.yaml#/components/responses/ErrorUnauthorizedApi" + "404": + $ref: "swagger-api-components.yaml#/components/responses/ErrorMissingResource" + "503": + $ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance" /my/projects: get: tags: From 09f7ab641f7df3c038106387a747e9389ff3b4e6 Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Fri, 21 May 2021 15:48:43 +0900 Subject: [PATCH 03/19] =?UTF-8?q?extension=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/devcontainer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8c2015de..90ab9097 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -31,6 +31,7 @@ "ms-python.python", "ms-python.vscode-pylance", "streetsidesoftware.code-spell-checker", - "bungcip.better-toml" + "bungcip.better-toml", + "njpwerner.autodocstring" ] } \ No newline at end of file From 8727cc31ea300bcf47f5e47cddfe1c4cc12a3281 Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Fri, 21 May 2021 15:54:40 +0900 Subject: [PATCH 04/19] =?UTF-8?q?wrapper:=20put=5Fannotation=5Ffor=5Fsimpl?= =?UTF-8?q?e=5Fannotation=5Fjson=E3=82=92V2=E7=89=88=E3=81=AE=E3=82=A2?= =?UTF-8?q?=E3=83=8E=E3=83=86=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E4=BB=95?= =?UTF-8?q?=E6=A7=98=E3=81=AB=E3=82=82=E5=AF=BE=E5=BF=9C=E3=81=95=E3=81=9B?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- annofabapi/wrapper.py | 49 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/annofabapi/wrapper.py b/annofabapi/wrapper.py index 90b582fc..b0458d22 100644 --- a/annofabapi/wrapper.py +++ b/annofabapi/wrapper.py @@ -542,13 +542,46 @@ def __to_annotation_detail_for_request( return dest_obj + def __convert_annotation_specs_labels_v2_to_v1( + self, labels_v2: List[Dict[str, Any]], additionals_v2: List[Dict[str, Any]] + ) -> List[LabelV1]: + """アノテーション仕様のV2版からV1版に変換する。V1版の方が扱いやすいので。 + + Args: + labels_v2 (List[Dict[str, Any]]): V2版のラベル情報 + additionals_v2 (List[Dict[str, Any]]): V2版の属性情報 + + Returns: + List[LabelV1]: V1版のラベル情報 + """ + + def to_label_v1(label_v2, additionals_v2) -> LabelV1: + additional_data_definition_id_list = label_v2["additional_data_definitions"] + new_additional_data_definitions = [] + for additional_data_definition_id in additional_data_definition_id_list: + additional = _first_true( + additionals_v2, pred=lambda e: e["additional_data_definition_id"] == additional_data_definition_id + ) + if additional is not None: + new_additional_data_definitions.append(additional) + else: + raise ValueError( + f"additional_data_definition_id={additional_data_definition_id} に対応する属性情報が存在しません。" + "label_id={label_v2['label_id'], label_name_en={self.__get_label_name_en(label_v2))}" + ) + label_v2["additional_data_definitions"] = new_additional_data_definitions + return label_v2 + + return [to_label_v1(labels_v2, additionals_v2) for label_v2 in labels_v2] + def put_annotation_for_simple_annotation_json( self, project_id: str, task_id: str, input_data_id: str, simple_annotation_json: str, - annotation_specs_labels: List[LabelV1], + annotation_specs_labels: List[Dict[str, Any]], + annotation_specs_additionals: Optional[List[Dict[str, Any]]] = None, ) -> bool: """ AnnoFabからダウンロードしたアノテーションzip配下のJSONと同じフォーマット(Simple Annotation)の内容から、アノテーションを登録する。 @@ -557,10 +590,15 @@ def put_annotation_for_simple_annotation_json( project_id: task_id: input_data_id: - simple_annotation_json: + simple_annotation_json: AnnoFabからダウンロードしたアノテーションzip配下のJSONのパス + annotation_specs_labels: アノテーション仕様のラベル情報。annotation_specs_additionalsが指定されている場合はV2版、指定されない場合はV1版。 + annotation_specs_additionals: アノテーション仕様の属性情報(V2版) Returns: True:アノテーション情報をした。False: 登録するアノテーション情報がなかったため、登録しなかった。 + + Notes: + 2021/07以降、引数annotation_specs_labelsはV1版をサポートしなくなる予定です。 """ parser = SimpleAnnotationDirParser(Path(simple_annotation_json)) annotation = parser.load_json() @@ -571,9 +609,14 @@ def put_annotation_for_simple_annotation_json( return False request_details: List[Dict[str, Any]] = [] + annotation_specs_labels_v1 = ( + self.__convert_annotation_specs_labels_v2_to_v1(annotation_specs_labels, annotation_specs_additionals) + if annotation_specs_additionals is not None + else annotation_specs_labels + ) for detail in details: request_detail = self.__to_annotation_detail_for_request( - project_id, parser, detail, annotation_specs_labels + project_id, parser, detail, annotation_specs_labels_v1 ) if request_detail is not None: request_details.append(request_detail) From 032c38d9b5fa585f4d60016018f06ea9e5be5043 Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Fri, 21 May 2021 15:58:39 +0900 Subject: [PATCH 05/19] format --- annofabapi/wrapper.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/annofabapi/wrapper.py b/annofabapi/wrapper.py index b0458d22..ab19d228 100644 --- a/annofabapi/wrapper.py +++ b/annofabapi/wrapper.py @@ -542,8 +542,9 @@ def __to_annotation_detail_for_request( return dest_obj + @staticmethod def __convert_annotation_specs_labels_v2_to_v1( - self, labels_v2: List[Dict[str, Any]], additionals_v2: List[Dict[str, Any]] + labels_v2: List[Dict[str, Any]], additionals_v2: List[Dict[str, Any]] ) -> List[LabelV1]: """アノテーション仕様のV2版からV1版に変換する。V1版の方が扱いやすいので。 @@ -555,13 +556,16 @@ def __convert_annotation_specs_labels_v2_to_v1( List[LabelV1]: V1版のラベル情報 """ - def to_label_v1(label_v2, additionals_v2) -> LabelV1: + def get_additional(additional_data_definition_id: str) -> Optional[Dict[str, Any]]: + return _first_true( + additionals_v2, pred=lambda e: e["additional_data_definition_id"] == additional_data_definition_id + ) + + def to_label_v1(label_v2) -> LabelV1: additional_data_definition_id_list = label_v2["additional_data_definitions"] new_additional_data_definitions = [] for additional_data_definition_id in additional_data_definition_id_list: - additional = _first_true( - additionals_v2, pred=lambda e: e["additional_data_definition_id"] == additional_data_definition_id - ) + additional = get_additional(additional_data_definition_id) if additional is not None: new_additional_data_definitions.append(additional) else: From f53d501ea5e7d62f7366cbc12e3e1bfb7828d067 Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Fri, 21 May 2021 18:37:05 +0900 Subject: [PATCH 06/19] update wrapper --- annofabapi/wrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/annofabapi/wrapper.py b/annofabapi/wrapper.py index ab19d228..e5cca8b5 100644 --- a/annofabapi/wrapper.py +++ b/annofabapi/wrapper.py @@ -576,7 +576,7 @@ def to_label_v1(label_v2) -> LabelV1: label_v2["additional_data_definitions"] = new_additional_data_definitions return label_v2 - return [to_label_v1(labels_v2, additionals_v2) for label_v2 in labels_v2] + return [to_label_v1(labels_v2) for label_v2 in labels_v2] def put_annotation_for_simple_annotation_json( self, From ab7e3b61728a93a636ab930cc28be470f60c3e05 Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Sat, 22 May 2021 08:40:18 +0900 Subject: [PATCH 07/19] =?UTF-8?q?spell=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=81=AE=E8=A8=AD=E5=AE=9A=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/cspell.json | 23 +++++++++++++++++++++++ .vscode/settings.json | 11 +---------- 2 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 .vscode/cspell.json diff --git a/.vscode/cspell.json b/.vscode/cspell.json new file mode 100644 index 00000000..9820bda2 --- /dev/null +++ b/.vscode/cspell.json @@ -0,0 +1,23 @@ +{ + "version": "0.1", + "ignorePaths": [ + "**/.git/objects/**", + ".devcontainer/", + ".vscode/", + "LICENSE", + "tests/", + "generated_*.py", + "models.py" + ], + "enabledLanguageIds": [ + "python" + ], + "words": [ + "additionals", + "astimezone", + "asyncio", + "dateutil", + "pylint", + "tzlocal" + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index c8adac05..53d34082 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -37,14 +37,5 @@ "source.organizeImports": true }, }, - "cSpell.ignorePaths": [ - "**/.git/objects/**", - ".devcontainer/", - ".vscode/", - "LICENSE" - ], - "cSpell.words": [ - "pylint", - "asyncio" - ] + } \ No newline at end of file From 0522bf0b28a797b91e70ecb5117287f6b060b5ef Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Sat, 22 May 2021 08:40:26 +0900 Subject: [PATCH 08/19] =?UTF-8?q?lint=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .flake8 | 1 + 1 file changed, 1 insertion(+) diff --git a/.flake8 b/.flake8 index de5b7dde..3808f5fb 100644 --- a/.flake8 +++ b/.flake8 @@ -5,4 +5,5 @@ max-line-length = 120 # https://black.readthedocs.io/en/stable/the_black_code_style.html#line-length extend-ignore = E203, W503 +exclude = test_*.py From 4ac0420a92a0637f91820f552dac15bd57d2480a Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Sat, 22 May 2021 08:40:35 +0900 Subject: [PATCH 09/19] typo --- annofabapi/api2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/annofabapi/api2.py b/annofabapi/api2.py index 89dd5625..0975b1b5 100644 --- a/annofabapi/api2.py +++ b/annofabapi/api2.py @@ -45,7 +45,7 @@ def _request_wrapper( request_body: Optional[Any] = None, ) -> Tuple[Any, requests.Response]: """ - HTTP Requestを投げて、Reponseを返す。 + HTTP Requestを投げて、Responseを返す。 Args: http_method: url_path: From fd561d3275a8cc2afdeae0bab0226088ab1a91e1 Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Sat, 22 May 2021 12:10:41 +0900 Subject: [PATCH 10/19] =?UTF-8?q?test=20code=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index 53d34082..c90ad287 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -37,5 +37,6 @@ "source.organizeImports": true }, }, + "python.testing.autoTestDiscoverOnSaveEnabled": false, } \ No newline at end of file From f20f8c2a9f15cedce5b717dbcfc3aeeea68eedac Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Sun, 23 May 2021 11:24:46 +0900 Subject: [PATCH 11/19] =?UTF-8?q?devcontainer=E3=81=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/devcontainer.json | 4 +++- .vscode/cspell.json | 4 +++- .vscode/settings.json | 8 +++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 90ab9097..fd936b55 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -19,7 +19,9 @@ "forwardPorts": [], "runArgs": [ "--init", - "--net=host" + "--net=host", + "--env=ANNOFAB_USER_ID", + "--env=ANNOFAB_PASSWORD" ], "containerEnv": { "CONTAINER_WORKSPACE": "${containerWorkspaceFolder}", diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 9820bda2..672afefc 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -6,8 +6,10 @@ ".vscode/", "LICENSE", "tests/", + // 以下は自動生成されるファイルなのでチェックしない "generated_*.py", - "models.py" + "models.py", + "annofabapi/dataclass/*.py" ], "enabledLanguageIds": [ "python" diff --git a/.vscode/settings.json b/.vscode/settings.json index c90ad287..45586fc8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,13 +1,19 @@ { - "python.linting.pylintEnabled": true, + + "python.pythonPath": ".venv/bin/python", + "python.languageServer": "Pylance", + "python.autoComplete.addBrackets": true, "python.autoComplete.extraPaths": [ ".venv/lib/python3.8/site-packages/" ], + // "poetry run"コマンドで実行することを想定しているので、venv環境を自動的にactivateしないようにする + "python.terminal.activateEnvironment":false, "python.formatting.blackPath": ".venv/bin/black", "python.formatting.provider": "black", "python.linting.enabled": true, "python.linting.lintOnSave": true, + "python.linting.pylintEnabled": true, "python.linting.pylintPath": ".venv/bin/pylint", "python.linting.pylintArgs": [ "--rcfile setup.cfg", From 3e171dda91f08c4ceddab2cb6f4cd70b12d70215 Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Sun, 23 May 2021 11:25:04 +0900 Subject: [PATCH 12/19] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- annofabapi/wrapper.py | 9 +++--- tests/test_sandbox.py | 64 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 tests/test_sandbox.py diff --git a/annofabapi/wrapper.py b/annofabapi/wrapper.py index e5cca8b5..919a661f 100644 --- a/annofabapi/wrapper.py +++ b/annofabapi/wrapper.py @@ -542,9 +542,8 @@ def __to_annotation_detail_for_request( return dest_obj - @staticmethod def __convert_annotation_specs_labels_v2_to_v1( - labels_v2: List[Dict[str, Any]], additionals_v2: List[Dict[str, Any]] + self, labels_v2: List[Dict[str, Any]], additionals_v2: List[Dict[str, Any]] ) -> List[LabelV1]: """アノテーション仕様のV2版からV1版に変換する。V1版の方が扱いやすいので。 @@ -570,13 +569,13 @@ def to_label_v1(label_v2) -> LabelV1: new_additional_data_definitions.append(additional) else: raise ValueError( - f"additional_data_definition_id={additional_data_definition_id} に対応する属性情報が存在しません。" - "label_id={label_v2['label_id'], label_name_en={self.__get_label_name_en(label_v2))}" + f"additional_data_definition_id='{additional_data_definition_id}' に対応する属性情報が存在しません。" + f"label_id='{label_v2['label_id']}', label_name_en='{self.__get_label_name_en(label_v2)}'" ) label_v2["additional_data_definitions"] = new_additional_data_definitions return label_v2 - return [to_label_v1(labels_v2) for label_v2 in labels_v2] + return [to_label_v1(label_v2) for label_v2 in labels_v2] def put_annotation_for_simple_annotation_json( self, diff --git a/tests/test_sandbox.py b/tests/test_sandbox.py new file mode 100644 index 00000000..6247c0b4 --- /dev/null +++ b/tests/test_sandbox.py @@ -0,0 +1,64 @@ +""" +AnnoFabプロジェクトやタスクに大きく依存したテストコードです。 +""" +import configparser +import datetime +import os +import uuid + +import pytest +import requests +from more_itertools import first_true + +import annofabapi +import annofabapi.utils +from annofabapi.models import GraphType, JobType +from tests.utils_for_test import WrapperForTest, create_csv_for_task + +# プロジェクトトップに移動する +os.chdir(os.path.dirname(os.path.abspath(__file__)) + "/../") +inifile = configparser.ConfigParser() +inifile.read("./pytest.ini", "UTF-8") + +project_id = inifile["annofab"]["project_id"] +task_id = inifile["annofab"]["task_id"] + + +test_dir = "./tests/data" +out_dir = "./tests/out" + +endpoint_url = inifile["annofab"].get("endpoint_url", None) +if endpoint_url is not None: + service = annofabapi.build(endpoint_url=endpoint_url) +else: + service = annofabapi.build() + + +class TestAnnotation: + def test_wrapper_put_annotation_for_simple_annotation_json_v1(self): + """2021/07以降に廃止する予定""" + project_id = "bf530c4e-1185-4a0c-994f-502fb01ea37e" + annotation_specs_v1, _ = service.api.get_annotation_specs(project_id, query_params={"v": "1"}) + service.wrapper.put_annotation_for_simple_annotation_json( + project_id=project_id, + task_id="sample_0", + input_data_id="0733d1e1-ef85-455e-aec0-ff05c499b711", + simple_annotation_json=str( + test_dir + "/simple-annotation/sample_1/c6e1c2ec-6c7c-41c6-9639-4244c2ed2839.json" + ), + annotation_specs_labels=annotation_specs_v1["labels"], + ) + + def test_wrapper_put_annotation_for_simple_annotation_json_v2(self): + project_id = "bf530c4e-1185-4a0c-994f-502fb01ea37e" + annotation_specs_v2, _ = service.api.get_annotation_specs(project_id, query_params={"v": "2"}) + service.wrapper.put_annotation_for_simple_annotation_json( + project_id=project_id, + task_id="sample_0", + input_data_id="0733d1e1-ef85-455e-aec0-ff05c499b711", + simple_annotation_json=str( + test_dir + "/simple-annotation/sample_1/c6e1c2ec-6c7c-41c6-9639-4244c2ed2839.json" + ), + annotation_specs_labels=annotation_specs_v2["labels"], + annotation_specs_additionals=annotation_specs_v2["additionals"], + ) From 7a0cfdbeb1baf4c5f0d8a0d4f4270c1c0433bc98 Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Sun, 23 May 2021 11:25:27 +0900 Subject: [PATCH 13/19] =?UTF-8?q?pytest=E3=81=A7=E7=84=A1=E8=A6=96?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index 3555975c..22a3fcc8 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,7 +2,7 @@ [pytest] # Don't write `pytest-cov` Option -addopts = --verbose --capture=no -rs +addopts = --verbose --capture=no -rs --ignore=tests/test_sandbox.py [annofab] endpoint_url = https://annofab.com From 3992b4085a04ec7b1556da8a3ec0486d4ea92ba4 Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Sun, 23 May 2021 11:27:12 +0900 Subject: [PATCH 14/19] =?UTF-8?q?".netrc"=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=81=8C=E5=BF=85=E8=A6=81=E3=81=AA=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=92=E9=99=A4=E3=81=8F=E3=80=82=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=81=97=E3=81=A5=E3=82=89=E3=81=84=E3=81=9F=E3=82=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 1 - tests/test_local_resource.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 126c8281..059a87fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ python: install: - pip install poetry - poetry install - - echo -e "machine annofab.com\nlogin FOO\npassword BAR\n" > ~/.netrc && chmod 600 ~/.netrc script: - make lint - pytest tests/test_local*.py diff --git a/tests/test_local_resource.py b/tests/test_local_resource.py index e35b1389..46c9d83b 100644 --- a/tests/test_local_resource.py +++ b/tests/test_local_resource.py @@ -13,9 +13,9 @@ class TestBuild: - def test_build_from_netrc(self): - # ".netrc"ファイルが存在すること前提 - assert isinstance(build_from_netrc(), annofabapi.Resource) + # def test_build_from_netrc(self): + # # ".netrc"ファイルが存在すること前提 + # assert isinstance(build_from_netrc(), annofabapi.Resource) def test_raise_ValueError(self): with pytest.raises(ValueError): From 2a0629a6b7efdb617e8ae0d985b28eb0775799fc Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Mon, 24 May 2021 21:28:03 +0900 Subject: [PATCH 15/19] update travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 059a87fe..14c41ad0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ dist: xenial language: python +cache: pip python: - "3.6" - "3.7" From d8f6b325999ce605a6a471c02c201cedc1edec4a Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Mon, 24 May 2021 21:34:01 +0900 Subject: [PATCH 16/19] updatetravis --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 14c41ad0..b20fd4ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,3 @@ -dist: xenial language: python cache: pip python: From 0fcf3630bb0c251da064636c04dc6f344f21f157 Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Mon, 24 May 2021 21:58:51 +0900 Subject: [PATCH 17/19] update travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b20fd4ad..8e5b9472 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ +version: ~> 1.0 language: python -cache: pip python: - "3.6" - "3.7" From 5a7a0d47d6c1cf08bf25d428e39e792cf0ef3c72 Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Mon, 24 May 2021 22:15:17 +0900 Subject: [PATCH 18/19] update travis --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8e5b9472..32c9ba89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,9 @@ python: install: - pip install poetry - poetry install +env: + # PyPIへのアクセス過多などで失敗するケースがあるので、タイムアウトを設定する + - PIP_DEFAULT_TIMEOUT=100 script: - make lint - pytest tests/test_local*.py From 9e567aa1048ee4d4b60b664682980aa9458f1e88 Mon Sep 17 00:00:00 2001 From: yuji38kwmt Date: Mon, 24 May 2021 22:16:19 +0900 Subject: [PATCH 19/19] version up --- annofabapi/__version__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/annofabapi/__version__.py b/annofabapi/__version__.py index 4d8afa5b..058b03fe 100644 --- a/annofabapi/__version__.py +++ b/annofabapi/__version__.py @@ -1 +1 @@ -__version__ = "0.45.0" +__version__ = "0.45.1" diff --git a/pyproject.toml b/pyproject.toml index bd70dccf..113538ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "annofabapi" -version = "0.45.0" +version = "0.45.1" description = "Python Clinet Library of AnnoFab WebAPI (https://annofab.com/docs/api/)" authors = ["yuji38kwmt"] license = "MIT"