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.
|
# 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
|
from jittor_utils import lock
|
||||||
with lock.lock_scope():
|
with lock.lock_scope():
|
||||||
ori_int = int
|
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()
|
3
setup.py
3
setup.py
|
@ -16,9 +16,6 @@ Reference:
|
||||||
from warnings import warn
|
from warnings import warn
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import site
|
|
||||||
import sys
|
|
||||||
site.ENABLE_USER_SITE = "--user" in sys.argv[1:]
|
|
||||||
|
|
||||||
if not platform.system() in ['Linux', 'Darwin']:
|
if not platform.system() in ['Linux', 'Darwin']:
|
||||||
assert os.environ.get("FORCE_INSTALL", '0') != '1', error_msg
|
assert os.environ.get("FORCE_INSTALL", '0') != '1', error_msg
|
||||||
|
|
Loading…
Reference in New Issue