Waf file creation will now require Python 3

This commit is contained in:
Thomas Nagy 2019-10-17 20:05:48 +02:00
parent fbee1a19d2
commit 1068ff98ec
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
6 changed files with 9 additions and 14 deletions

View File

@ -1,3 +1,7 @@
- Remove waflib.Runner.PriorityTasks.appendleft
- Remove waflib.Task.TaskBase
- Remove the upper class of waflib.Task.Task (metaclasses)
NEW IN WAF 2.0.19
-----------------
* Fix negative values for -j #2256

3
TODO
View File

@ -5,8 +5,5 @@ Waf 2.1
- Fix the circular imports ccroot<->c_config.py
- Remove superfluous *k in ctx.load() and other unused parameters
Ensure conf.load() has the same interface as ctx.load()
- Remove waflib.Runner.PriorityTasks.appendleft
- Remove waflib.Task.TaskBase
- Remove the upper class of waflib.Task.Task (metaclasses)
- Ordered_iter_dict in python 3.7
- Change _add_task to add_task in Runner.py

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# encoding: latin-1
# Thomas Nagy, 2005-2018
#

View File

@ -43,9 +43,6 @@ class PriorityTasks(object):
self.lst = []
def append(self, task):
heapq.heappush(self.lst, task)
def appendleft(self, task):
"Deprecated, do not use"
heapq.heappush(self.lst, task)
def pop(self):
return heapq.heappop(self.lst)
def extend(self, lst):

View File

@ -132,10 +132,7 @@ class store_task_type(type):
# be creative
getattr(cls, 'register', classes)[name] = cls
evil = store_task_type('evil', (object,), {})
"Base class provided to avoid writing a metaclass, so the code can run in python 2.6 and 3.x unmodified"
class Task(evil):
class Task(metaclass=store_task_type):
"""
Task objects represents actions to perform such as commands to execute by calling the `run` method.
@ -1350,9 +1347,6 @@ def deep_inputs(cls):
cls.sig_explicit_deps = sig_explicit_deps
return cls
TaskBase = Task
"Provided for compatibility reasons, TaskBase should not be used"
class TaskSemaphore(object):
"""
Task semaphores provide a simple and efficient way of throttling the amount of

View File

@ -62,3 +62,6 @@ def r4(code):
def r5(code):
return code.replace("('Execution failure: %s'%str(e),ex=e)", "('Execution failure: %s'%str(e),ex=e),None,sys.exc_info()[2]")
@subst('Task.py')
def r6(code):
return code.replace('metaclass=store_task_type', "store_task_type('evil', (object,), {})")