A Python parser for MediaWiki wikicode https://mwparserfromhell.readthedocs.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

59 lines
1.7 KiB

  1. # Build requirements:
  2. #
  3. # Python 2.6-3.2: Visual C++ Express Edition 2008:
  4. # http://go.microsoft.com/?linkid=7729279
  5. #
  6. # Python 3.3+: Visual C++ Express Edition 2010:
  7. # http://go.microsoft.com/?linkid=9709949
  8. #
  9. # x64 builds: Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1:
  10. # http://www.microsoft.com/en-us/download/details.aspx?id=3138
  11. #
  12. # Python interpreter, 2.6, 2.7, 3.2-3.4:
  13. # https://www.python.org/downloads/
  14. #
  15. # Pip, setuptools, wheel:
  16. # https://bootstrap.pypa.io/get-pip.py
  17. # and run *for each* Python version:
  18. # c:\pythonXX\python get-pip.py
  19. # c:\pythonXX\scripts\pip install wheel
  20. #
  21. # Afterwards, run this script with any of the python interpreters (2.7 suggested)
  22. from __future__ import print_function
  23. import os
  24. from subprocess import call, STDOUT
  25. ENVIRONMENTS = ["26", "27", "32", "33", "34"]
  26. def run(pyver, cmds):
  27. cmd = [r"C:\Python%s\Python.exe" % pyver, "setup.py"] + cmds
  28. print(" ".join(cmd), end=" ")
  29. with open("%s%s.log" % (cmds[0], pyver), "w") as logfile:
  30. retval = call(cmd, stdout=logfile, stderr=STDOUT, cwd="..")
  31. if not retval:
  32. print("[OK]")
  33. else:
  34. print("[FAILED (%i)]" % retval)
  35. return retval
  36. def main():
  37. path = os.path.split(__file__)[0]
  38. if path:
  39. os.chdir(path)
  40. print("Building Windows wheels for Python %s:" % ", ".join(ENVIRONMENTS))
  41. for pyver in ENVIRONMENTS:
  42. print()
  43. try:
  44. os.unlink("mwparserfromhell/parser/_tokenizer.pyd")
  45. except OSError:
  46. pass
  47. if run(pyver, ["test"]) == 0:
  48. run(pyver, ["bdist_wheel", "upload"]) # TODO: add "-s" to GPG sign
  49. if __name__ == "__main__":
  50. main()