1 | | - | #import os |
2 | | - | import pexpect |
3 | | - | import sys |
4 | | - | #import shutil |
5 | | - | |
6 | | - | try: |
7 | | - | user=sys.argv[1] |
8 | | - | passw=sys.argv[2] |
9 | | - | |
10 | | - | except: |
11 | | - | print(f"USAGE : python3 {sys.argv[0]} <USER> <PASSWORD>") |
12 | | - | exit() |
13 | | - | |
14 | | - | #os.chdir(path) |
15 | | - | |
16 | | - | child=pexpect.spawn("python setup.py sdist bdist_wheel") |
17 | | - | #child.before |
18 | | - | child.interact() |
19 | | - | #print(child.read().decode("utf-8")) |
20 | | - | child.kill(0) |
21 | | - | |
22 | | - | child=pexpect.spawn("python -m twine upload dist/*") |
23 | | - | #child.before |
24 | | - | child.expect('Enter your username: ') |
25 | | - | child.sendline(user) |
26 | | - | child.expect('Enter your password: ') |
27 | | - | child.sendline(passw) |
28 | | - | #print(child.read().decode("utf-8")) |
29 | | - | child.interact() |
30 | | - | child.kill(0) |
31 | | - | |
32 | | - | #rmv=["build","dist",path+".egg-info"] |
33 | | - | |
34 | | - | #try: |
35 | | - | # for i in range(len(rmv)): |
36 | | - | # shutil.rmtree(rmv[i]) |
37 | | - | #except OSError as e: |
38 | | - | # print("Error: %s - %s." % (e.filename, e.strerror)) |
39 | | - | |