Skip to content

Commit

Permalink
Unbreak master (#6)
Browse files Browse the repository at this point in the history
Co-authored-by: Jim Turner <git@turner.link>
  • Loading branch information
Hugo Barrera and jturner314 committed May 30, 2021
1 parent e85b2bc commit 99c47e6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
language: python

python:
- 2.7
- pypy
- 3.3
- 3.4
- 3.6
- 3.7
- 3.8
- 3.9

install:
- pip install -U tox setuptools wheel $(python -V |& grep -q 'Python 3.2' && echo 'pip<8.0 virtualenv<14.0')
- pip install -U tox setuptools wheel
script: tox
2 changes: 1 addition & 1 deletion click_threading/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
except ImportError:
from futures import Future as _Future

__version__ = '0.4.4'
__version__ = '0.5.0'

_CTX_WORKER_KEY = __name__ + '.uiworker'

Expand Down
16 changes: 10 additions & 6 deletions click_threading/monkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@ def patch_ui_functions(wrapper):

new_f = wrapper(_copy_fn(f), info)

argspec = getargspec(f)
signature = inspect.formatargspec(*argspec) \
.lstrip('(') \
.rstrip(')')
args = ', '.join(arg.split('=')[0].split(':')[0].strip()
for arg in signature.split(','))
orig_sig_obj = inspect.signature(f)
sig_obj = orig_sig_obj.replace(
parameters=[
p.replace(annotation=inspect.Parameter.empty)
for p in orig_sig_obj.parameters.values()
],
return_annotation=inspect.Signature.empty,
)
signature = str(sig_obj).lstrip('(').rstrip(')')
args = ', '.join(p for p in sig_obj.parameters.keys())

stub_f = eval('lambda {s}: {n}._real_click_fn({a})'
.format(n=f.__name__, s=signature, a=args))
Expand Down
11 changes: 8 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
install_requires=[
'click>=5.0',
],
extras_require={
':python_version < "3.2"': 'futures'
}
python_requires=">=3.6",
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
passenv = LANG
deps =
pytest
git+https://github.com/mitsuhiko/click
click
commands = py.test

0 comments on commit 99c47e6

Please sign in to comment.