Skip to content

Commit

Permalink
Merge pull request #153 from maciejkula/simplify_version_number
Browse files Browse the repository at this point in the history
Centralize the version number.
  • Loading branch information
maciejkula committed Jan 27, 2017
2 parents facadc9 + 9321eee commit 8964566
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
6 changes: 4 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import sys
import os

import lightfm

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand Down Expand Up @@ -59,9 +61,9 @@
# built documents.
#
# The short X.Y version.
version = u'1.11'
version = lightfm.__version__
# The full version, including alpha/beta/rc tags.
release = u'1.11'
release = lightfm.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
5 changes: 4 additions & 1 deletion lightfm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from .lightfm import LightFM
try:
__LIGHTFM_SETUP__
except NameError:
from .lightfm import LightFM

__version__ = '1.11'

Expand Down
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
from setuptools import Command, Extension, setup
from setuptools.command.test import test as TestCommand

# Import version even when extensions are not yet built
__builtins__.__LIGHTFM_SETUP__ = True
from lightfm import __version__ as version # NOQA


def define_extensions(use_openmp):

Expand Down Expand Up @@ -143,10 +147,10 @@ def run_tests(self):

setup(
name='lightfm',
version='1.11',
version=version,
description='LightFM recommendation model',
url='https://github.com/lyst/lightfm',
download_url='https://github.com/lyst/lightfm/tarball/1.11',
download_url='https://github.com/lyst/lightfm/tarball/{}'.format(version),
packages=['lightfm',
'lightfm.datasets'],
package_data={'': ['*.c']},
Expand Down

0 comments on commit 8964566

Please sign in to comment.