Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
112 lines (101 loc) · 3 KB
/
Copy pathpyproject.toml
File metadata and controls
112 lines (101 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
[project]
name = 'dify-plugin'
version = "0.11.1"
description = 'Dify Plugin SDK'
authors = [{ name = 'langgenius', email = 'hello@dify.ai' }]
dependencies = [
'Flask>=3.1.3',
'Werkzeug>=3.1.9',
'gevent>=26.9.0',
'h11>=0.16.0',
'httpx>=0.28.1',
'pydantic_settings>=2.16.3',
'pydantic>=2.14.3',
'pyyaml>=6.0.3',
'requests>=2.34.2',
'socksio>=1.0.0',
'tiktoken>=0.14.0',
'yarl>=1.25.1',
'packaging>=26.3',
]
requires-python = '>=3.12'
readme = 'README.md'
license = 'Apache-2.0'
license-files = ['LICENSE']
keywords = ['dify', 'plugin', 'sdk']
[project.urls]
source = 'https://github.com/langgenius/dify-plugin-sdks'
homepage = 'https://github.com/langgenius/dify-plugin-sdks'
issues = 'https://github.com/langgenius/dify-plugin-sdks/issues'
[build-system]
requires = ['uv_build~=0.13.8']
build-backend = 'uv_build'
[dependency-groups]
dev = [
"hypothesis>=6.170.15",
'prek',
'pytest',
'pytest-cov',
"pytest-httpserver>=1.2.1",
'pytest-mock',
"pytest-timeout>=2.4.0",
'ruff',
"trustme>=1.2.1",
'ty',
]
[tool.uv]
default-groups = ['dev']
[tool.pytest]
minversion = '9.0'
testpaths = ['tests']
addopts = ['--strict-config', '--strict-markers']
# pytest-timeout registers a string ini value, even with pytest's native TOML config.
timeout = '60'
xfail_strict = true
markers = ['integration: runs a real plugin process or local protocol service']
filterwarnings = [
'error::ResourceWarning',
'error::pytest.PytestUnhandledThreadExceptionWarning',
'error::pytest.PytestUnraisableExceptionWarning',
]
[tool.coverage.run]
branch = true
source_pkgs = ['dify_plugin']
# SDK threads are monkey-patched greenlets; a second thread tracer drops events.
concurrency = ['gevent']
patch = ['subprocess']
sigterm = true
[tool.coverage.paths]
source = ['src/dify_plugin', '*/site-packages/dify_plugin']
[tool.ruff]
preview = true
required-version = '>=0.17.5'
[tool.ruff.lint]
select = ['ALL']
ignore = [
'too-many-statements', # Too broad for orchestration-heavy SDK functions.
'commented-out-code', # False positives are common.
'too-many-branches',
'too-many-locals',
'raise-vanilla-class',
'blind-except',
'raise-within-try',
'too-many-arguments', # Explicit is better than implicit.
'too-many-positional-arguments', # Complex is better than complicated.
'complex-structure',
'FBT', # Too strict.
'TC', # Runtime use of typing constructs is common now.
'relative-imports', # Too absolute.
'no-self-use', # Violates the usual practice.
'missing-trailing-comma', # Conflicts with `ruff format`.
'CPY', # Covered by the standalone LICENSE file.
'D', # Too verbose.
]
[tool.ruff.lint.pydoclint]
ignore-one-line-docstrings = true
[tool.ruff.lint.per-file-ignores]
'tests/**/*.py' = [
'assert', # Assert statements used for pytest.
'private-member-access', # Tests may inspect private implementation details.
'magic-value-comparison', # Magic value used in test cases.
]