Skip to content

Commit

Permalink
Python 3 compatibility: provide apply for ipython tasks
Browse files Browse the repository at this point in the history
Provides an apply function for ipython tasks, since this gets
used for unpacking tuples as part of calling and apply is not
available on py3k. Fixes #2741
  • Loading branch information
chapmanb committed Apr 4, 2019
1 parent 08fdf3b commit 48d38b1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.1.5 (in progress)

- Fixes for Python3 incompatibilities on distributed IPython runs.

## 1.1.4 (3 April 2019)

- Move to Python 3.6. A python2 environment in the install runs non python3
Expand Down
13 changes: 12 additions & 1 deletion bcbio/distributed/ipythontasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,18 @@ def wrapper(*args):
return ipython.zip_args(fn(*args))
return wrapper

@require(sample)
def apply(object, args=None, kwargs=None):
"""Python3 apply replacement for double unpacking of inputs during apply.
Thanks to: https://github.com/stefanholek/apply
"""
if args is None:
args = ()
if kwargs is None:
kwargs = {}
return object(*args, **kwargs)

require(sample)
def prepare_sample(*args):
args = ipython.unzip_args(args)
with _setup_logging(args) as config:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
from setuptools import setup, find_packages

version = "1.1.4"
version = "1.1.5a"

def write_version_py():
version_py = os.path.join(os.path.dirname(__file__), 'bcbio', 'pipeline',
Expand Down

0 comments on commit 48d38b1

Please sign in to comment.