Merge lp:~exarkun/game/network-client-virtualenv-friendly into lp:game

Proposed by Jean-Paul Calderone
Status: Needs review
Proposed branch: lp:~exarkun/game/network-client-virtualenv-friendly
Merge into: lp:game
Diff against target: 8 lines (+1/-1)
1 file modified
bin/network-client (+1/-1)
To merge this branch: bzr merge lp:~exarkun/game/network-client-virtualenv-friendly
Reviewer Review Type Date Requested Status
Game Hackers Pending
Review via email: mp+238833@code.launchpad.net

Description of the change

This updates the client executable to be virtualenv-friendly (by looking up python in the environment instead of hard-coding /usr/bin/python).

I opted not to take this a step further and replace the script with a setuptools command line entrypoint because when I've worked with those elsewhere they've been rather annoying during develop against, since they require you install the package *and* they often require you to re-install the package any time the version changes (even if the command line entrypoint hasn't changed) - failing with a dumb exception when you forget to do this.

To post a comment you must log in.

Unmerged revisions

51. By Jean-Paul Calderone

Use /usr/bin/env to find python in the PATH.

This is preferred over hardcoding the typical location of /usr/bin/python because
it means the correct interpreter will be found when the script is installed in a
virtualenv (meaning the script will operate correctly in a virtualenv, whereas
previously it would not).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/network-client'
2--- bin/network-client 2011-01-28 04:13:59 +0000
3+++ bin/network-client 2014-10-19 19:58:24 +0000
4@@ -1,4 +1,4 @@
5-#!/usr/bin/python
6+#!/usr/bin/env python
7 import sys
8 from game.scripts.network_client import NetworkClient
9

Subscribers

People subscribed via source and target branches

to status/vote changes: