Skip to content

depends_on(python) broken on python3 #4051

@junghans

Description

@junghans

When working on #4052 using python3, I get:

$ spack install -v flecsale~mpi
==> cmake is already installed in /home/christoph/spack/opt/spack/linux-gentoo2-x86_64/gcc-5.4.0/cmake-3.8.0-mxszhy7n2aao2rejkicyhm2ldauubp4v
==> openssl is already installed in /home/christoph/spack/opt/spack/linux-gentoo2-x86_64/gcc-5.4.0/openssl-1.0.2k-uttx77sulhg24jo6eicwifq53zawszhu
==> flecsi is already installed in /home/christoph/spack/opt/spack/linux-gentoo2-x86_64/gcc-5.4.0/flecsi-develop-6b7as7rgqm2ebvpth3ys3dh4p4r7dkfc
==> python is already installed in /home/christoph/spack/opt/spack/linux-gentoo2-x86_64/gcc-5.4.0/python-2.7.13-3zqpzkmzcthq24sqm36rl4yaxovuwic6
==> Installing flecsale
==> Error: AttributeError: 'dict' object has no attribute 'iteritems'
/home/christoph/spack/var/spack/repos/builtin/packages/python/package.py:393, in setup_dependent_package:
     375      def setup_dependent_package(self, module, dependent_spec):
     376          """Called before python modules' install() methods.
     377  
     378          In most cases, extensions will only need to have one line::
     379  
     380          setup_py('install', '--prefix={0}'.format(prefix))"""
     381          python_path = join_path(
     382              self.spec.prefix.bin,
     383              'python{0}'.format('3' if self.spec.satisfies('@3') else '')
     384          )
     385  
     386          module.python_exe = python_path
     387          module.python = Executable(python_path)
     388          module.setup_py = Executable(python_path + ' setup.py --no-user-cfg')
     389  
     390          distutil_vars = self._load_distutil_vars()
     391  
     392          if distutil_vars:
  >> 393              for key, value in distutil_vars.iteritems():
     394                  module.setup_py.add_default_env(key, value)
     395  
     396          # Add variables for lib/pythonX.Y and lib/pythonX.Y/site-packages dirs.
     397          module.python_lib_dir = join_path(dependent_spec.prefix,
     398                                            self.python_lib_dir)
     399          module.python_include_dir = join_path(dependent_spec.prefix,
     400                                                self.python_include_dir)
     401          module.site_packages_dir = join_path(dependent_spec.prefix,
     402                                               self.site_packages_dir)
     403  
     404          # Make the site packages directory for extensions
     405          if dependent_spec.package.is_extension:
     406              mkdirp(module.site_packages_dir)

while on python2.7 it works as expected.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions