MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / find_plain_version

Function find_plain_version

src/packagedcode/pypi.py:2710–2718  ·  view source on GitHub ↗

Return a plain version attribute string or None from searching the module file at `location`.

(location)

Source from the content-addressed store, hash-verified

2708
2709
2710def find_plain_version(location):
2711 """
2712 Return a plain version attribute string or None from searching the module
2713 file at `location`.
2714 """
2715 pattern = re.compile(r"^version\s*=\s*['\"]([^'\"]*)['\"]", re.MULTILINE)
2716 match = find_pattern(location, pattern)
2717 if TRACE: logger_debug('find_plain_version:', 'location:', location, 'match:', match)
2718 return match
2719
2720
2721def find_setup_py_dunder_version(location):

Callers

nothing calls this directly

Calls 2

find_patternFunction · 0.70
logger_debugFunction · 0.70

Tested by

no test coverage detected