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

Function build_package_name

src/formattedcode/output_spdx.py:154–165  ·  view source on GitHub ↗

Return a package name built from an ``input_path`` path.

(input_path)

Source from the content-addressed store, hash-verified

152
153
154def build_package_name(input_path):
155 """
156 Return a package name built from an ``input_path`` path.
157
158 """
159 if input_path:
160 absinput = absinput = os.path.abspath(input_path)
161 if os.path.isfile(absinput):
162 input_path = parent_directory(absinput)
163 return python_safe_name(file_name(input_path))
164
165 return 'scancode-toolkit-analyzed-package'
166
167
168def check_sha1(codebase):

Callers 1

_process_codebaseFunction · 0.85

Calls 3

parent_directoryFunction · 0.90
python_safe_nameFunction · 0.90
file_nameFunction · 0.90

Tested by

no test coverage detected