[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [nyx/master] Installing fails with 'error: option --single-version-externally-managed not recognized'



commit c9bddc096a4e60d4ffdc420af5a77d9a0031cc39
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Mon Nov 6 11:20:28 2017 -0800

    Installing fails with 'error: option --single-version-externally-managed not recognized'
    
    Damn that was a pita. Pip expects that cmdclasses are the setuptools version,
    and chokes in a confusing fashion when using distutils instead. See the comment
    for details.
---
 nyx.1           |  3 ++-
 nyx/__init__.py |  2 +-
 setup.py        | 24 ++++++++++++++++++++++++
 3 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/nyx.1 b/nyx.1
index d32e0ab..f779372 100644
--- a/nyx.1
+++ b/nyx.1
@@ -19,7 +19,8 @@ As a curses interface Nyx is particularly well suited for ssh connections, tty
 terminals, and command-line aficionados to check the status of tor.
 
 Nyx can be customized through a configuration file located at
-\fB~/.nyx/config\fR. For options see our \fBnyxrc.sample\fR.
+\fB~/.nyx/config\fR. For options see
+\fBhttps://nyx.torproject.org/#configuration\fR.
 
 .SH OPTIONS
 .TP
diff --git a/nyx/__init__.py b/nyx/__init__.py
index 65102b0..48dd767 100644
--- a/nyx/__init__.py
+++ b/nyx/__init__.py
@@ -89,7 +89,7 @@ except ImportError:
 
   sys.exit(1)
 
-__version__ = '2.0.1'
+__version__ = '2.0.2'
 __release_date__ = 'November 5, 2017'
 __author__ = 'Damian Johnson'
 __contact__ = 'atagar@xxxxxxxxxxxxxx'
diff --git a/setup.py b/setup.py
index dc3fb51..37923cc 100644
--- a/setup.py
+++ b/setup.py
@@ -82,15 +82,39 @@ class NyxInstaller(install):
   ... will cause that resource to be omitted.
   """
 
+  # We don't actually use single-version-externally-managed. Unfortunately pip
+  # has a bug where it expects any cmdclass to be setuptools, otherwise it
+  # fails with...
+  #
+  #   % sudo pip install nyx
+  #   ...
+  #   Installing collected packages: nyx
+  #    Running setup.py install for nyx ... error
+  #      Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-EOQT9b/nyx/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-PHiCsl-record/install-record.txt --single-version-externally-managed --compile:
+  #      usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
+  #         or: -c --help [cmd1 cmd2 ...]
+  #         or: -c --help-commands
+  #         or: -c cmd --help
+  #
+  #      error: option --single-version-externally-managed not recognized
+  #
+  # We have a few options to sidestep this...
+  #
+  #   * Have users install with 'sudo pip install --egg nyx' instead.
+  #   * Extend setuptools.command.install, which has the argument.
+  #   * Hack in a no-op argument to sidestep as we do here.
+
   user_options = install.user_options + [
     ('man-page=', None, 'man page location'),
     ('sample-path=', None, 'example nyxrc location'),
+    ('single-version-externally-managed', None, ''),  # needed to sidestep pip bug
   ]
 
   def initialize_options(self):
     install.initialize_options(self)
     self.man_page = None
     self.sample_path = None
+    self.single_version_externally_managed = None
 
   def run(self):
     install.run(self)

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits