13
13
import pkgutil
14
14
import tomllib
15
15
import typing
16
- import warnings
17
16
from collections .abc import Iterable
18
17
from os .path import splitext
19
18
@@ -36,35 +35,6 @@ def ensure_png(fname):
36
35
return ensure_ext (fname , ".png" )
37
36
38
37
39
- def ensure_source (fname ):
40
- """Return true if the path passed in specifies a source file"""
41
- extensions = [
42
- ".s" ,
43
- ".asm" ,
44
- ".c" ,
45
- ".cpp" ,
46
- ".cxx" ,
47
- ".c++" ,
48
- ".cc" ,
49
- ".h" ,
50
- ".hpp" ,
51
- ".hxx" ,
52
- ".h++" ,
53
- ".hh" ,
54
- ".inc" ,
55
- ".inl" ,
56
- ".tcc" ,
57
- ".icc" ,
58
- ".ipp" ,
59
- ]
60
- return ensure_ext (fname , extensions )
61
-
62
-
63
- def ensure_json (fname ):
64
- """Return true if the path passed in specifies a JSON file"""
65
- return ensure_ext (fname , ".json" )
66
-
67
-
68
38
def safe_open_write_binary (fname ):
69
39
"""Open fname for (binary) writing. Truncate if not a symlink."""
70
40
fpid = os .open (
@@ -235,37 +205,3 @@ def _load_toml(file_object: typing.TextIO, schema_name: str) -> object:
235
205
toml_object = tomllib .load (file_object )
236
206
_validate_json (toml_object , schema_name )
237
207
return toml_object
238
-
239
-
240
- def validate_coverage_json (json_string : str ) -> bool :
241
- """
242
- Validate coverage JSON string against schema.
243
-
244
- Parameters
245
- ----------
246
- json_string : String
247
- The JSON string to validate.
248
-
249
- Returns
250
- -------
251
- bool
252
- True if the JSON string is valid.
253
-
254
- Raises
255
- ------
256
- ValueError
257
- If the JSON string fails to validate.
258
-
259
- TypeError
260
- If the JSON string is not a string.
261
- """
262
- warnings .warn (
263
- "Direct access to JSON validation is deprecated." ,
264
- DeprecationWarning ,
265
- )
266
-
267
- if not isinstance (json_string , str ):
268
- raise TypeError ("Coverage must be a JSON string." )
269
-
270
- instance = json .loads (json_string )
271
- return _validate_json (instance , "coverage" )
0 commit comments