Skip to content

Commit

Permalink
use the same LazyVersion hack as fancycompleter: this cuts down impor…
Browse files Browse the repository at this point in the history
…t time from ~0.7 to 0.05 seconds on my system
  • Loading branch information
antocuni authored and blueyed committed May 25, 2019
1 parent 39e9047 commit 489dc79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
17 changes: 4 additions & 13 deletions pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@

from __future__ import print_function

def get_version():
try:
import pkg_resources
dist = pkg_resources.get_distribution('pdbpp')
return dist.version
except Exception:
pass


__version__ = get_version()
__author__ = 'Antonio Cuni <anto.cuni@gmail.com>'
__url__ = 'http://github.com/antocuni/pdb'

import sys
import os.path
import inspect
Expand All @@ -34,6 +21,10 @@ def get_version():
from fancycompleter import Completer, ConfigurableClass, Color
import fancycompleter

__author__ = 'Antonio Cuni <anto.cuni@gmail.com>'
__url__ = 'http://github.com/antocuni/pdb'
__version__ = fancycompleter.LazyVersion('pdbpp')

try:
from inspect import signature # Python >= 3.3
except ImportError:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def run(self):


install_requires = [
"fancycompleter>=0.2",
"fancycompleter>=0.8",
"wmctrl",
"pygments",
]
Expand Down

0 comments on commit 489dc79

Please sign in to comment.