예제 #1
0
    def _find_http_files(self, options):

        # type: (Values) -> List[str]

        http_dir = self._cache_dir(options, 'http')

        return filesystem.find_files(http_dir, '*')
예제 #2
0
    def _find_wheels(self, options, pattern):

        # type: (Values, str) -> List[str]

        wheel_dir = self._cache_dir(options, 'wheels')

        # The wheel filename format, as specified in PEP 427, is:

        #     {distribution}-{version}(-{build})?-{python}-{abi}-{platform}.whl

        #

        # Additionally, non-alphanumeric values in the distribution are

        # normalized to underscores (_), meaning hyphens can never occur

        # before `-{version}`.

        #

        # Given that information:

        # - If the pattern we're given contains a hyphen (-), the user is

        #   providing at least the version. Thus, we can just append `*.whl`

        #   to match the rest of it.

        # - If the pattern we're given doesn't contain a hyphen (-), the

        #   user is only providing the name. Thus, we append `-*.whl` to

        #   match the hyphen before the version, followed by anything else.

        #

        # PEP 427: https://www.python.org/dev/peps/pep-0427/

        pattern = pattern + ("*.whl" if "-" in pattern else "-*.whl")

        return filesystem.find_files(wheel_dir, pattern)
예제 #3
0
        return self.remove_cache_items(options, ['*'])

    def _wheels_cache_dir(self, options):
        # type: (Values) -> str
        return os.path.join(options.cache_dir, 'wheels')

    def _find_wheels(self, options, pattern):
        # type: (Values, str) -> List[str]
        wheel_dir = self._wheels_cache_dir(options)

        # The wheel filename format, as specified in PEP 427, is:
        #     {distribution}-{version}(-{build})?-{python}-{abi}-{platform}.whl
        #
        # Additionally, non-alphanumeric values in the distribution are
        # normalized to underscores (_), meaning hyphens can never occur
        # before `-{version}`.
        #
        # Given that information:
        # - If the pattern we're given contains a hyphen (-), the user is
        #   providing at least the version. Thus, we can just append `*.whl`
        #   to match the rest of it.
        # - If the pattern we're given doesn't contain a hyphen (-), the
        #   user is only providing the name. Thus, we append `-*.whl` to
        #   match the hyphen before the version, followed by anything else.
        #
        # PEP 427: https://www.python.org/dev/peps/pep-0427/
        pattern = pattern + ("*.whl" if "-" in pattern else "-*.whl")

        return filesystem.find_files(wheel_dir, pattern)
예제 #4
0
 def _find_http_files(self, options: Values) -> List[str]:
     http_dir = self._cache_dir(options, "http")
     return filesystem.find_files(http_dir, "*")
예제 #5
0
    def purge_cache(self, options, args):
        # type: (Values, List[Any]) -> None
        if args:
            raise CommandError('Too many arguments')

        return self.remove_cache_items(options, ['*'])

<<<<<<< HEAD
    def _cache_dir(self, options, subdir):
        # type: (Values, str) -> str
        return os.path.join(options.cache_dir, subdir)

    def _find_http_files(self, options):
        # type: (Values) -> List[str]
        http_dir = self._cache_dir(options, 'http')
        return filesystem.find_files(http_dir, '*')

    def _find_wheels(self, options, pattern):
        # type: (Values, str) -> List[str]
        wheel_dir = self._cache_dir(options, 'wheels')
=======
    def _wheels_cache_dir(self, options):
        # type: (Values) -> str
        return os.path.join(options.cache_dir, 'wheels')

    def _find_wheels(self, options, pattern):
        # type: (Values, str) -> List[str]
        wheel_dir = self._wheels_cache_dir(options)
>>>>>>> 74c061954d5e927be4caafbd793e96a50563c265

        # The wheel filename format, as specified in PEP 427, is: