Пример #1
0
    def prepare_files(self, finder, **kwargs):
        wheel_dir = CacheOpts().wheelhouse
        self.wheel_download_dir = wheel_dir

        super(FasterRequirementSet, self).prepare_files(finder, **kwargs)

        # build wheels before install.
        wb = FasterWheelBuilder(
            self,
            finder,
            wheel_dir=wheel_dir,
        )
        # TODO-TEST: we only incur the build cost once on uncached install
        for req in wb.build():
            link = optimistic_wheel_search(req, finder.find_links)
            if link is None:
                logger.error(
                    'SLOW!! no wheel found after building (couldn\'t be wheeled?): %s',
                    req)
                continue

            # replace the setup.py "sdist" with the wheel "bdist"
            from pip.util import rmtree, unzip_file
            rmtree(req.source_dir)
            unzip_file(link.path, req.source_dir, flatten=False)
            req.url = link.url
Пример #2
0
 def test_unpack_zip(self, data):
     """
     Test unpacking a *.zip, and setting execute permissions
     """
     test_file = data.packages.join("test_zip.zip")
     unzip_file(test_file, self.tempdir)
     self.confirm_files()
Пример #3
0
    def prepare_files(self, finder, **kwargs):
        wheel_dir = CacheOpts().wheelhouse
        self.wheel_download_dir = wheel_dir

        super(FasterRequirementSet, self).prepare_files(finder, **kwargs)

        # build wheels before install.
        wb = FasterWheelBuilder(
            self,
            finder,
            wheel_dir=wheel_dir,
        )
        # TODO-TEST: we only incur the build cost once on uncached install
        for req in wb.build():
            link = optimistic_wheel_search(req, finder.find_links)
            if link is None:
                logger.error('SLOW!! no wheel found after building (couldn\'t be wheeled?): %s', req)
                continue

            # replace the setup.py "sdist" with the wheel "bdist"
            from pip.util import rmtree, unzip_file
            rmtree(req.source_dir)
            unzip_file(link.path, req.source_dir, flatten=False)
            req.url = link.url