summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-11-15 17:57:23 +0100
committerAnthon van der Neut <anthon@mnt.org>2018-11-15 17:57:23 +0100
commitd04c3b66d442bf9b727fd5201862014990f63cb4 (patch)
tree9330abe9c92eb4df95d45c35bb368ed28edc1696 /setup.py
parentbfe6cf135848a89b38286fec53d091e6402ef7c0 (diff)
downloadruamel.yaml-d04c3b66d442bf9b727fd5201862014990f63cb4.tar.gz
fix issue #261 Str, Num, Bytes, NameConstant moved from _ast to ast in 3.80.15.78
*When this change indeed resolves your problem, please **Close** this issue*. *(You can do so using the WorkFlow pull-down (close to the top right of this page))*
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py36
1 files changed, 31 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index 857b5e2..e75711c 100644
--- a/setup.py
+++ b/setup.py
@@ -44,6 +44,10 @@ if sys.version_info < (3, 4):
class NameConstant:
pass
+if sys.version_info >= (3, 8):
+
+ from ast import Str, Num, Bytes, NameConstant # NOQA
+
if sys.version_info < (3,):
open_kw = dict()
@@ -830,7 +834,7 @@ class NameSpacePackager(object):
sources=[self.pn(x) for x in target['src']],
libraries=[self.pn(x) for x in target.get('lib')],
)
- # debug('test in target', 'test' in target, target)
+ # debug('test1 in target', 'test' in target, target)
if 'test' not in target: # no test, just hope it works
self._ext_modules.append(ext)
continue
@@ -871,8 +875,8 @@ class NameSpacePackager(object):
print('compile error:', file_name)
continue
except LinkError:
- debug('libyaml link error', file_name)
- print('libyaml link error', file_name)
+ debug('link error', file_name)
+ print('link error', file_name)
continue
self._ext_modules.append(ext)
except Exception as e: # NOQA
@@ -893,10 +897,10 @@ class NameSpacePackager(object):
https://bitbucket.org/pypa/wheel/issues/47
"""
if 'bdist_wheel' not in sys.argv:
- return
+ return False
file_name = 'setup.cfg'
if os.path.exists(file_name): # add it if not in there?
- return
+ return False
with open(file_name, 'w') as fp:
if os.path.exists('LICENSE'):
fp.write('[metadata]\nlicense-file = LICENSE\n')
@@ -964,6 +968,8 @@ def main():
for k in sorted(kw):
v = kw[k]
print(' "{0}": "{1}",'.format(k, v))
+ # if '--record' in sys.argv:
+ # return
if dump_kw in sys.argv:
sys.argv.remove(dump_kw)
try:
@@ -971,7 +977,26 @@ def main():
kw['long_description'] = fp.read()
except Exception:
pass
+
if nsp.wheel(kw, setup):
+ if nsp.nested and 'bdist_wheel' in sys.argv:
+ try:
+ d = sys.argv[sys.argv.index('-d') + 1]
+ except ValueError:
+ dist_base = os.environ.get('PYDISTBASE')
+ if dist_base:
+ d = os.path.join(dist_base, nsp.full_package_name)
+ else:
+ d = 'dist'
+ for x in os.listdir(d):
+ dashed_vs = '-' + version_str + '-'
+ if x.endswith('.whl') and dashed_vs in x:
+ # remove .pth file from the wheel
+ full_name = os.path.join(d, x)
+ print('patching .pth from', full_name)
+ with InMemoryZipFile(full_name) as imz:
+ imz.delete_from_zip_file(nsp.full_package_name + '.*.pth')
+ break
return
for x in ['-c', 'egg_info', '--egg-base', 'pip-egg-info']:
if x not in sys.argv:
@@ -1002,6 +1027,7 @@ def main():
if x.endswith('.whl'):
# remove .pth file from the wheel
full_name = os.path.join(d, x)
+ print('patching .pth from', full_name)
with InMemoryZipFile(full_name) as imz:
imz.delete_from_zip_file(nsp.full_package_name + '.*.pth')
break