forked from jittor/jittor
add pip_publish
This commit is contained in:
parent
e0d046f449
commit
030b30727d
|
@ -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
|
||||
|
|
|
@ -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()
|
Loading…
Reference in New Issue