|
10 | 10 | import os
|
11 | 11 |
|
12 | 12 | import requests
|
13 |
| -from invoke import Context, task |
14 | 13 | from invoke.exceptions import Failure
|
15 | 14 | from pathlib import Path
|
16 | 15 | import opencolorio_config_aces
|
|
25 | 24 | )
|
26 | 25 | from opencolorio_config_aces.utilities import google_sheet_title, message_box
|
27 | 26 |
|
| 27 | +import inspect |
| 28 | + |
| 29 | +if not hasattr(inspect, "getargspec"): |
| 30 | + inspect.getargspec = inspect.getfullargspec |
| 31 | + |
| 32 | +from invoke import Context, task |
| 33 | + |
28 | 34 | __author__ = "OpenColorIO Contributors"
|
29 | 35 | __copyright__ = "Copyright Contributors to the OpenColorIO Project."
|
30 | 36 | __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause"
|
|
86 | 92 | CONTAINER = PYPI_PACKAGE_NAME
|
87 | 93 |
|
88 | 94 |
|
89 |
| -def _patch_invoke_annotations_support(): |
90 |
| - """See https://github.com/pyinvoke/invoke/issues/357.""" |
91 |
| - |
92 |
| - import invoke |
93 |
| - from unittest.mock import patch |
94 |
| - from inspect import getfullargspec, ArgSpec |
95 |
| - |
96 |
| - def patched_inspect_getargspec(function): |
97 |
| - spec = getfullargspec(function) |
98 |
| - return ArgSpec(*spec[0:4]) |
99 |
| - |
100 |
| - org_task_argspec = invoke.tasks.Task.argspec |
101 |
| - |
102 |
| - def patched_task_argspec(*args, **kwargs): |
103 |
| - with patch( |
104 |
| - target="inspect.getargspec", new=patched_inspect_getargspec |
105 |
| - ): |
106 |
| - return org_task_argspec(*args, **kwargs) |
107 |
| - |
108 |
| - invoke.tasks.Task.argspec = patched_task_argspec |
109 |
| - |
110 |
| - |
111 |
| -_patch_invoke_annotations_support() |
112 |
| - |
113 |
| - |
114 | 95 | @task
|
115 | 96 | def clean(
|
116 | 97 | ctx: Context,
|
|
0 commit comments