-
Notifications
You must be signed in to change notification settings - Fork 658
Expand file tree
/
Copy pathpyproject.toml
More file actions
145 lines (130 loc) · 3.94 KB
/
pyproject.toml
File metadata and controls
145 lines (130 loc) · 3.94 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
[build-system]
requires = ["setuptools", "setuptools_scm[toml]"]
build-backend = "setuptools.build_meta"
[project]
name = "cog"
description = "Containers for machine learning"
readme = "README.md"
authors = [{ name = "Replicate", email = "team@replicate.com" }]
license.file = "LICENSE"
urls."Source" = "https://github.com/replicate/cog"
classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.10"
dependencies = [
"typing_extensions>=4.0",
"pyyaml>=6.0",
"structlog>=21.0.0",
"requests>=2.25.0",
"coglet>=0.1.0,<1.0",
]
dynamic = ["version"]
[dependency-groups]
dev = [
"build>=1.2.2.post1",
"ruff",
"setuptools-scm>=8.2.0",
]
test = [
"pytest",
"pytest-timeout",
"pytest-xdist",
"pytest-cov",
]
[tool.setuptools_scm]
write_to = "python/cog/_version.py"
[tool.pyright]
# TODO: remove this and bring the codebase inline with the current default
strictParameterNoneValue = false
# legacy behavior, fixed in PEP688
disableBytesTypePromotions = true
include = ["python"]
exclude = ["python/tests"]
reportMissingParameterType = "error"
reportUnknownLambdaType = "error"
reportUnnecessaryIsInstance = "warning"
reportUnnecessaryComparison = "warning"
reportUnnecessaryContains = "warning"
reportMissingTypeArgument = "error"
reportUnusedExpression = "warning"
[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
[tool.setuptools]
include-package-data = false
[tool.setuptools.packages.find]
where = ["python"]
include = ["cog*"]
exclude = ["tests*"]
[tool.pylint.main]
disable = [
"C0114", # Missing module docstring
"C0115", # Missing class docstring
"C0116", # Missing function or method docstring
"C0301", # Line too long
"C0413", # Import should be placed at the top of the module
"R0903", # Too few public methods
"W0622", # Redefining built-in
]
good-names = ["id", "input"]
ignore-paths = ["python/cog/_version.py", "python/tests"]
[tool.ruff]
exclude = ["python/cog/_version.py"]
lint.select = [
"E", # pycodestyle error
"F", # Pyflakes
"I", # isort
"W", # pycodestyle warning
"S", # flake8-bandit
"B", # flake8-bugbear
"ANN", # flake8-annotations
]
lint.ignore = [
"E501", # Line too long
"S101", # Use of `assert` detected"
"S113", # Probable use of requests call without timeout
"B008", # Do not perform function call in argument defaults
"ANN001", # Missing type annotation for function argument
"ANN002", # Missing type annotation for `*args`
"ANN003", # Missing type annotation for `**kwargs`
"ANN401", # Dynamically typed expressions are disallowed
]
extend-exclude = [
"python/tests/server/fixtures/*",
"crates/coglet-python/**/*.pyi",
"crates/coglet-python/scripts/*",
]
src = ["python"]
[tool.ruff.lint.per-file-ignores]
"python/cog/server/http.py" = [
"S104", # Possible binding to all interfaces
]
"python/tests/*" = [
"S101", # Use of assert
"S104", # Possible binding to all interfaces
"S105", # Possible hardcoded password
"S106", # Possible hardcoded password in argument
"S108", # Probable insecure usage of temp file
"S110", # try-except-pass
"S301", # pickle can be unsafe when used to deserialize untrusted data
"S603", # subprocess call — tests use subprocess for isolation
"ANN", # Type annotations not required in tests
"B011", # Do not assert False
]
"crates/coglet-python/tests/*" = [
"S101", # Use of assert
"S104", # Possible binding to all interfaces
"S110", # try-except-pass
"S603", # subprocess call
"ANN", # Type annotations not required in tests
"B904", # raise from
]
"tools/test-harness/*" = [
"S310", # URL open — URLs are hardcoded to https://
"S603", # subprocess call — harness invokes cog/docker/git by design
"S607", # partial executable path — cog/docker/git resolved via PATH
"ANN", # Type annotations not required in tooling
]