MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / platform_key

Method platform_key

lib/sqlalchemy/testing/profiling.py:92–118  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

90
91 @property
92 def platform_key(self):
93 dbapi_key = config.db.name + "_" + config.db.driver
94 if config.db.dialect.is_async:
95 dbapi_key += "_async"
96
97 if config.db.name == "sqlite" and config.db.dialect._is_url_file_db(
98 config.db.url
99 ):
100 dbapi_key += "_file"
101
102 # keep it at 2.7, 3.1, 3.2, etc. for now.
103 py_version = ".".join([str(v) for v in sys.version_info[0:2]])
104 if freethreading:
105 py_version += "t"
106
107 platform_tokens = [
108 platform.machine(),
109 platform.system().lower(),
110 platform.python_implementation().lower(),
111 py_version,
112 dbapi_key,
113 ]
114
115 platform_tokens.append("dbapiunicode")
116 _has_cext = has_compiled_ext()
117 platform_tokens.append(_has_cext and "cextensions" or "nocextensions")
118 return "_".join(platform_tokens)
119
120 def has_stats(self):
121 test_key = _current_test

Callers

nothing calls this directly

Calls 5

has_compiled_extFunction · 0.85
_is_url_file_dbMethod · 0.80
lowerMethod · 0.80
joinMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected