Spruced up verify-manifest.py
This commit is contained in:
1 parent
fff3947b16
commit
902d11b8e1
1 file changed
+22
-7
+22
-7
@@ -1,19 +1,34 @@
|
|||||||
import os
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import errno
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
EXPECTED_OUTPUT = "lists of files in version control and sdist match"
|
EXPECTED_OUTPUT = "lists of files in version control and sdist match"
|
||||||
|
|
||||||
|
|
||||||
def check_manifest():
|
def check_manifest():
|
||||||
os.chdir('..')
|
"""
|
||||||
|
Returns a tuple containing ``(output, status)``.
|
||||||
|
|
||||||
|
Status is:
|
||||||
|
``True`` if ``output`` was as expected (no errors),
|
||||||
|
``False`` otherwise.
|
||||||
|
"""
|
||||||
output = subprocess.check_output(["check-manifest"]).decode()
|
output = subprocess.check_output(["check-manifest"]).decode()
|
||||||
print(output)
|
|
||||||
if EXPECTED_OUTPUT == output.strip():
|
if EXPECTED_OUTPUT == output.strip():
|
||||||
return 1
|
status = True
|
||||||
else:
|
else:
|
||||||
sys.exit(2)
|
status = False
|
||||||
|
|
||||||
|
return (output, status)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
check_manifest()
|
output, verified = check_manifest()
|
||||||
|
|
||||||
|
if not verified:
|
||||||
|
print("Check-manifest didn't match.")
|
||||||
|
print("OUTPUT: {}".format(output))
|
||||||
|
print("EXPECTED_OUTPUT: {}".format(EXPECTED_OUTPUT))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("Manifest verified.")
|
||||||
|
sys.exit(0)
|
||||||
Reference in new issue
Block a user