dagster-dingtalk 0.1.29a1__tar.gz → 0.1.31__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.
Files changed (22) hide show
  1. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/.idea/workspace.xml +69 -20
  2. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/PKG-INFO +2 -2
  3. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/pyproject.toml +2 -2
  4. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/src/dagster_dingtalk/app_client.py +20 -13
  5. dagster_dingtalk-0.1.31/test.py +0 -0
  6. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/.gitignore +0 -0
  7. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/.idea/.gitignore +0 -0
  8. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/.idea/dagster-dingtalk.iml +0 -0
  9. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/.idea/deployment.xml +0 -0
  10. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/.idea/dictionaries/admin.xml +0 -0
  11. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/.idea/inspectionProfiles/Project_Default.xml +0 -0
  12. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
  13. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/.idea/misc.xml +0 -0
  14. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/.idea/modules.xml +0 -0
  15. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/.idea/vcs.xml +0 -0
  16. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/.python-version +0 -0
  17. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/README.md +0 -0
  18. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/src/dagster_dingtalk/__init__.py +0 -0
  19. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/src/dagster_dingtalk/operations.py +0 -0
  20. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/src/dagster_dingtalk/py.typed +0 -0
  21. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/src/dagster_dingtalk/resources.py +0 -0
  22. {dagster_dingtalk-0.1.29a1 → dagster_dingtalk-0.1.31}/src/dagster_dingtalk/version.py +0 -0
@@ -4,7 +4,10 @@
4
4
  <option name="autoReloadType" value="SELECTIVE" />
5
5
  </component>
6
6
  <component name="ChangeListManager">
7
- <list default="true" id="d56e898e-6e80-4770-9a14-5869f3cdca54" name="更改" comment="新增[待办任务]API" />
7
+ <list default="true" id="d56e898e-6e80-4770-9a14-5869f3cdca54" name="更改" comment="修复:线程锁死锁问题">
8
+ <change beforePath="$PROJECT_DIR$/pyproject.toml" beforeDir="false" afterPath="$PROJECT_DIR$/pyproject.toml" afterDir="false" />
9
+ <change beforePath="$PROJECT_DIR$/src/dagster_dingtalk/app_client.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/dagster_dingtalk/app_client.py" afterDir="false" />
10
+ </list>
8
11
  <option name="SHOW_DIALOG" value="false" />
9
12
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
10
13
  <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -14,6 +17,7 @@
14
17
  <option name="RECENT_TEMPLATES">
15
18
  <list>
16
19
  <option value="Python Script" />
20
+ <option value="Python Unit Test" />
17
21
  </list>
18
22
  </option>
19
23
  </component>
@@ -43,22 +47,23 @@
43
47
  <option name="hideEmptyMiddlePackages" value="true" />
44
48
  <option name="showLibraryContents" value="true" />
45
49
  </component>
46
- <component name="PropertiesComponent">{
47
- &quot;keyToString&quot;: {
48
- &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
49
- &quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
50
- &quot;git-widget-placeholder&quot;: &quot;master&quot;,
51
- &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
52
- &quot;last_opened_file_path&quot;: &quot;M:/dagster&quot;,
53
- &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
54
- &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
55
- &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
56
- &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
57
- &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
58
- &quot;settings.editor.selected.configurable&quot;: &quot;com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable&quot;,
59
- &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
50
+ <component name="PropertiesComponent"><![CDATA[{
51
+ "keyToString": {
52
+ "Python.test.executor": "Run",
53
+ "RunOnceActivity.ShowReadmeOnStart": "true",
54
+ "RunOnceActivity.git.unshallow": "true",
55
+ "git-widget-placeholder": "master",
56
+ "ignore.virus.scanning.warn.message": "true",
57
+ "last_opened_file_path": "C:/Users/admin/PycharmProjects/dagster-dingtalk",
58
+ "node.js.detected.package.eslint": "true",
59
+ "node.js.detected.package.tslint": "true",
60
+ "node.js.selected.package.eslint": "(autodetect)",
61
+ "node.js.selected.package.tslint": "(autodetect)",
62
+ "nodejs_package_manager_path": "npm",
63
+ "settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable",
64
+ "vue.rearranger.settings.migration": "true"
60
65
  }
61
- }</component>
66
+ }]]></component>
62
67
  <component name="RecentsManager">
63
68
  <key name="CopyFile.RECENT_KEYS">
64
69
  <recent name="C:\Users\admin\PycharmProjects\dagster-dingtalk\dagster-dingtalk\src\dagster_dingtalk" />
@@ -70,11 +75,41 @@
70
75
  <recent name="C:\Users\admin\PycharmProjects\dagster-dingtalk\dagster-dingtalk\src\dagster_dingtalk" />
71
76
  </key>
72
77
  </component>
78
+ <component name="RunManager">
79
+ <configuration name="test" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
80
+ <module name="dagster-dingtalk" />
81
+ <option name="ENV_FILES" value="" />
82
+ <option name="INTERPRETER_OPTIONS" value="" />
83
+ <option name="PARENT_ENVS" value="true" />
84
+ <envs>
85
+ <env name="PYTHONUNBUFFERED" value="1" />
86
+ </envs>
87
+ <option name="SDK_HOME" value="" />
88
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
89
+ <option name="IS_MODULE_SDK" value="true" />
90
+ <option name="ADD_CONTENT_ROOTS" value="true" />
91
+ <option name="ADD_SOURCE_ROOTS" value="true" />
92
+ <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
93
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/test.py" />
94
+ <option name="PARAMETERS" value="" />
95
+ <option name="SHOW_COMMAND_LINE" value="false" />
96
+ <option name="EMULATE_TERMINAL" value="false" />
97
+ <option name="MODULE_MODE" value="false" />
98
+ <option name="REDIRECT_INPUT" value="false" />
99
+ <option name="INPUT_FILE" value="" />
100
+ <method v="2" />
101
+ </configuration>
102
+ <recent_temporary>
103
+ <list>
104
+ <item itemvalue="Python.test" />
105
+ </list>
106
+ </recent_temporary>
107
+ </component>
73
108
  <component name="SharedIndexes">
74
109
  <attachedChunks>
75
110
  <set>
76
- <option value="bundled-js-predefined-d6986cc7102b-822845ee3bb5-JavaScript-PY-243.23654.177" />
77
- <option value="bundled-python-sdk-91d3a02ef49d-43b77aa2d136-com.jetbrains.pycharm.pro.sharedIndexes.bundled-PY-243.23654.177" />
111
+ <option value="bundled-js-predefined-d6986cc7102b-76f8388c3a79-JavaScript-PY-243.24978.54" />
112
+ <option value="bundled-python-sdk-91e3b7efe1d4-466328ff949b-com.jetbrains.pycharm.pro.sharedIndexes.bundled-PY-243.24978.54" />
78
113
  </set>
79
114
  </attachedChunks>
80
115
  </component>
@@ -92,6 +127,8 @@
92
127
  <workItem from="1739478013799" duration="20000" />
93
128
  <workItem from="1739478384641" duration="3306000" />
94
129
  <workItem from="1739521248423" duration="1733000" />
130
+ <workItem from="1739562869457" duration="3088000" />
131
+ <workItem from="1739662323067" duration="16000" />
95
132
  </task>
96
133
  <task id="LOCAL-00001" summary="更改目录结构以便于使用 uv 构建和发布包">
97
134
  <option name="closed" value="true" />
@@ -117,7 +154,15 @@
117
154
  <option name="project" value="LOCAL" />
118
155
  <updated>1739480448632</updated>
119
156
  </task>
120
- <option name="localTasksCounter" value="4" />
157
+ <task id="LOCAL-00004" summary="修复:线程锁死锁问题">
158
+ <option name="closed" value="true" />
159
+ <created>1739564430669</created>
160
+ <option name="number" value="00004" />
161
+ <option name="presentableId" value="LOCAL-00004" />
162
+ <option name="project" value="LOCAL" />
163
+ <updated>1739564430669</updated>
164
+ </task>
165
+ <option name="localTasksCounter" value="5" />
121
166
  <servers />
122
167
  </component>
123
168
  <component name="TypeScriptGeneratedFilesManager">
@@ -127,6 +172,10 @@
127
172
  <MESSAGE value="更改目录结构以便于使用 uv 构建和发布包" />
128
173
  <MESSAGE value="修复相对路径引用问题" />
129
174
  <MESSAGE value="新增[待办任务]API" />
130
- <option name="LAST_COMMIT_MESSAGE" value="新增[待办任务]API" />
175
+ <MESSAGE value="修复:线程锁死锁问题" />
176
+ <option name="LAST_COMMIT_MESSAGE" value="修复:线程锁死锁问题" />
177
+ </component>
178
+ <component name="com.intellij.coverage.CoverageDataManagerImpl">
179
+ <SUITE FILE_PATH="coverage/dagster_dingtalk$test.coverage" NAME="test 覆盖结果" MODIFIED="1739565257857" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
131
180
  </component>
132
181
  </project>
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dagster-dingtalk
3
- Version: 0.1.29a1
3
+ Version: 0.1.31
4
4
  Summary: A dagster plugin for the DingTalk
5
5
  Author-email: YiZixuan <sqkkyzx@qq.com>
6
6
  Requires-Python: >=3.11
7
- Requires-Dist: dagster
7
+ Requires-Dist: dagster>1.9.8
8
8
  Requires-Dist: httpx
9
9
  Requires-Dist: pydantic
10
10
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dagster-dingtalk"
3
- version = "0.1.29a1"
3
+ version = "0.1.31"
4
4
  description = "A dagster plugin for the DingTalk"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -10,7 +10,7 @@ requires-python = ">=3.11"
10
10
  dependencies = [
11
11
  "httpx",
12
12
  "pydantic",
13
- "dagster"
13
+ "dagster>1.9.8"
14
14
  ]
15
15
 
16
16
  [build-system]
@@ -48,10 +48,17 @@ class DingTalkClient:
48
48
 
49
49
 
50
50
  def __init_clients(self):
51
- self.__oapi_client = httpx.Client(base_url="https://oapi.dingtalk.com/")
52
-
53
- self.__api_client = httpx.Client(base_url="https://api.dingtalk.com/")
51
+ self.__oapi_client = httpx.Client(
52
+ base_url="https://oapi.dingtalk.com/",
53
+ timeout=httpx.Timeout(60.0),
54
+ limits=httpx.Limits(max_connections=100),
55
+ )
54
56
 
57
+ self.__api_client = httpx.Client(
58
+ base_url="https://api.dingtalk.com/",
59
+ timeout=httpx.Timeout(10.0),
60
+ limits=httpx.Limits(max_connections=100),
61
+ )
55
62
 
56
63
  def __file_cache_read(self) -> dict:
57
64
  if self.__access_token_file_cache.exists():
@@ -64,13 +71,12 @@ class DingTalkClient:
64
71
  else:
65
72
  return {}
66
73
 
67
- def __file_cache_write(self):
68
- with self.__token_lock:
69
- try:
70
- with open(self.__access_token_file_cache, 'wb') as f:
71
- f.write(pickle.dumps(self.__access_token_cache))
72
- except Exception as e:
73
- logging.error(f"AccessToken 缓存写入失败: {e}")
74
+ def __file_cache_write(self, access_token_cache: dict):
75
+ try:
76
+ with open(self.__access_token_file_cache, 'wb') as f:
77
+ f.write(pickle.dumps(access_token_cache))
78
+ except Exception as e:
79
+ logging.error(f"AccessToken 缓存写入失败: {e}")
74
80
 
75
81
  def __get_access_token(self) -> str:
76
82
  with self.__token_lock:
@@ -87,16 +93,17 @@ class DingTalkClient:
87
93
  json={"appKey": self.__client_id, "appSecret": self.__client_secret},
88
94
  ).json()
89
95
  # 提前 1 分钟进行续期
90
- self.__access_token_cache = {
96
+ access_token_cache = {
91
97
  "access_token": response.get("accessToken"),
92
98
  "expire_in": response.get("expireIn") + int(time.time()) - 60
93
99
  }
94
- self.__file_cache_write()
100
+ self.__access_token_cache = access_token_cache
101
+ self.__file_cache_write(self.__access_token_cache)
95
102
  except Exception as e:
96
103
  logging.error(f"AccessToken 获取失败: {e}")
97
104
  raise
98
105
 
99
- return self.__access_token_cache["access_token"]
106
+ return access_token_cache["access_token"]
100
107
 
101
108
  def oapi(self, method: str, path: str, **kwargs) -> httpx.Response:
102
109
  params = kwargs.get("params", {})
File without changes