diff --git a/python/jittor/__init__.py b/python/jittor/__init__.py index 5c7ff45e..d6573283 100644 --- a/python/jittor/__init__.py +++ b/python/jittor/__init__.py @@ -9,7 +9,7 @@ # file 'LICENSE.txt', which is part of this source code package. # *************************************************************** -__version__ = '1.3.0.12' +__version__ = '1.3.0.14' from jittor_utils import lock with lock.lock_scope(): ori_int = int diff --git a/python/jittor_utils/pip_publish.py b/python/jittor_utils/pip_publish.py new file mode 100644 index 00000000..80a45dce --- /dev/null +++ b/python/jittor_utils/pip_publish.py @@ -0,0 +1,34 @@ +import os +import glob +import shutil +import sys + +home_path = os.path.join(os.path.dirname(__file__), "..", "..") +home_path = os.path.abspath(home_path) + +def callback(func, path, exc_info): + print(f"remove \"{path}\" failed.") + +def rmtree(path): + if os.path.isdir(path): + print(f"remove \"{path}\" recursive.") + shutil.rmtree(path, onerror=callback) + +def remove_tmpfile(): + dist_file = home_path+"/dist" + egg_file = glob.glob(home_path+"/**/*egg-info") + rmtree(dist_file) + for e in egg_file: + rmtree(e) + +def run_cmd(cmd): + print("[CMD]", cmd) + assert os.system(cmd)==0 + +os.chdir(home_path) +remove_tmpfile() + +run_cmd(f"{sys.executable} ./setup.py sdist") +run_cmd(f"{sys.executable} -m twine upload dist/*") + +remove_tmpfile() \ No newline at end of file diff --git a/setup.py b/setup.py index 3b23b7c3..741165d2 100644 --- a/setup.py +++ b/setup.py @@ -16,9 +16,6 @@ Reference: from warnings import warn import os import platform -import site -import sys -site.ENABLE_USER_SITE = "--user" in sys.argv[1:] if not platform.system() in ['Linux', 'Darwin']: assert os.environ.get("FORCE_INSTALL", '0') != '1', error_msg