Now verify-manifest.py is windows-compatible again

This commit is contained in:
Jeppe Klitgaard committed 2015-04-06 01:25:16 +02:00
1 parent c35a887e1a
commit e31bfb58f0
2 files changed
+12 -12

No files matched your search

+9 -9
View File
@@ -1,28 +1,28 @@
""" """
Exits with exit code 0 if manifest was verified. Exits with exit code 0 if manifest was verified.
""" """
from sh import check_manifest
from sh import ErrorReturnCode_1
import sys import sys
import subprocess
import errno
import os
EXPECTED_OUTPUT = "lists of files in version control and sdist match" EXPECTED_OUTPUT = "lists of files in version control and sdist match"
os.chdir("..") # Leave bin/
def verify_manifest(): def verify_manifest():
""" """
Returns a ``str`` containing output from ``check-manifest``. Returns a ``str`` containing output from ``check-manifest``.
""" """
try: try:
output = check_manifest().decode() output = subprocess.check_output("check-manifest",
except ErrorReturnCode_1 as e: stderr=subprocess.STDOUT)
output = e.stderr.decode() + e.stdout.decode() except subprocess.CalledProcessError as e:
output = e.output
return output return output.decode().strip()
if __name__ == '__main__': if __name__ == '__main__':
output = verify_manifest() output = verify_manifest()
print(output) print(output)
if output == EXPECTED_OUTPUT: if output == EXPECTED_OUTPUT:
+3 -3
View File
@@ -36,7 +36,7 @@ deps =
[testenv:flake8] [testenv:flake8]
basepython = python3.4 basepython = python3.4
commands = commands =
flake8 minecraft tests setup.py flake8 minecraft tests bin/*.py setup.py start.py
deps = deps =
{[testenv]deps} {[testenv]deps}
flake8 flake8
@@ -70,7 +70,7 @@ commands =
basepython = python3.4 basepython = python3.4
deps = deps =
check-manifest check-manifest
sh changedir = bin
commands = commands =
python {toxinidir}/bin/verify-manifest.py python verify-manifest.py