-
Notifications
You must be signed in to change notification settings - Fork 57
[ENH] Speed up first completion #399
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
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please let me know why epydoc was added as a direct dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.getmodulename
on 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.0
etc/
andlibexec/
are now placed in<site-packages>/pyflyby
instead 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.
appdirs
andprompt_toolkit
are now dependencies ofpyflyby
.Closes #571.