Skip to content

Commit

Permalink
Updated build_distrib routine
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexShkarin committed Oct 8, 2023
1 parent cce7d3d commit c3521c8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions build_distrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,28 @@ def clear_build():
shutil.rmtree("dist",ignore_errors=True)
shutil.rmtree("pylablib.egg-info",ignore_errors=True)
shutil.rmtree("pylablib_lightweight.egg-info",ignore_errors=True)
def make():
subprocess.call(["python","setup.py","sdist","bdist_wheel"])
def make(wheel):
subprocess.call(["python","setup.py","sdist"]+(["bdist_wheel"] if wheel else []))
def upload(production=False):
if production:
subprocess.call(["python","-m","twine","upload","dist/*"])
subprocess.call(["python","-m","twine","upload","--skip-existing","dist/*"])
else:
subprocess.call(["python","-m","twine","upload","--repository","testpypi","dist/*"])
subprocess.call(["python","-m","twine","upload","--repository","testpypi","--skip-existing","dist/*"])
# pip install -U --no-cache-dir --extra-index-url https://testpypi.python.org/pypi pylablib


parser=argparse.ArgumentParser()
parser.add_argument("--update",action="store_true")
parser.add_argument("-b","--build",action="store_true")
parser.add_argument("-w","--wheel",action="store_true")
parser.add_argument("-u","--upload",action="store_true")
parser.add_argument("-p","--production",action="store_true")
args=parser.parse_args()

if args.update:
update()
clear_build()
make()
if args.build:
clear_build()
make(args.wheel)
if args.upload:
upload(production=args.production)

0 comments on commit c3521c8

Please sign in to comment.