-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create noop IPEX using temp folder (#1985)
Closes #1984 Signed-off-by: Anatoly Myachev <[email protected]>
- Loading branch information
Showing
2 changed files
with
47 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from os import chdir, makedirs | ||
from tempfile import TemporaryDirectory | ||
from subprocess import run | ||
|
||
with TemporaryDirectory() as tmpdir: | ||
pkg = "intel_extension_for_pytorch" | ||
version = "2.4.0+noop" | ||
|
||
chdir(tmpdir) | ||
makedirs(pkg, exist_ok=True) | ||
|
||
files = { | ||
f"{pkg}/__init__.py": | ||
f"__version__ = \"{version}\"", "setup.py": | ||
("from setuptools import setup, find_packages\n" | ||
f"setup(name='{pkg}', version='{version}', packages=find_packages())\n"), "project.toml": | ||
("[build-system]\n" | ||
"requires = [\"setuptools\", \"wheel\"]\n" | ||
"build-backend = \"setuptools.build_meta\"\n") | ||
} | ||
for file, content in files.items(): | ||
with open(file, "w") as f: | ||
f.write(content) | ||
cmds = [ | ||
f"pip uninstall -y {pkg}", "pip install build", "python -m build .", | ||
f"pip install dist/{pkg}-{version}-py3-none-any.whl" | ||
] | ||
for cmd in cmds: | ||
run(cmd.split(), check=True) |