swiftclient fails to install under tox with Python3

Bug #1326972 reported by Alex Gaynor
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Core Infrastructure
Fix Released
High
Monty Taylor
python-swiftclient
Invalid
Undecided
Unassigned

Bug Description

The traceback is:

$ tox -e py34
py34 create: /Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34
py34 installdeps: -r/Users/alex_gaynor/projects/openstack-swiftclient/requirements.txt, -r/Users/alex_gaynor/projects/openstack-swiftclient/test-requirements.txt
py34 develop-inst: /Users/alex_gaynor/projects/openstack-swiftclient
ERROR: invocation failed, logfile: /Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/log/py34-2.log
ERROR: actionid=py34
msg=developpkg
cmdargs=[local('/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/bin/pip'), 'install', '-U', '-e', '/Users/alex_gaynor/projects/openstack-swiftclient']
env={'PYTHONIOENCODING': 'utf_8', 'VERSIONER_PYTHON_PREFER_32_BIT': 'no', '__fish_bin_dir': '/usr/local/Cellar/fish/2.1.0/bin', 'LOGNAME': 'alex_gaynor', 'USER': 'alex_gaynor', 'HOME': '/Users/alex_gaynor', 'PATH': '/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/bin:/Users/alex_gaynor/.virtualenvs/openstack-swiftclient/bin:/Users/alex_gaynor/Library/Python/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin', 'DISPLAY': '/tmp/launch-7aoeyv/org.macosforge.xquartz:0', 'TERM_PROGRAM': 'iTerm.app', 'LANG': 'en_US.UTF-8', 'TERM': 'xterm-256color', 'Apple_PubSub_Socket_Render': '/tmp/launch-mqhTzR/Render', 'COLORFGBG': '7;0', 'VERSIONER_PYTHON_VERSION': '2.7', 'SHLVL': '1', 'SECURITYSESSIONID': '186a4', 'ITERM_SESSION_ID': 'w0t6p0', 'EDITOR': 'subl -w', 'SSH_AUTH_SOCK': '/tmp/launch-9Xiues/Listeners', 'VIRTUAL_ENV': '/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34', '__fish_sysconfdir': '/usr/local/Cellar/fish/2.1.0/etc/fish', 'SHELL': '/usr/local/bin/fish', 'ITERM_PROFILE': 'Default', 'TMPDIR': '/var/folders/fm/57qdjdrx6gzgcq1zlym0xwfc0000gn/T/', '__fish_datadir': '/usr/local/Cellar/fish/2.1.0/share/fish', '__CF_USER_TEXT_ENCODING': '0x1F5:0:0', 'PWD': '/Users/alex_gaynor/projects/openstack-swiftclient', '__CHECKFIX1436934': '1', '__fish_help_dir': '/usr/local/Cellar/fish/2.1.0/share/doc/fish', 'COMMAND_MODE': 'unix2003'}
Obtaining file:///Users/alex_gaynor/projects/openstack-swiftclient
  Running setup.py (path:/Users/alex_gaynor/projects/openstack-swiftclient/setup.py) egg_info for package from file:///Users/alex_gaynor/projects/openstack-swiftclient
    [pbr] Reusing existing SOURCES.txt
Requirement already up-to-date: requests>=1.1 in ./.tox/py34/lib/python3.4/site-packages (from python-swiftclient==2.1.0.9.g3d0de79)
Requirement already up-to-date: simplejson>=2.0.9 in ./.tox/py34/lib/python3.4/site-packages (from python-swiftclient==2.1.0.9.g3d0de79)
Requirement already up-to-date: six>=1.5.2 in ./.tox/py34/lib/python3.4/site-packages (from python-swiftclient==2.1.0.9.g3d0de79)
Installing collected packages: python-swiftclient
  Running setup.py develop for python-swiftclient
    [pbr] Reusing existing SOURCES.txt
    Creating /Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/lib/python3.4/site-packages/python-swiftclient.egg-link (link to .)
    Adding python-swiftclient 2.1.0.9.g3d0de79 to easy-install.pth file
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/alex_gaynor/projects/openstack-swiftclient/setup.py", line 22, in <module>
        pbr=True)
      File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/lib/python3.4/site-packages/setuptools/command/develop.py", line 29, in run
        self.install_for_development()
      File "/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/lib/python3.4/site-packages/setuptools/command/develop.py", line 131, in install_for_development
        self.process_distribution(None, self.dist, not self.no_deps)
      File "/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 659, in process_distribution
        self.install_egg_scripts(dist)
      File "/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/lib/python3.4/site-packages/setuptools/command/develop.py", line 168, in install_egg_scripts
        self.install_script(dist, script_name, script_text, script_path)
      File "/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 762, in install_script
        script_text = (get_script_header(script_text) +
      File "/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1555, in get_script_header
        first = (script_text+'\n').splitlines()[0]
    TypeError: can't concat bytes to str
    Complete output from command /Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/bin/python3.4 -c "import setuptools, tokenize; __file__='/Users/alex_gaynor/projects/openstack-swiftclient/setup.py'; exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" develop --no-deps:
    running develop

running egg_info

writing dependency_links to python_swiftclient.egg-info/dependency_links.txt

writing top-level names to python_swiftclient.egg-info/top_level.txt

writing requirements to python_swiftclient.egg-info/requires.txt

writing python_swiftclient.egg-info/PKG-INFO

[pbr] Reusing existing SOURCES.txt

running build_ext

Creating /Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/lib/python3.4/site-packages/python-swiftclient.egg-link (link to .)

Adding python-swiftclient 2.1.0.9.g3d0de79 to easy-install.pth file

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/Users/alex_gaynor/projects/openstack-swiftclient/setup.py", line 22, in <module>

    pbr=True)

  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/core.py", line 148, in setup

    dist.run_commands()

  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 955, in run_commands

    self.run_command(cmd)

  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 974, in run_command

    cmd_obj.run()

  File "/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/lib/python3.4/site-packages/setuptools/command/develop.py", line 29, in run

    self.install_for_development()

  File "/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/lib/python3.4/site-packages/setuptools/command/develop.py", line 131, in install_for_development

    self.process_distribution(None, self.dist, not self.no_deps)

  File "/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 659, in process_distribution

    self.install_egg_scripts(dist)

  File "/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/lib/python3.4/site-packages/setuptools/command/develop.py", line 168, in install_egg_scripts

    self.install_script(dist, script_name, script_text, script_path)

  File "/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 762, in install_script

    script_text = (get_script_header(script_text) +

  File "/Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1555, in get_script_header

    first = (script_text+'\n').splitlines()[0]

TypeError: can't concat bytes to str

----------------------------------------
Cleaning up...
Command /Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/bin/python3.4 -c "import setuptools, tokenize; __file__='/Users/alex_gaynor/projects/openstack-swiftclient/setup.py'; exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" develop --no-deps failed with error code 1 in /Users/alex_gaynor/projects/openstack-swiftclient
Storing debug log for failure in /Users/alex_gaynor/.pip/pip.log

__________________________________________________________ summary ___________________________________________________________
ERROR: py34: InvocationError: /Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/bin/pip install -U -e /Users/alex_gaynor/projects/openstack-swiftclient (see /Users/alex_gaynor/projects/openstack-swiftclient/.tox/py34/log/py34-2.log)

Revision history for this message
Jeremy Stanley (fungi) wrote :

Extensive bisection whittled this down to being reproducible with:

    git clone git://git.openstack.org/openstack/python-swiftclient.git
    cd python-swiftclient
    virtualenv -p python3.3 foo
    ./foo/bin/pip install -U -r requirements.txt setuptools==4.0.1
    . foo/bin/activate
    python setup.py develop

Note however that with setuptools 3.8 and earlier this does not break. Cursory testing suggests the behavior demonstrated here started with the setuptools 4.0 release.

Revision history for this message
Alex Gaynor (alex-gaynor) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-swiftclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/99624

Revision history for this message
Jeremy Stanley (fungi) wrote :

Since the "fix" for this was the removal of all setuptools 4.x versions from pypi.python.org, we probably need to *either* also delete them from our pypi.openstack.org mirror *or* blacklist the affected setuptools versions in openstack/requirements global-requirements.txt.

Changed in openstack-ci:
status: New → Triaged
importance: Undecided → High
milestone: none → juno
Revision history for this message
Clark Boylan (cboylan) wrote :

Mordred removed setuptools 4.x from our pypi mirror. This fixes the infra side of the problem.

Changed in openstack-ci:
status: Triaged → Fix Released
assignee: nobody → Monty Taylor (mordred)
Revision history for this message
Monty Taylor (mordred) wrote :

You'd think that would have fixed it - but it turns out that there is a bug in the upstream bug fix.

Bug:

https://bitbucket.org/pypa/setuptools/issue/220/script-tmpl-files-missing-in-501

Pull request:

https://bitbucket.org/pypa/setuptools/pull-request/63/include-the-script-template-files-fixes

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-swiftclient (master)

Change abandoned by Alistair Coles (<email address hidden>) on branch: master
Review: https://review.openstack.org/99624
Reason: looks like issue got fixed in setuptools 5.0.1

Revision history for this message
Tim Burke (1-tim-z) wrote :

Bug seems to have been in setuptools. Closing for python-swiftclient.

Changed in python-swiftclient:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.