fastapi-authly 0.1.6__tar.gz → 0.1.7__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 (52) hide show
  1. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/PKG-INFO +1 -1
  2. fastapi_authly-0.1.7/ScienceClaw-master.zip +0 -0
  3. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/pyproject.toml +1 -1
  4. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/__about__.py +1 -1
  5. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/charts.py +32 -3
  6. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/docs.py +1 -1
  7. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/.gitignore +0 -0
  8. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/LICENSE +0 -0
  9. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/README.md +0 -0
  10. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/README.zh.md +0 -0
  11. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/docs//345/207/275/346/225/260/345/274/217/347/274/226/347/250/213/344/270/203/346/255/246/345/231/250.md" +0 -0
  12. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/examples/correct_usage.py +0 -0
  13. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/.gitignore +0 -0
  14. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/class_index.html +0 -0
  15. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/coverage_html_cb_dd2e7eb5.js +0 -0
  16. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/favicon_32_cb_c827f16f.png +0 -0
  17. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/function_index.html +0 -0
  18. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/index.html +0 -0
  19. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/keybd_closed_cb_900cfef5.png +0 -0
  20. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/status.json +0 -0
  21. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/style_cb_9ff733b0.css +0 -0
  22. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/z_af1bec017750c6fc___init___py.html +0 -0
  23. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/z_af1bec017750c6fc_user_py.html +0 -0
  24. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/z_b9d93864b1b0ad6e___about___py.html +0 -0
  25. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/z_b9d93864b1b0ad6e___init___py.html +0 -0
  26. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/z_b9d93864b1b0ad6e_auth_py.html +0 -0
  27. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/z_b9d93864b1b0ad6e_interfaces_py.html +0 -0
  28. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/z_d015ea9b27b0258e___init___py.html +0 -0
  29. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/z_d015ea9b27b0258e_config_py.html +0 -0
  30. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/z_d015ea9b27b0258e_security_py.html +0 -0
  31. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/z_ddd01122054512b0___init___py.html +0 -0
  32. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/z_ddd01122054512b0_tortoise_pg_py.html +0 -0
  33. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/z_feee2d9ae7f7fd96___init___py.html +0 -0
  34. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/htmlcov/z_feee2d9ae7f7fd96_user_py.html +0 -0
  35. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/__init__.py +0 -0
  36. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/auth.py +0 -0
  37. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/contrib/__init__.py +0 -0
  38. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/contrib/tortoise_pg.py +0 -0
  39. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/core/__init__.py +0 -0
  40. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/core/config.py +0 -0
  41. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/core/security.py +0 -0
  42. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/deps.py +0 -0
  43. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/interfaces.py +0 -0
  44. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/models/__init__.py +0 -0
  45. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/models/user.py +0 -0
  46. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/schemas/__init__.py +0 -0
  47. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/schemas/user.py +0 -0
  48. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/static/echarts.min.js +0 -0
  49. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/static/favicon.svg +0 -0
  50. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/static/scalar/standalone.js +0 -0
  51. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/src/fastapi_authly/static/scalar/style.css +0 -0
  52. {fastapi_authly-0.1.6 → fastapi_authly-0.1.7}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastapi-authly
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: A modular authentication system for FastAPI with OAuth2, JWT, and password recovery
5
5
  Project-URL: Homepage, https://github.com/yourusername/fastapi-auth-module
6
6
  Project-URL: Documentation, https://yourusername.github.io/fastapi-auth-module/
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "fastapi-authly"
7
- version = "0.1.6"
7
+ version = "0.1.7"
8
8
  description = "A modular authentication system for FastAPI with OAuth2, JWT, and password recovery"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -1,3 +1,3 @@
1
1
  """Version information."""
2
2
 
3
- __version__ = "0.1.6"
3
+ __version__ = "0.1.7"
@@ -105,7 +105,7 @@ def engine_make_snapshot(
105
105
  file_type: str,
106
106
  *,
107
107
  pixel_ratio: int = 2,
108
- delay: float = 2,
108
+ delay: float = 1,
109
109
  driver: Any = None,
110
110
  chrome_headless_path: str | Path | None = None,
111
111
  chromedriver_path: str | Path | None = None,
@@ -116,6 +116,7 @@ def engine_make_snapshot(
116
116
  """
117
117
  if delay < 0:
118
118
  raise ValueError("delay 不能为负数")
119
+ _external_driver = driver is not None
119
120
  if driver is None:
120
121
  driver = get_driver(
121
122
  chrome_headless_path=chrome_headless_path,
@@ -129,10 +130,33 @@ def engine_make_snapshot(
129
130
  html_path = "file://" + os.path.abspath(html_path)
130
131
  try:
131
132
  driver.get(html_path)
132
- time.sleep(delay)
133
+ if delay > 0:
134
+ # 优先用 JS 轮询等待 ECharts 实例就绪(最多等 delay 秒),避免无谓的固定等待
135
+ _wait_js = """
136
+ var done = arguments[arguments.length - 1];
137
+ var deadline = Date.now() + %d;
138
+ function check() {
139
+ var ele = document.querySelector('div[_echarts_instance_]');
140
+ if (ele && echarts.getInstanceByDom(ele)) {
141
+ done(true);
142
+ } else if (Date.now() < deadline) {
143
+ setTimeout(check, 50);
144
+ } else {
145
+ done(false);
146
+ }
147
+ }
148
+ check();
149
+ """ % int(delay * 1000)
150
+ try:
151
+ driver.set_script_timeout(delay + 1)
152
+ driver.execute_async_script(_wait_js)
153
+ except Exception:
154
+ time.sleep(delay)
133
155
  return driver.execute_script(snapshot_js)
134
156
  finally:
135
- driver.quit()
157
+ # 仅当 driver 由本函数内部创建时才 quit;外部传入的 driver 由调用方管理生命周期
158
+ if not _external_driver:
159
+ driver.quit()
136
160
 
137
161
 
138
162
  def echarts_option_to_html(
@@ -162,6 +186,11 @@ def echarts_option_to_html(
162
186
  var chartDom = document.getElementById("main");
163
187
  var myChart = echarts.init(chartDom);
164
188
  var option = {option_json};
189
+ // 强制关闭所有动画,确保截图时图表已完整渲染
190
+ if (option.animation === undefined) option.animation = false;
191
+ if (option.series) {{
192
+ option.series.forEach(function(s) {{ s.animation = false; }});
193
+ }}
165
194
  myChart.setOption(option);
166
195
  </script>
167
196
  </body>
@@ -13,12 +13,12 @@ def get_static_dir() -> Path:
13
13
  """获取包内静态文件目录路径"""
14
14
  return Path(__file__).parent / "static"
15
15
 
16
+ static_url = "/static"
16
17
 
17
18
  def setup_scalar_docs(
18
19
  app: FastAPI,
19
20
  *,
20
21
  docs_url: str = "/docs",
21
- static_url: str = "/static",
22
22
  title: Optional[str] = None,
23
23
  openapi_url: Optional[str] = None,
24
24
  favicon_url: Optional[str] = None,
File without changes
File without changes
File without changes