From 1a02b4d17f072557cf7833970b77bc473e6b5494 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 16 Sep 2013 22:13:36 +0200 Subject: [PATCH] Remove support for running Python on the mopidy/ dir It doesn't make sense to run Mopidy without extensions registered, thus you'll need to use setuptools and to run `python setup.py develop` anyway. Doing so makes running `mopidy` from anywhere in the development virtualenv work, removing any need for running `python mopidy/`. --- mopidy/__main__.py | 6 ------ tests/help_test.py | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/mopidy/__main__.py b/mopidy/__main__.py index 0118395c..a55059a4 100644 --- a/mopidy/__main__.py +++ b/mopidy/__main__.py @@ -17,12 +17,6 @@ mopidy_args = sys.argv[1:] sys.argv[1:] = [] -# Add ../ to the path so we can run Mopidy from a Git checkout without -# installing it on the system. -sys.path.insert( - 0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))) - - from mopidy import commands, ext from mopidy.audio import Audio from mopidy import config as config_lib diff --git a/tests/help_test.py b/tests/help_test.py index 4f210031..574e4fd7 100644 --- a/tests/help_test.py +++ b/tests/help_test.py @@ -12,7 +12,10 @@ class HelpTest(unittest.TestCase): def test_help_has_mopidy_options(self): mopidy_dir = os.path.dirname(mopidy.__file__) args = [sys.executable, mopidy_dir, '--help'] - process = subprocess.Popen(args, stdout=subprocess.PIPE) + process = subprocess.Popen( + args, + env={'PYTHONPATH': os.path.join(mopidy_dir, '..')}, + stdout=subprocess.PIPE) output = process.communicate()[0] self.assertIn('--version', output) self.assertIn('--help', output)