Skip to content

Commit

Permalink
Hardcode version number. Fix #1138
Browse files Browse the repository at this point in the history
  • Loading branch information
tmylk authored Mar 5, 2017
1 parent 6b082e0 commit 51bb15b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions gensim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
from gensim import parsing, matutils, interfaces, corpora, models, similarities, summarization
import logging

try:
__version__ = __import__('pkg_resources').get_distribution('gensim').version
except:
__version__ = '?'

__version__ = '1.0.1'

class NullHandler(logging.Handler):
"""For python versions <= 2.6; same as `logging.NullHandler` in 2.7."""
Expand All @@ -19,4 +15,4 @@ def emit(self, record):

logger = logging.getLogger('gensim')
if len(logger.handlers) == 0: # To ensure reload() doesn't add another one
logger.addHandler(NullHandler())
logger.addHandler(NullHandler())

3 comments on commit 51bb15b

@dhwajraj
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even the gensim release 2.0.0 shows the module version as 1.0.1 ... why this change?

@tmylk
Copy link
Contributor Author

@tmylk tmylk commented on 51bb15b May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the spot! Fixed.

@piskvorky
Copy link
Owner

@piskvorky piskvorky commented on 51bb15b May 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm -1 on this change. #1138 describes some use case where the user is using a not-installed gensim, importing it from the current directory instead.

That is not a use case we support (and will lead to other problems, such as not compiled C extensions).

Extracting the version from a properly installed package seems preferable. The fact that it's easier to maintain as well (as demonstrated here) is just a bonus.

Please sign in to comment.