annofabapi-3dpc-extensions 0.2.2__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,23 +1,22 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: annofabapi-3dpc-extensions
3
- Version: 0.2.2
3
+ Version: 0.3.0
4
4
  Summary: annofabapiの3DPC Editor用の拡張機能です。
5
5
  Home-page: https://github.com/kurusugawa-computer/annofabapi-3dpc-extensions
6
6
  Author: Kurusugawa Computer Inc.
7
- Requires-Python: >=3.8,<4.0
7
+ Requires-Python: >=3.9,<4.0
8
8
  Classifier: Development Status :: 4 - Beta
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: Operating System :: OS Independent
11
11
  Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.8
13
12
  Classifier: Programming Language :: Python :: 3.9
14
13
  Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
17
  Classifier: Topic :: Utilities
18
18
  Requires-Dist: dataclasses-json
19
- Requires-Dist: numpy (<1.25) ; python_version == "3.8"
20
- Requires-Dist: numpy (>=1.26) ; python_version >= "3.9"
19
+ Requires-Dist: numpy
21
20
  Project-URL: Repository, https://github.com/kurusugawa-computer/annofabapi-3dpc-extensions
22
21
  Description-Content-Type: text/markdown
23
22
 
@@ -33,7 +32,7 @@ Description-Content-Type: text/markdown
33
32
 
34
33
  # Install
35
34
 
36
- * Python 3.8+
35
+ * Python 3.9+
37
36
 
38
37
  # Install
39
38
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  # Install
12
12
 
13
- * Python 3.8+
13
+ * Python 3.9+
14
14
 
15
15
  # Install
16
16
 
@@ -1 +1 @@
1
- __version__ = "0.2.2" # `poetry-dynamic-versioning`を使ってGitHubのバージョンタグを取得している。変更不要
1
+ __version__ = "0.3.0" # `poetry-dynamic-versioning`を使ってGitHubのバージョンタグを取得している。変更不要
@@ -1,7 +1,8 @@
1
1
  import json
2
2
  import math
3
+ from collections.abc import Sequence
3
4
  from dataclasses import dataclass
4
- from typing import Any, Dict, List, Optional, Sequence, Union
5
+ from typing import Any, Optional, Union
5
6
 
6
7
  import numpy
7
8
  from dataclasses_json import DataClassJsonMixin
@@ -102,7 +103,7 @@ class EulerAnglesZXY(DataClassJsonMixin):
102
103
  z: float
103
104
  """Z軸周りの回転角度[ラジアン]"""
104
105
 
105
- def to_quaternion(self) -> List[float]:
106
+ def to_quaternion(self) -> list[float]:
106
107
  """
107
108
  クォータニオンを生成する。
108
109
 
@@ -240,7 +241,7 @@ class CuboidAnnotationDetailDataV2(DataClassJsonMixin):
240
241
  kind: str = "CUBOID"
241
242
  version: str = "2"
242
243
 
243
- def dump(self) -> Dict[str, Any]:
244
+ def dump(self) -> dict[str, Any]:
244
245
  """SimpleAnnotationDetailクラスのdataプロパティに対応するdictを生成する。"""
245
246
  str_data = json.dumps(self.to_dict(), separators=(",", ":"))
246
247
  return {"data": str_data, "_type": ANNOTATION_TYPE_UNKNOWN}
@@ -248,7 +249,7 @@ class CuboidAnnotationDetailDataV2(DataClassJsonMixin):
248
249
 
249
250
  @dataclass
250
251
  class SegmentData(DataClassJsonMixin):
251
- points: List[int]
252
+ points: list[int]
252
253
  """セグメントに含まれる点の集合。数値はアノテーション対象の点群の、0-originでのindex"""
253
254
  kind: str = "SEGMENT"
254
255
  version: str = "1"
@@ -259,7 +260,7 @@ class SegmentAnnotationDetailData(DataClassJsonMixin):
259
260
  data_uri: str
260
261
  """セグメント情報が格納されたファイルのパス"""
261
262
 
262
- def dump(self) -> Dict[str, Any]:
263
+ def dump(self) -> dict[str, Any]:
263
264
  """SimpleAnnotationDetailクラスのdataプロパティに対応するdictを生成する。"""
264
265
  return {"data": self.data_uri, "_type": ANNOTATION_TYPE_UNKNOWN}
265
266
 
@@ -292,13 +293,13 @@ class CuboidAnnotationDetailDataV1(DataClassJsonMixin):
292
293
  kind: str = "CUBOID"
293
294
  version: str = "1"
294
295
 
295
- def dump(self) -> Dict[str, Any]:
296
+ def dump(self) -> dict[str, Any]:
296
297
  """SimpleAnnotationDetailクラスのdataプロパティに対応するdictを生成する。"""
297
298
  str_data = json.dumps(self.to_dict(), separators=(",", ":"))
298
299
  return {"data": str_data, "_type": ANNOTATION_TYPE_UNKNOWN}
299
300
 
300
301
 
301
- def convert_annotation_detail_data(dict_data: Dict[str, Any]) -> Any: # noqa: ANN401
302
+ def convert_annotation_detail_data(dict_data: dict[str, Any]) -> Any: # noqa: ANN401
302
303
  """
303
304
  SimpleAnnotationDetailクラスのdict型であるdataプロパティを、3DPC Editor用のDataclassに変換します。
304
305
  3DPC Editor用のDataclassに変換できない場合は、引数をそのまま返します。
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "annofabapi-3dpc-extensions"
3
- version = "0.2.2" # `poetry-dynamic-versioning`を使ってGitHubのバージョンタグを取得している。変更不要
3
+ version = "0.3.0" # `poetry-dynamic-versioning`を使ってGitHubのバージョンタグを取得している。変更不要
4
4
  description = "annofabapiの3DPC Editor用の拡張機能です。"
5
5
  authors = ["Kurusugawa Computer Inc."]
6
6
  packages = [
@@ -16,19 +16,13 @@ classifiers = [
16
16
  ]
17
17
 
18
18
  [tool.poetry.dependencies]
19
- python = "^3.8"
19
+ python = "^3.9"
20
20
  dataclasses-json="*"
21
-
22
- # Pythonバージョンでnumpyのバージョンを変えている理由
23
- # https://qiita.com/yuji38kwmt/items/7ce857bb8698536bfa36
24
- numpy = [
25
- {version = ">=1.26", python = ">=3.9"},
26
- {version = "<1.25", python = "=3.8"}
27
- ]
21
+ numpy = "*"
28
22
 
29
23
 
30
24
  [tool.poetry.group.test.dependencies]
31
- pytest = "^7"
25
+ pytest = "^8"
32
26
  pytest-xdist = "*"
33
27
  # テストコードで利用するため
34
28
  annofabapi = ">=0.47.0"
@@ -36,7 +30,7 @@ annofabapi = ">=0.47.0"
36
30
 
37
31
  [tool.poetry.group.linter.dependencies]
38
32
  # pythonバージョンを指定している理由:Python3.11(開発環境)でしかlintを実行していないため
39
- ruff = {version="^0.2", python=">=3.11"}
33
+ ruff = {version="^0.8", python=">=3.11"}
40
34
  mypy = {version="^1", python=">=3.11"}
41
35
  pylint = {version="^3", python=">=3.11"}
42
36
 
@@ -44,10 +38,15 @@ pylint = {version="^3", python=">=3.11"}
44
38
  [tool.poetry.group.documentation.dependencies]
45
39
  # ドキュメント生成用のライブラリ
46
40
  # `python=">=3.11"`を指定している理由:Pytyhon3.11を利用している開発環境かReadTheDocsでしかドキュメントを生成しないため
47
- sphinx = {version="^7", python=">=3.11"}
41
+ sphinx = {version="^8", python=">=3.11"}
48
42
  pydata-sphinx-theme = {version=">=0.13", python=">=3.11"}
49
43
 
50
44
 
45
+ [tool.poetry.group.dev-only.dependencies]
46
+ # wheelファイルをビルドすると時間がかかるため、python3.13のwheelファイルが存在するバージョンを明示する
47
+ numpy = {version = ">=2.1", python = ">=3.13"}
48
+
49
+
51
50
  [tool.mypy]
52
51
  ignore_missing_imports = true
53
52
 
@@ -56,7 +55,7 @@ check_untyped_defs = true
56
55
  plugins = "numpy.typing.mypy_plugin"
57
56
 
58
57
  [tool.ruff]
59
- target-version = "py38"
58
+ target-version = "py39"
60
59
  line-length = 120
61
60
 
62
61
 
@@ -70,14 +69,12 @@ ignore = [
70
69
  "RUF003",# 全角記号など`ambiguous unicode character`も使いたいため
71
70
  "PLC1901", # compare-to-empty-string : `if a == "`のように空文字列で直接比較したいときがあるため
72
71
  "PLR2004", # magic-value-comparison: listのサイズで判定するときがよくあるため
73
- "ANN101", # missing-type-self: 引数selfには型ヒントは付けていないため
74
- "ANN102", # missing-type-cls: 引数clsには型ヒントは付けていないため
75
72
  "ERA", # : 役立つこともあるが、コメントアウトしていないコードも警告されるので無視する
76
73
  "PERF203", # try-except-in-loop: ループ内でtry-exceptを使うこともあるため無視する。
77
74
  "FIX", # TODOやFIXMEを使うため無視する
78
75
  "TD", # TODOコメントの書き方に気にしていないので無視する
79
76
 
80
- # 以下のルールはannofabcliのコードに合っていないので無効化した
77
+ # 以下のルールはプロジェクトのコードに合っていないので無効化した
81
78
  "RSE", # flake8-raise
82
79
  "D", # pydocstyle, Docstringを中途半端にしか書いていないので、除外する
83
80
  "C90", # mccabe
@@ -108,8 +105,9 @@ select = [
108
105
  convention = "google"
109
106
 
110
107
  [tool.ruff.lint.pyupgrade]
111
- # Python3.8をサポートしているため、`typing.List`などの型ヒントは警告しないようにする
108
+ # `typing.Optional`を使っているため、UP007のルールを無視する
112
109
  # https://beta.ruff.rs/docs/settings/#keep-runtime-typing
110
+ # Python 3.9のサポートを終了したら、この設定を除去する
113
111
  keep-runtime-typing = true
114
112
 
115
113
  [tool.ruff.lint.pylint]
@@ -117,7 +115,6 @@ max-args = 10
117
115
 
118
116
  [tool.poetry-dynamic-versioning]
119
117
  enable = false
120
- format = "{base}"
121
118
 
122
119
  [build-system]
123
120
  requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]