| @@ -6,7 +6,7 @@ import os | |||||
| path = os.path.split(__file__)[0] | path = os.path.split(__file__)[0] | ||||
| if path: | if path: | ||||
| os.chdir(path) | |||||
| os.chdir(path) | |||||
| environments = ['26', '27', '32', '33', '34'] | environments = ['26', '27', '32', '33', '34'] | ||||
| @@ -15,29 +15,29 @@ target = "pypi" if "--push" in sys.argv else "test" | |||||
| returnvalues = {} | returnvalues = {} | ||||
| def run(pyver, cmds, target=None): | def run(pyver, cmds, target=None): | ||||
| cmd = [r"C:\Python%s\Python.exe" % pyver, "setup.py"] + cmds | |||||
| if target: | |||||
| cmd += ["-r", target] | |||||
| print(" ".join(cmd), end=" ") | |||||
| retval = subprocess.call(cmd, stdout=open("%s%s.log" % (cmds[0], pyver), 'w'), stderr=subprocess.STDOUT, cwd="..") | |||||
| if not retval: | |||||
| print("[OK]") | |||||
| else: | |||||
| print("[FAILED (%i)]" % retval) | |||||
| return retval | |||||
| cmd = [r"C:\Python%s\Python.exe" % pyver, "setup.py"] + cmds | |||||
| if target: | |||||
| cmd += ["-r", target] | |||||
| print(" ".join(cmd), end=" ") | |||||
| retval = subprocess.call(cmd, stdout=open("%s%s.log" % (cmds[0], pyver), 'w'), stderr=subprocess.STDOUT, cwd="..") | |||||
| if not retval: | |||||
| print("[OK]") | |||||
| else: | |||||
| print("[FAILED (%i)]" % retval) | |||||
| return retval | |||||
| run("27", ["register"], target) | run("27", ["register"], target) | ||||
| if 'failed' in open('register27.log').read(): | if 'failed' in open('register27.log').read(): | ||||
| raise Exception | |||||
| raise Exception | |||||
| for pyver in environments: | for pyver in environments: | ||||
| print() | |||||
| try: | |||||
| os.unlink('mwparserfromhell/parser/_tokenizer.pyd') | |||||
| except WindowsError: | |||||
| pass | |||||
| if run(pyver, ["test"]) == 0: | |||||
| run(pyver, ["bdist_wheel", "upload"], target) | |||||
| print() | |||||
| try: | |||||
| os.unlink('mwparserfromhell/parser/_tokenizer.pyd') | |||||
| except WindowsError: | |||||
| pass | |||||
| if run(pyver, ["test"]) == 0: | |||||
| run(pyver, ["bdist_wheel", "upload"], target) | |||||