Skip to content

Commit

Permalink
Fixed 'pip install --user catkin_tools' (#488)
Browse files Browse the repository at this point in the history
pip passes `--user --prefix=` when the user calls `pip install --user`,
which conflicted with the mutually_exclusive_group being used to parse
these arguments.

The mutually_exclusive_group is not necessary since pip prevents the
user from passing `--user` together with `--prefix` anyhow. By not
checking it here again, we can accept pip passing `--user --prefix=` to
us.
  • Loading branch information
racko authored and mikepurvis committed Mar 12, 2018
1 parent b859bbf commit 3ead0cb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ def run(self):
'catkin_tools-completion.bash')))

parser = argparse.ArgumentParser(add_help=False)
prefix_group = parser.add_mutually_exclusive_group()
prefix_group.add_argument('--user', '--home', action='store_true')
prefix_group.add_argument('--prefix', default=None)
parser.add_argument('--user', '--home', action='store_true')
parser.add_argument('--prefix', default=None)

opts, _ = parser.parse_known_args(sys.argv)
userbase = site.getuserbase() if opts.user else None
Expand Down

0 comments on commit 3ead0cb

Please # to comment.