Last active
September 26, 2017 00:24
-
-
Save dhermes/e7aa8cbf8c2f38eca0f899752c6022ca to your computer and use it in GitHub Desktop.
nox bug report (https://github.com/jonparrott/nox/issues/60)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def real_prefix(): | |
return getattr(sys, 'real_prefix', sys.prefix) | |
def main(): | |
# See: https://docs.python.org/3/library/platform.html#cross-platform | |
if sys.maxsize == 2**63 - 1: | |
print('Architecture: 64-bit') | |
elif sys.maxsize == 2**31 - 1: | |
print('Architecture: 32-bit') | |
else: | |
raise RuntimeError('Unexpected maxsize', sys.maxsize) | |
print(' Prefix: {}'.format(sys.prefix)) | |
print(' Real prefix: {}'.format(real_prefix())) | |
if __name__ == '__main__': | |
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import nox | |
IS_MAC_OS_X = sys.platform == 'darwin' | |
# See: https://docs.python.org/3/library/platform.html#cross-platform | |
if sys.maxsize == 2**63 - 1: | |
IS_64_BIT = True | |
elif sys.maxsize == 2**31 - 1: | |
IS_64_BIT = False | |
else: | |
raise RuntimeError('Unexpected maxsize', sys.maxsize) | |
@nox.session | |
@nox.parametrize('do_hack', [True, False]) | |
def check(session, do_hack): | |
session.interpreter = ( | |
'/Library/Frameworks/Python.framework/Versions/3.6/bin/python') | |
cmd = ('python', 'check.py') | |
if do_hack and IS_MAC_OS_X: | |
if IS_64_BIT: | |
cmd = ('arch', '-64') + cmd | |
else: | |
cmd = ('arch', '-32') + cmd | |
session.run(*cmd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment