You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running on a little imx6ul processor "import pkg_resources" can take 6 seconds or more. It looks like all it is doing is loading the version. I've patched it on my system to remove it, something you may want to consider.
Not an objection, just some considerations to keep in mind: semantics will be slightly different.
At runtime, version from pkg_resources will show the version of installed package, while version from a generated file will show the version of the package that is currently running. It may be different if you e.g. use an instance from the current directory. And in this case, generated file will show "more correct" information, but on the other hand, if you try to use an instance with not yet generated file, it may crash if import of this file is unconditional.
Activity
svinota commentedon Feb 19, 2020
Got it, thanks for the issue. I'll try to look what may be wrong there.
svinota commentedon Feb 19, 2020
Related:
svinota commentedon Feb 19, 2020
@ffourcot @celebdor
Looks like
pkg_resources
seriously affects startup time on platforms like ARM, and I can confirm that after tests.I'm going to drop
pkg_resources
and provide__version__
by something like generating__version__.py
file onmake dist
. Any objections?crosser commentedon Feb 19, 2020
Not an objection, just some considerations to keep in mind: semantics will be slightly different.
At runtime, version from pkg_resources will show the version of installed package, while version from a generated file will show the version of the package that is currently running. It may be different if you e.g. use an instance from the current directory. And in this case, generated file will show "more correct" information, but on the other hand, if you try to use an instance with not yet generated file, it may crash if import of this file is unconditional.
ffourcot commentedon Feb 20, 2020
Not an objection at all, we don't use it and we internally avoid usage of pkg_resources for the same reasons.
@celebdor was author of the commit adding pkg_resources, it's probably a good idea to check with him if this semantic change is ok for him.
celebdor commentedon Feb 20, 2020
Sounds good
general: generate version file on make dist
svinota commentedon Feb 20, 2020
So be it —
pkg_resources
import is dropped. The version file import is enveloped in try/except, should not fail on import errors.Update python-pyroute2 to rev 15 via SR 785076