def __init__(self, cache_dir=CACHE_DIR): vistir.mkdir_p(cache_dir) python_version = ".".join(str(digit) for digit in sys.version_info[:2]) cache_filename = self.filename_format.format( python_version=python_version, ) self._cache_file = os.path.join(cache_dir, cache_filename) self._cache = None
def _prepare_wheel_building_kwargs(ireq, cache_dir=None): cache_dir = cache_dir if cache_dir is not None else CACHE_DIR download_dir = os.path.join(cache_dir, "pkgs") vistir.mkdir_p(download_dir) wheel_download_dir = os.path.join(cache_dir, "wheels") vistir.mkdir_p(wheel_download_dir) if ireq.source_dir is not None: src_dir = ireq.source_dir elif ireq.editable: src_dir = _get_src_dir() else: src_dir = vistir.path.create_tracked_tempdir(prefix='passa-src') # This logic matches pip's behavior, although I don't fully understand the # intention. I guess the idea is to build editables in-place, otherwise out # of the source tree? if ireq.editable: build_dir = src_dir else: build_dir = vistir.path.create_tracked_tempdir(prefix="passa-build") return { "build_dir": build_dir, "src_dir": src_dir, "download_dir": download_dir, "wheel_download_dir": wheel_download_dir, }