-
Notifications
You must be signed in to change notification settings - Fork 14
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
ls: Use pyout #399
base: master
Are you sure you want to change the base?
ls: Use pyout #399
Conversation
Ls.__call__() returns a dictionary with results to ease testing. ls.py will start using pyout in the next commit. Once that happens, it makes sense to drop the custom result dictionary because the Tabular object already contains the same information and provides access to the values _after_ the asynchronous functions. But before we do that, convert the result dictionary to a structure that more closely matches the Tabular getitem interface so that we can switch to pyout *without* modifying the actual tests.
The length bit of test_no_heavy_imports fails. I'll take a look at what's being pulled in. |
Codecov Report
@@ Coverage Diff @@
## master #399 +/- ##
==========================================
- Coverage 89.82% 89.81% -0.02%
==========================================
Files 148 148
Lines 11658 11676 +18
==========================================
+ Hits 10472 10487 +15
- Misses 1186 1189 +3
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #399 +/- ##
==========================================
+ Coverage 89.82% 89.87% +0.04%
==========================================
Files 148 148
Lines 11658 11684 +26
==========================================
+ Hits 10472 10501 +29
+ Misses 1186 1183 -3
Continue to review full report at Codecov.
|
It was mostly what you'd expect by importing pyout at the top-level: diff of modules--- modules-master 2019-04-01 10:58:44.273588743 -0400
+++ modules-pr 2019-04-01 10:58:22.400929834 -0400
@@ -1,4 +1,5 @@
{'__future__',
+ '__mp_main__',
'_ast',
'_bisect',
'_bz2',
@@ -6,6 +7,7 @@
'_compat_pickle',
'_compression',
'_ctypes',
+ '_curses',
'_datetime',
'_functools',
'_hashlib',
@@ -24,6 +26,7 @@
'_virtualenv_distutils',
'appdirs',
'argparse',
+ 'array',
'ast',
'atexit',
'attr',
@@ -38,6 +41,7 @@
'base64',
'binascii',
'bisect',
+ 'blessings',
'bz2',
'calendar',
'collections',
@@ -49,6 +53,7 @@
'ctypes',
'ctypes._endian',
'ctypes.util',
+ 'curses',
'datetime',
'dis',
'distutils',
@@ -71,6 +76,7 @@
'email.quoprimime',
'email.utils',
'enum',
+ 'fcntl',
'fnmatch',
'functools',
'gc',
@@ -101,11 +107,24 @@
'logging.handlers',
'lzma',
'math',
+ 'multiprocessing',
+ 'multiprocessing.context',
+ 'multiprocessing.dummy',
+ 'multiprocessing.dummy.connection',
+ 'multiprocessing.process',
'opcode',
'operator',
'pickle',
'platform',
'pwd',
+ 'pyout',
+ 'pyout.common',
+ 'pyout.elements',
+ 'pyout.field',
+ 'pyout.interface',
+ 'pyout.summary',
+ 'pyout.tabular',
+ 'pyout.truncate',
'pytz',
'pytz.exceptions',
'pytz.lazy',
@@ -177,6 +196,7 @@
'shlex',
'shutil',
'signal',
+ 'six',
'socket',
'sre_compile',
'sre_constants', I've moved the pyout import to range-diff
|
The main benefit of using pyout here is that we can query statuses asynchronously, but it also allows us to style the output in more complex ways (automatic truncation, coloring by regexp, ...) with less custom code than we'd need otherwise. This switch to pyout should not change how we interpret or update the resource statuses, but the code for interacting with the resources is a little more complicated because, when --refresh is given, we access the resources in functions that are called asynchronously. And to update the resource statuses, we need to look at the values after the asynchronous calls have returned. Closes ReproNim#318.
Marking this as WIP because I consider the issue @yarikoptic raises in #400 to be a blocker. |
Closes #318.