Skip to content

Commit f042d4f

Browse files
ci: replace slotscheck with PLW0244 (#15257)
## Description PLW0244 provides us the same type of check that `slotscheck` gives us. The only main difference is ruff/PLW0244 is a static analysis check and `slotscheck` actually imports the code to validate the final evaluated properties/class hierarchy. ## Testing <!-- Describe your testing strategy or note what tests are included --> ## Risks <!-- Note any risks associated with this change, or "None" if no risks --> ## Additional Notes <!-- Any other information that would be helpful for reviewers --> --------- Co-authored-by: Juanjo Alvarez Martinez <juanjo.alvarezmartinez@datadoghq.com>
1 parent f7999ce commit f042d4f

File tree

4 files changed

+1
-80
lines changed

4 files changed

+1
-80
lines changed

.riot/requirements/16ebde6.txt

Lines changed: 0 additions & 24 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -154,50 +154,6 @@ exclude = [
154154
".worktrees",
155155
]
156156

157-
[tool.slotscheck]
158-
exclude-modules = '''
159-
(
160-
^ddtrace.(contrib|vendor)
161-
| ^tests.(contrib|vendor)
162-
# avoid sitecustomize modules as they start services
163-
| ddtrace.bootstrap.sitecustomize
164-
| ddtrace.openfeature
165-
| ddtrace.internal.openfeature
166-
| ddtrace.profiling.bootstrap.sitecustomize
167-
| ddtrace.profiling.auto
168-
# also ignore preload module to avoid exception after moving ddtrace.tracing module
169-
| ddtrace.bootstrap.preload
170-
# protobuf file fails to import
171-
| tests.profiling.collector.pprof_3_pb2
172-
| tests.profiling.collector.pprof_312_pb2
173-
| tests.profiling.collector.pprof_319_pb2
174-
| tests.profiling.collector.pprof_421_pb2
175-
# TODO: resolve slot inheritance issues with profiling
176-
| ddtrace.profiling.collector
177-
| ddtrace.profiling._gevent
178-
| ddtrace,appsec,iast,_taint_tracking.vendor
179-
| ddtrace.appsec._ddwaf.ddwaf_types
180-
| ddtrace.appsec._iast._taint_tracking
181-
| ddtrace.appsec._iast._ast.aspects
182-
| ddtrace.appsec._iast._taint_utils
183-
| ddtrace.appsec._iast.taint_sinks.sql_injection
184-
# DSM specific contribs
185-
| ddtrace.internal.datastreams.kafka
186-
# libdd_wrapper is a common native dependency, not a module
187-
| ddtrace.internal.datadog.profiling.libdd_wrapper
188-
# _ddup and _stack_v2 miss a runtime dependency in slotscheck, but ddup and stack_v2 are fine
189-
| ddtrace.internal.datadog.profiling.ddup._ddup
190-
| ddtrace.internal.datadog.profiling.stack_v2._stack_v2
191-
# coverage has version-specific checks that prevent import
192-
| ddtrace.internal.coverage.instrumentation_py3_8
193-
| ddtrace.internal.coverage.instrumentation_py3_10
194-
| ddtrace.internal.coverage.instrumentation_py3_11
195-
| ddtrace.internal.coverage.instrumentation_py3_12
196-
| ddtrace.internal.coverage.instrumentation_py3_13
197-
| ddtrace.internal.coverage.instrumentation_py3_14
198-
)
199-
'''
200-
201157
[tool.bandit]
202158
targets = ["ddtrace/"]
203159

@@ -280,6 +236,7 @@ lint.select = [
280236
"F",
281237
"G",
282238
"I",
239+
"PLW0244", # redefined-slots-in-subclass
283240
"W",
284241
]
285242
lint.unfixable =[

riotfile.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,6 @@ def select_pys(min_version: str = MIN_PYTHON_VERSION, max_version: str = MAX_PYT
128128
"DD_CIVISIBILITY_FLAKY_RETRY_ENABLED": "0",
129129
},
130130
),
131-
Venv(
132-
name="slotscheck",
133-
command="python -m slotscheck -v ddtrace/",
134-
pys=["3.10"],
135-
pkgs={"slotscheck": "==0.17.0"},
136-
),
137131
Venv(
138132
name="build_docs",
139133
command="scripts/docs/build.sh",

tests/suitespec.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,6 @@ suites:
218218
parallelism: 2
219219
runner: riot
220220
pattern: ^lib_injection$
221-
slotscheck:
222-
parallelism: 1
223-
paths:
224-
- 'ddtrace/**/*.py'
225-
runner: riot
226-
snapshot: false
227221
runtime:
228222
paths:
229223
- '@bootstrap'

0 commit comments

Comments
 (0)