summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2021-03-05 10:37:18 +0100
committerAnthon van der Neut <anthon@mnt.org>2021-03-05 10:37:18 +0100
commit59a2fff10a8a1f41eee55a43f48ad20539c69e75 (patch)
treeda0e987303b88219b643423938ded87a258f6869 /setup.py
parent3b3bc4e217719b84dd27b04a4a644e5f39a0eb8e (diff)
downloadruamel.yaml-59a2fff10a8a1f41eee55a43f48ad20539c69e75.tar.gz
last release supporting 2.70.16.13
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/setup.py b/setup.py
index 40aba3a..9ec5bcb 100644
--- a/setup.py
+++ b/setup.py
@@ -323,17 +323,17 @@ class NameSpacePackager(object):
self.command = None
self.python_version()
self._pkg = [None, None] # required and pre-installable packages
- if (
- sys.argv[0] == 'setup.py'
- and sys.argv[1] == 'install'
- and '--single-version-externally-managed' not in sys.argv
- ):
- if os.environ.get('READTHEDOCS', None) == 'True':
- os.system('pip install .')
- sys.exit(0)
- if not os.environ.get('RUAMEL_NO_PIP_INSTALL_CHECK', False):
- print('error: you have to install with "pip install ."')
- sys.exit(1)
+ if sys.argv[0] == 'setup.py' and sys.argv[1] == 'install':
+ debug('calling setup.py', sys.argv)
+ if '-h' in sys.argv:
+ pass
+ elif '--single-version-externally-managed' not in sys.argv:
+ if os.environ.get('READTHEDOCS', None) == 'True':
+ os.system('pip install .')
+ sys.exit(0)
+ if not os.environ.get('RUAMEL_NO_PIP_INSTALL_CHECK', False):
+ print('error: you have to install with "pip install ."')
+ sys.exit(1)
# If you only support an extension module on Linux, Windows thinks it
# is pure. That way you would get pure python .whl files that take
# precedence for downloading on Linux over source with compilable C code
@@ -799,8 +799,8 @@ class NameSpacePackager(object):
try:
tmp_dir = tempfile.mkdtemp(prefix='tmp_ruamel_')
bin_file_name = 'test' + self.pn(target['name'])
- print('test compiling', bin_file_name)
file_name = os.path.join(tmp_dir, bin_file_name + '.c')
+ print('test compiling', file_name, '->', bin_file_name, end=' ')
with open(file_name, 'w') as fp: # write source
fp.write(c_code)
# and try to compile it
@@ -824,15 +824,17 @@ class NameSpacePackager(object):
except CompileError:
debug('compile error:', file_name)
print('compile error:', file_name)
- continue
+ raise
except LinkError:
debug('link error', file_name)
print('link error', file_name)
- continue
+ raise
+ print('OK')
self._ext_modules.append(ext)
except Exception as e: # NOQA
debug('Exception:', e)
print('Exception:', e)
+ sys.exit(1)
if sys.version_info[:2] == (3, 4) and platform.system() == 'Windows':
traceback.print_exc()
finally: