Repository: celery/celery

Issue:
dependency on future module breaks many things (including vim ultisnips)
the dependency on future-0.18.2 adds many packages that squat on py3 stdlib names eg:

```
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/_dummy_thread/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/_markupbase/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/_thread/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/builtins/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/copyreg/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/future-0.18.2.dist-info/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/future/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/html/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/http/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/libfuturize/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/libpasteurize/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/past/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/queue/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/reprlib/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/socketserver/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/tkinter/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/winreg/*
    /home/graingert/.virtualenvs/celery2/lib/python2.7/site-packages/xmlrpc/*
```

this breaks packages that rely on feature detection of these modules.

I propose replacing future with six because:

* future does not provide a wheel, six has a wheel
* future last release Oct 31, 2019, six released Oct 31, 2019
* future is 829.2 kB, six is (11.0 kB) 
* celery already depends on six, via kombu and importlib-metadata, and so swapping out future with six would save 829.2 kB, rather than just 818.2 kB

<!--
Please fill this template entirely and do not erase parts of it.
We reserve the right to close without a response
bug reports which are incomplete.
-->
# Checklist
<!--
To check an item on the list replace [ ] with [x].
-->
- [x] I have verified that the issue exists against the `master` branch of Celery.
- [ ] This has already been asked to the [discussion group](https://groups.google.com/forum/#!forum/celery-users) first.
- [x] I have read the relevant section in the
  [contribution guide](http://docs.celeryproject.org/en/latest/contributing.html#other-bugs)
  on reporting bugs.
- [x] I have checked the [issues list](https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22)
  for similar or identical bug reports.
- [ ] I have checked the [pull requests list](https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22)
  for existing proposed fixes.
- [ ] I have checked the [commit log](https://github.com/celery/celery/commits/master)
  to find out if the bug was already fixed in the master branch.
- [ ] I have included all related issues and possible duplicate issues
  in this issue (If there are none, check this box anyway).

## Mandatory Debugging Information

- [ ] I have included the output of ``celery -A proj report`` in the issue.
    (if you are not able to do this, then at least specify the Celery
     version affected).
- [x] I have verified that the issue exists against the `master` branch of Celery.
- [ ] I have included the contents of ``pip freeze`` in the issue.
- [ ] I have included all the versions of all the external dependencies required
  to reproduce this bug.

## Optional Debugging Information
<!--
Try some of the below if you think they are relevant.
It will help us figure out the scope of the bug and how many users it affects.
-->
- [ ] I have tried reproducing the issue on more than one Python version
  and/or implementation.
- [ ] I have tried reproducing the issue on more than one message broker and/or
  result backend.
- [ ] I have tried reproducing the issue on more than one version of the message
  broker and/or result backend.
- [ ] I have tried reproducing the issue on more than one operating system.
- [ ] I have tried reproducing the issue on more than one workers pool.
- [ ] I have tried reproducing the issue with autoscaling, retries,
  ETA/Countdown & rate limits disabled.
- [ ] I have tried reproducing the issue after downgrading
  and/or upgrading Celery and its dependencies.

## Related Issues and Possible Duplicates
<!--
Please make sure to search and mention any related issues
or possible duplicates to this issue as requested by the checklist above.

This may or may not include issues in other repositories that the Celery project
maintains or other repositories that are dependencies of Celery.

If you don't know how to mention issues, please refer to Github's documentation
on the subject: https://help.github.com/en/articles/autolinked-references-and-urls#issues-and-pull-requests
-->

#### Related Issues

- None

#### Possible Duplicates

- None

## Environment & Settings
<!-- Include the contents of celery --version below -->
**Celery version**:
<!-- Include the output of celery -A proj report below -->
<details>
<summary><b><code>celery report</code> Output:</b></summary>
<p>

```
```

</p>
</details>

# Steps to Reproduce

## Required Dependencies
<!-- Please fill the required dependencies to reproduce this issue -->
* **Minimal Python Version**: N/A or Unknown
* **Minimal Celery Version**: N/A or Unknown
* **Minimal Kombu Version**: N/A or Unknown
* **Minimal Broker Version**: N/A or Unknown
* **Minimal Result Backend Version**: N/A or Unknown
* **Minimal OS and/or Kernel Version**: N/A or Unknown
* **Minimal Broker Client Version**: N/A or Unknown
* **Minimal Result Backend Client Version**: N/A or Unknown

### Python Packages
<!-- Please fill the contents of pip freeze below -->
<details>
<summary><b><code>pip freeze</code> Output:</b></summary>
<p>

```
```

</p>
</details>

### Other Dependencies
<!--
Please provide system dependencies, configuration files
and other dependency information if applicable
-->
<details>
<p>
N/A
</p>
</details>

## Minimally Reproducible Test Case
<!--
Please provide a reproducible test case.
Refer to the Reporting Bugs section in our contribution guide.

We prefer submitting test cases in the form of a PR to our integration test suite.
If you can provide one, please mention the PR number below.
If not, please attach the most minimal code example required to reproduce the issue below.
If the test case is too large, please include a link to a gist or a repository below.
-->

<details>
<p>

```python
```

</p>
</details>

# Expected Behavior
<!-- Describe in detail what you expect to happen -->

# Actual Behavior
<!--
Describe in detail what actually happened.
Please include a backtrace and surround it with triple backticks (```).
In addition, include the Celery daemon logs, the broker logs,
the result backend logs and system logs below if they will help us debug
the issue.
-->



Discussion:

Resolving patch:
diff --git a/celery/backends/base.py b/celery/backends/base.py
--- a/celery/backends/base.py
+++ b/celery/backends/base.py
@@ -7,7 +7,6 @@
     using K/V semantics like _get and _put.
 """
 from __future__ import absolute_import, unicode_literals
-from future.utils import raise_with_traceback
 
 from datetime import datetime, timedelta
 import sys
@@ -29,7 +28,7 @@
 from celery.exceptions import (ChordError, ImproperlyConfigured,
                                NotRegistered, TaskRevokedError, TimeoutError,
                                BackendGetMetaError, BackendStoreError)
-from celery.five import PY3, items
+from celery.five import PY3, items, reraise
 from celery.result import (GroupResult, ResultBase, ResultSet,
                            allow_join_result, result_from_tuple)
 from celery.utils.collections import BufferMap
@@ -454,7 +453,11 @@ def store_result(self, task_id, result, state,
                             self.max_sleep_between_retries_ms, True) / 1000
                         self._sleep(sleep_amount)
                     else:
-                        raise_with_traceback(BackendStoreError("failed to store result on the backend", task_id=task_id, state=state))
+                        reraise(
+                            BackendStoreError,
+                            BackendStoreError("failed to store result on the backend", task_id=task_id, state=state),
+                            traceback,
+                        )
                 else:
                     raise
 
@@ -521,6 +524,7 @@ def get_task_meta(self, task_id, cache=True):
                 meta = self._get_task_meta_for(task_id)
                 break
             except Exception as exc:
+                tb = sys.exc_info()[2]
                 if self.always_retry and self.exception_safe_to_retry(exc):
                     if retries < self.max_retries:
                         retries += 1
@@ -532,7 +536,11 @@ def get_task_meta(self, task_id, cache=True):
                             self.max_sleep_between_retries_ms, True) / 1000
                         self._sleep(sleep_amount)
                     else:
-                        raise_with_traceback(BackendGetMetaError("failed to get meta", task_id=task_id))
+                        reraise(
+                            BackendGetMetaError,
+                            BackendGetMetaError("failed to get meta", task_id=task_id),
+                            tb,
+                        )
                 else:
                     raise
 


Test patch: