From 42d41d6fe71caa81aca8c7293d2c136622068c60 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sat, 25 Feb 2012 01:06:52 +0100 Subject: [PATCH 1/6] Prepare for v0.8 development --- docs/changes.rst | 12 ++++++++++++ mopidy/__init__.py | 2 +- tests/version_test.py | 5 +++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/changes.rst b/docs/changes.rst index 65bd6b4b..4e5f5cb4 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -4,6 +4,18 @@ Changes This change log is used to track all major changes to Mopidy. +v0.8.0 (in development) +======================= + +**Important changes** + +- Nothing so far + +**Changes** + +- Nothing so far + + v0.7.0 (2012-02-25) =================== diff --git a/mopidy/__init__.py b/mopidy/__init__.py index b94378b2..f4167e3f 100644 --- a/mopidy/__init__.py +++ b/mopidy/__init__.py @@ -8,7 +8,7 @@ import os from subprocess import PIPE, Popen -VERSION = (0, 7, 0) +VERSION = (0, 8, 0) DATA_PATH = os.path.join(str(glib.get_user_data_dir()), 'mopidy') CACHE_PATH = os.path.join(str(glib.get_user_cache_dir()), 'mopidy') diff --git a/tests/version_test.py b/tests/version_test.py index dbaed0a2..a7fd82a4 100644 --- a/tests/version_test.py +++ b/tests/version_test.py @@ -24,8 +24,9 @@ class VersionTest(unittest.TestCase): self.assert_(SV('0.4.1') < SV('0.5.0')) self.assert_(SV('0.5.0') < SV('0.6.0')) self.assert_(SV('0.6.0') < SV('0.6.1')) - self.assert_(SV('0.6.1') < SV(get_plain_version())) - self.assert_(SV(get_plain_version()) < SV('0.7.1')) + self.assert_(SV('0.6.1') < SV('0.7.0')) + self.assert_(SV('0.7.0') < SV(get_plain_version())) + self.assert_(SV(get_plain_version()) < SV('0.8.1')) def test_get_platform_contains_platform(self): self.assert_(platform.platform() in get_platform()) From ee0c7c1af564465d441af583a1f627a258f4c00d Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sun, 4 Mar 2012 23:26:24 +0100 Subject: [PATCH 2/6] Add __version__ to mopidy module --- docs/changes.rst | 7 ++++--- docs/conf.py | 12 +++++++++--- mopidy/__init__.py | 11 ++++------- setup.py | 6 +++++- tests/version_test.py | 8 ++++---- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/docs/changes.rst b/docs/changes.rst index 4e5f5cb4..a6b7e361 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -4,8 +4,8 @@ Changes This change log is used to track all major changes to Mopidy. -v0.8.0 (in development) -======================= +v0.8 (in development) +===================== **Important changes** @@ -13,7 +13,8 @@ v0.8.0 (in development) **Changes** -- Nothing so far +- Change from version tuple at :attr:`mopidy.VERSION` to :pep:`386` compliant + version string at :attr:`mopidy.__version__` to conform to :pep:`396`. v0.7.0 (2012-02-25) diff --git a/docs/conf.py b/docs/conf.py index f8b4ffc3..a33a8f2d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,7 +11,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import os +import re +import sys class Mock(object): def __init__(self, *args, **kwargs): @@ -49,6 +51,11 @@ MOCK_MODULES = [ for mod_name in MOCK_MODULES: sys.modules[mod_name] = Mock() +def get_version(): + init_py = open('../mopidy/__init__.py').read() + metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_py)) + return metadata['version'] + # 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. @@ -87,8 +94,7 @@ copyright = u'2010-2012, Stein Magnus Jodal and contributors' # built documents. # # The full version, including alpha/beta/rc tags. -import mopidy -release = mopidy.get_version() +release = get_version() # The short X.Y version. version = '.'.join(release.split('.')[:2]) diff --git a/mopidy/__init__.py b/mopidy/__init__.py index f4167e3f..b2d9afa0 100644 --- a/mopidy/__init__.py +++ b/mopidy/__init__.py @@ -1,14 +1,14 @@ -import platform import sys if not (2, 6) <= sys.version_info < (3,): sys.exit(u'Mopidy requires Python >= 2.6, < 3') -import glib import os - +import platform from subprocess import PIPE, Popen -VERSION = (0, 8, 0) +import glib + +__version__ = '0.8' DATA_PATH = os.path.join(str(glib.get_user_data_dir()), 'mopidy') CACHE_PATH = os.path.join(str(glib.get_user_cache_dir()), 'mopidy') @@ -30,9 +30,6 @@ def get_git_version(): version = version[1:] return version -def get_plain_version(): - return '.'.join(map(str, VERSION)) - def get_platform(): return platform.platform() diff --git a/setup.py b/setup.py index a8cf8ed1..ae6cc699 100644 --- a/setup.py +++ b/setup.py @@ -6,9 +6,13 @@ from distutils.core import setup from distutils.command.install_data import install_data from distutils.command.install import INSTALL_SCHEMES import os +import re import sys -from mopidy import get_version +def get_version(): + init_py = open('mopidy/__init__.py').read() + metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_py)) + return metadata['version'] class osx_install_data(install_data): # On MacOS, the platform-specific lib dir is diff --git a/tests/version_test.py b/tests/version_test.py index a7fd82a4..86060693 100644 --- a/tests/version_test.py +++ b/tests/version_test.py @@ -1,14 +1,14 @@ from distutils.version import StrictVersion as SV import platform -from mopidy import get_plain_version, get_platform, get_python +from mopidy import __version__, get_platform, get_python from tests import unittest class VersionTest(unittest.TestCase): def test_current_version_is_parsable_as_a_strict_version_number(self): - SV(get_plain_version()) + SV(__version__) def test_versions_can_be_strictly_ordered(self): self.assert_(SV('0.1.0a0') < SV('0.1.0a1')) @@ -25,8 +25,8 @@ class VersionTest(unittest.TestCase): self.assert_(SV('0.5.0') < SV('0.6.0')) self.assert_(SV('0.6.0') < SV('0.6.1')) self.assert_(SV('0.6.1') < SV('0.7.0')) - self.assert_(SV('0.7.0') < SV(get_plain_version())) - self.assert_(SV(get_plain_version()) < SV('0.8.1')) + self.assert_(SV('0.7.0') < SV(__version__)) + self.assert_(SV(__version__) < SV('0.8.1')) def test_get_platform_contains_platform(self): self.assert_(platform.platform() in get_platform()) From 121ae0c2205ddc19ea0182b6e9d8fb04e8a6cb7c Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 6 Mar 2012 11:18:10 +0100 Subject: [PATCH 3/6] Fix use of nonexistant function --- mopidy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mopidy/__init__.py b/mopidy/__init__.py index b2d9afa0..e0bce88c 100644 --- a/mopidy/__init__.py +++ b/mopidy/__init__.py @@ -19,7 +19,7 @@ def get_version(): try: return get_git_version() except EnvironmentError: - return get_plain_version() + return __version__ def get_git_version(): process = Popen(['git', 'describe'], stdout=PIPE, stderr=PIPE) From a987f7e5c1a3f8983c0346fa80d6fb39cbe0d4bc Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Thu, 8 Mar 2012 09:52:55 +0100 Subject: [PATCH 4/6] It's 'Last.fm', not 'Last.FM' --- docs/installation/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/index.rst b/docs/installation/index.rst index 8e62421c..fae50a1b 100644 --- a/docs/installation/index.rst +++ b/docs/installation/index.rst @@ -37,7 +37,7 @@ dependencies installed. - For Spotify support, you need libspotify and pyspotify. See :doc:`libspotify`. - - To scrobble your played tracks to Last.FM, you need pylast:: + - To scrobble your played tracks to Last.fm, you need pylast:: sudo pip install -U pylast From aac7f738689400c5d1a30dfdebd9688f0eeeb4b2 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sun, 22 Apr 2012 01:41:12 +0200 Subject: [PATCH 5/6] Fix typo --- docs/changes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changes.rst b/docs/changes.rst index 93c0fdbc..fa316c4d 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -21,7 +21,7 @@ v0.8 (in development) v0.7.1 (2012-04-22) =================== -This is a maintenance release to make Mopidy 0.6 work with pyspotify >= 1.7. +This is a maintenance release to make Mopidy 0.7 work with pyspotify >= 1.7. **Changes** From 1f12951fa260049bc17e30edd0ab4967d085fb4b Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 7 May 2012 22:56:09 +0200 Subject: [PATCH 6/6] Prepare for maintenance release --- docs/changes.rst | 9 ++++----- mopidy/__init__.py | 2 +- tests/version_test.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/changes.rst b/docs/changes.rst index fa316c4d..84f5ffca 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -5,12 +5,11 @@ Changes This change log is used to track all major changes to Mopidy. -v0.8 (in development) -===================== +v0.7.2 (2012-05-07) +=================== -**Important changes** - -- Nothing so far +This is a maintenance release to make Mopidy 0.7 build on systems without all +of Mopidy's runtime dependencies, like Launchpad PPAs. **Changes** diff --git a/mopidy/__init__.py b/mopidy/__init__.py index e0bce88c..8a2b469e 100644 --- a/mopidy/__init__.py +++ b/mopidy/__init__.py @@ -8,7 +8,7 @@ from subprocess import PIPE, Popen import glib -__version__ = '0.8' +__version__ = '0.7.2' DATA_PATH = os.path.join(str(glib.get_user_data_dir()), 'mopidy') CACHE_PATH = os.path.join(str(glib.get_user_cache_dir()), 'mopidy') diff --git a/tests/version_test.py b/tests/version_test.py index f3ae3e0b..b1c0b90e 100644 --- a/tests/version_test.py +++ b/tests/version_test.py @@ -27,7 +27,7 @@ class VersionTest(unittest.TestCase): self.assert_(SV('0.6.1') < SV('0.7.0')) self.assert_(SV('0.7.0') < SV('0.7.1')) self.assert_(SV('0.7.1') < SV(__version__)) - self.assert_(SV(__version__) < SV('0.8.1')) + self.assert_(SV(__version__) < SV('0.8.0')) def test_get_platform_contains_platform(self): self.assert_(platform.platform() in get_platform())