def build_egg_info(self, out_dir: str) -> str: # Ignore destination since editable builds should be build locally builder = Builder(self.src_dir) setup_py_path = builder.ensure_setup_py().as_posix() self.install(["setuptools"]) args = [self.executable, "-c", _SETUPTOOLS_SHIM.format(setup_py_path)] args.extend(["egg_info", "--egg-base", out_dir]) self.subprocess_runner(args, cwd=self.src_dir) filename = _find_egg_info(out_dir) return os.path.join(out_dir, filename)
def ensure_setup_py(self) -> str: from pdm.pep517.base import Builder from pdm.project.metadata import MutableMetadata builder = Builder(self.src_dir) if os.path.exists(os.path.join(self.src_dir, "pyproject.toml")): try: builder._meta = MutableMetadata( os.path.join(self.src_dir, "pyproject.toml")) except ValueError: builder._meta = None return builder.ensure_setup_py().as_posix()
def build_egg_info(self, out_dir: str) -> str: # Ignore destination since editable builds should be build locally from pdm.project.metadata import MutableMetadata builder = Builder(self.src_dir) if os.path.exists(os.path.join(self.src_dir, "pyproject.toml")): builder._meta = MutableMetadata( os.path.join(self.src_dir, "pyproject.toml")) setup_py_path = builder.ensure_setup_py().as_posix() self.install(["setuptools"]) args = [self.executable, "-c", _SETUPTOOLS_SHIM.format(setup_py_path)] args.extend( ["egg_info", "--egg-base", os.path.relpath(out_dir, self.src_dir)]) self.subprocess_runner(args, cwd=self.src_dir) filename = _find_egg_info(out_dir) return os.path.join(out_dir, filename)
def build(self, out_dir: str, config_settings: Optional[Mapping[str, Any]] = None) -> str: from pdm.pep517.base import Builder from pdm.project.metadata import MutableMetadata builder = Builder(self.src_dir) if os.path.exists(os.path.join(self.src_dir, "pyproject.toml")): builder._meta = MutableMetadata( os.path.join(self.src_dir, "pyproject.toml")) setup_py_path = builder.ensure_setup_py().as_posix() self.install(["setuptools"]) args = [self.executable, "-c", _SETUPTOOLS_SHIM.format(setup_py_path)] args.extend( ["egg_info", "--egg-base", os.path.relpath(out_dir, self.src_dir)]) self.subprocess_runner(args, cwd=self.src_dir) filename = self._find_egg_info(out_dir) return os.path.join(out_dir, filename)