Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to main concurrent package for the Python2 #56391

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions HACKING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ Check your file descriptor limit with::

ulimit -n

If it is less than 2047, you should increase it with::
If it is less than 3072, you should increase it with::

ulimit -n 2047
(or "limit descriptors 2047" for c-shell)
ulimit -n 3072
(or "limit descriptors 3072" for c-shell)


Running the tests
Expand Down
11 changes: 7 additions & 4 deletions salt/utils/thin.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,12 @@


if _six.PY2:
import concurrent
try:
from concurrent import futures
except ImportError:
futures = None
else:
concurrent = None
futures = None


log = logging.getLogger(__name__)
Expand Down Expand Up @@ -198,7 +201,7 @@ def get_tops_python(py_ver, exclude=None):
"msgpack",
"certifi",
"singledispatch",
"concurrent",
"futures",
"singledispatch_helpers",
"ssl_match_hostname",
"markupsafe",
Expand Down Expand Up @@ -340,7 +343,7 @@ def get_tops(extra_mods="", so_mods=""):
msgpack,
certifi,
singledispatch,
concurrent,
futures,
singledispatch_helpers,
ssl_match_hostname,
markupsafe,
Expand Down
20 changes: 10 additions & 10 deletions tests/unit/utils/test_thin.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ def test_get_ext_namespaces_failure(self):
type(str("backports_abc"), (), {"__file__": "/site-packages/backports_abc"}),
)
@patch(
"salt.utils.thin.concurrent",
type(str("concurrent"), (), {"__file__": "/site-packages/concurrent"}),
"salt.utils.thin.futures",
type(str("futures"), (), {"__file__": "/site-packages/futures"}),
)
@patch("salt.utils.thin.log", MagicMock())
def test_get_tops(self):
Expand All @@ -447,7 +447,7 @@ def test_get_tops(self):
"/site-packages/ssl_mh",
"/site-packages/markupsafe",
"/site-packages/backports_abc",
"/site-packages/concurrent",
"/site-packages/futures",
]

tops = thin.get_tops()
Expand Down Expand Up @@ -503,8 +503,8 @@ def test_get_tops(self):
type(str("backports_abc"), (), {"__file__": "/site-packages/backports_abc"}),
)
@patch(
"salt.utils.thin.concurrent",
type(str("concurrent"), (), {"__file__": "/site-packages/concurrent"}),
"salt.utils.thin.futures",
type(str("futures"), (), {"__file__": "/site-packages/futures"}),
)
@patch("salt.utils.thin.log", MagicMock())
def test_get_tops_extra_mods(self):
Expand All @@ -523,7 +523,7 @@ def test_get_tops_extra_mods(self):
"/site-packages/sdp",
"/site-packages/sdp_hlp",
"/site-packages/ssl_mh",
"/site-packages/concurrent",
"/site-packages/futures",
"/site-packages/markupsafe",
"/site-packages/backports_abc",
os.sep + os.path.join("custom", "foo"),
Expand Down Expand Up @@ -591,8 +591,8 @@ def test_get_tops_extra_mods(self):
type(str("backports_abc"), (), {"__file__": "/site-packages/backports_abc"}),
)
@patch(
"salt.utils.thin.concurrent",
type(str("concurrent"), (), {"__file__": "/site-packages/concurrent"}),
"salt.utils.thin.futures",
type(str("futures"), (), {"__file__": "/site-packages/futures"}),
)
@patch("salt.utils.thin.log", MagicMock())
def test_get_tops_so_mods(self):
Expand All @@ -611,7 +611,7 @@ def test_get_tops_so_mods(self):
"/site-packages/sdp",
"/site-packages/sdp_hlp",
"/site-packages/ssl_mh",
"/site-packages/concurrent",
"/site-packages/futures",
"/site-packages/markupsafe",
"/site-packages/backports_abc",
"/custom/foo.so",
Expand Down Expand Up @@ -1146,7 +1146,7 @@ def test_get_tops_python(self):
ret = thin.get_tops_python("python2.7")
assert ret == self.exp_ret
assert (
"ERROR:Could not auto detect file location for module concurrent for python version python2.7"
"ERROR:Could not auto detect file location for module futures for python version python2.7"
in log_handler.messages
)

Expand Down