Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Move version out of init file. #55

Merged
merged 2 commits into from
May 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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', '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')
Copy link
Member

Choose a reason for hiding this comment

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

@rlaverde can you add a docstring here? Also, thank you for your help!

__version__ = '.'.join(map(str, VERSION_INFO))