MCPcopy Index your code
hub / github.com/pyinstaller/pyinstaller / metadata_required

Method metadata_required

PyInstaller/depend/analysis.py:810–833  ·  view source on GitHub ↗

Collect metadata for all packages that appear to need it.

(self)

Source from the content-addressed store, hash-verified

808 return co_dict
809
810 def metadata_required(self) -> set:
811 """
812 Collect metadata for all packages that appear to need it.
813 """
814
815 # List every function that we can think of which is known to require metadata.
816 out = set()
817
818 out |= self._metadata_from(
819 "pkg_resources",
820 ["get_distribution"], # Requires metadata for one distribution.
821 ["require"], # Requires metadata for all dependencies.
822 )
823
824 # importlib.metadata is often `import ... as` aliased to importlib_metadata for compatibility with < py38.
825 # Assume both are valid.
826 for importlib_metadata in ["importlib.metadata", "importlib_metadata"]:
827 out |= self._metadata_from(
828 importlib_metadata,
829 ["metadata", "distribution", "version", "files", "requires"],
830 [],
831 )
832
833 return out
834
835 def _metadata_from(self, package, methods=(), recursive_methods=()) -> set:
836 """

Callers 3

test_metadata_collectionFunction · 0.95
test_metadata_searchingFunction · 0.80
assembleMethod · 0.80

Calls 1

_metadata_fromMethod · 0.95

Tested by 2

test_metadata_collectionFunction · 0.76
test_metadata_searchingFunction · 0.64