Skip to content

Commit

Permalink
Merge pull request #55 from rlaverde/version-out-init
Browse files Browse the repository at this point in the history
PR: Move version out of init file.
  • Loading branch information
ccordoba12 authored May 5, 2017
2 parents 1658181 + 42a5fe2 commit 82a9cd6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
23 changes: 21 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,34 @@
Jupyter notebook integration with Spyder.
"""

# Standard library imports
import ast
import os

# Third party imports
from setuptools import find_packages, setup
from spyder_notebook import __version__

HERE = os.path.abspath(os.path.dirname(__file__))


def get_version(module='spyder_notebook'):
"""Get version."""
with open(os.path.join(HERE, module, '_version.py'), 'r') as f:
data = f.read()
lines = data.split('\n')
for line in lines:
if line.startswith('VERSION_INFO'):
version_tuple = ast.literal_eval(line.split('=')[-1].strip())
version = '.'.join(map(str, version_tuple))
break
return version


REQUIREMENTS = ['spyder>=3.1.4', 'notebook>=4.3']

setup(
name='spyder-notebook',
version=__version__,
version=get_version(),
keywords='spyder jupyter notebook',
url='https://github.com/spyder-ide/spyder-notebook',
license='MIT',
Expand Down
4 changes: 1 addition & 3 deletions spyder_notebook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

# Local imports
from spyder_notebook.notebookplugin import NotebookPlugin as PLUGIN_CLASS

VERSION_INFO = (0, 1, 0, 'dev0')
__version__ = '.'.join(map(str, VERSION_INFO))
from spyder_notebook._version import __version__

PLUGIN_CLASS
3 changes: 3 additions & 0 deletions spyder_notebook/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Version File."""
VERSION_INFO = (0, 1, 0, 'dev0')
__version__ = '.'.join(map(str, VERSION_INFO))

0 comments on commit 82a9cd6

Please sign in to comment.