[ENH] Speed up first completion#399
Conversation
a411b33 to
0bbb60c
Compare
27b31c0 to
d5e5f7b
Compare
e8970c5 to
18a9101
Compare
|
During installation I encountered an error coming from if licence_ and license.file:
^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'file'. Did you mean: 'title'?It looks like the I believe a lower bound on required mesonpy would be needed, or change in More details:
|
1c3f07b to
d61b636
Compare
232dc63 to
c9a467c
Compare
|
Note that due to the additional log messages this breaks some tests which check ipython output. I'll address these if the performance gains here are sufficient to warrant this change. |
ff1cbc9 to
7a45d5b
Compare
cbce19a to
e81442d
Compare
This reverts commit ee751d3.
| "tomli; python_version<'3.11'", | ||
| "typing_extensions>=4.6; python_version<'3.12'", | ||
| 'prompt_toolkit', | ||
| 'epydoc', |
There was a problem hiding this comment.
Can you please let me know why epydoc was added as a direct dependency?
There was a problem hiding this comment.
It looks like it should be in test dependencies instead as it was in test_require before:
tests_require=['pexpect>=3.3', 'pytest', 'epydoc', 'rlipython', 'requests'],
Cc @peytondmurray in case if there was a reason.
This PR speeds up the first completion by
os.scandir,os.path.basename, andinspect.getmodulenameon every directory entry.<user cache dir>/pyflyby/. Any subsequent completions (including in other ipython sessions) check the mtime of the path, and look for a corresponding file in<user cache dir>/pyflyby/. If a valid cache file is found, module names used for completion are read from the file rather than from the filesystem. Otherwise, the cache is rebuilt.pyflyby.rebuild_import_cache.Other changes:
meson-python>=0.18.0etc/andlibexec/are now placed in<site-packages>/pyflybyinstead of polluting other parts of the filesystem.I also removed some unused python 2 compatibility stuff adjacent to the code I was working on - if it's better to leave this for another PR I'll revert it.
appdirsandprompt_toolkitare now dependencies ofpyflyby.Closes #571.