(self)
Initialize the plugin reading patterns from the config.
Initialize the plugin reading patterns from the config.
Initialize the plugin reading patterns from the config .
def initialize_plugin(self) -> None:
        """
        Initialize the plugin reading patterns from the config.
        """
        if self._patterns or self._packagetypes:
            logger.debug(
                "Skipping initalization of Exclude Platform plugin. "
                + "Already initialized"
            )
            return

        try:
            tags = self.blocklist["platforms"].split()
        except KeyError:
            logger.error(f"Plugin {self.name}: missing platforms= setting")
            return

        for platform in tags:
            lplatform = platform.lower()

            if lplatform in ("windows", "win"):
                # PEP 425
                # see also setuptools/package_index.py
                self._patterns.extend(self._windowsPlatformTypes)
                # PEP 527
                self._packagetypes.extend(["bdist_msi", "bdist_wininst"])

            elif lplatform in ("macos", "macosx"):
                self._patterns.extend(["macosx_", "macosx-"])
                self._packagetypes.extend(["bdist_dmg"])

            elif lplatform in ("freebsd"):
                # concerns only very few files
                self._patterns.extend([".freebsd", "-freebsd"])

            elif lplatform in ("linux"):
                self._patterns.extend(self._linuxPlatformTypes)
                self._packagetypes.extend(["bdist_rpm"])

            # check for platform specific architectures
            elif lplatform in self._windowsPlatformTypes:
                self._patterns.extend([lplatform])

            elif lplatform in self._linuxPlatformTypes:
                self._patterns.extend([lplatform])

        logger.info(f"Initialized {self.name} plugin with {self._patterns!r}")
def initialize_plugin ( self ) -> None : if self . _patterns or self . _packagetypes : logger . debug ( "Skipping initalization of Exclude Platform plugin. " + "Already initialized" ) return try : tags = self . blocklist [ "platforms" ] . split ( ) except KeyError : logger . error ( f"Plugin {self.name}: missing platforms= setting" ) return for platform in tags : lplatform = platform . lower ( ) if lplatform in ( "windows" , "win" ) : # PEP 425 # see also setuptools/package_index.py self . _patterns . extend ( self . _windowsPlatformTypes ) # PEP 527 self . _packagetypes . extend ( [ "bdist_msi" , "bdist_wininst" ] ) elif lplatform in ( "macos" , "macosx" ) : self . _patterns . extend ( [ "macosx_" , "macosx-" ] ) self . _packagetypes . extend ( [ "bdist_dmg" ] ) elif lplatform in ( "freebsd" ) : # concerns only very few files self . _patterns . extend ( [ ".freebsd" , "-freebsd" ] ) elif lplatform in ( "linux" ) : self . _patterns . extend ( self . _linuxPlatformTypes ) self . _packagetypes . extend ( [ "bdist_rpm" ] ) # check for platform specific architectures elif lplatform in self . _windowsPlatformTypes : self . _patterns . extend ( [ lplatform ] ) elif lplatform in self . _linuxPlatformTypes : self . _patterns . extend ( [ lplatform ] ) logger . info ( f"Initialized {self.name} plugin with {self._patterns!r}" )