setuptools_scm: build failure with setuptools_scm 6.0.1

we are using django-haystack, which is using setuptools_scm as dependency, with today’s release of 6.0.1, we are running into syntax error from utils.py

/tmp/easy_install-ud6TLb/setuptools_scm-6.0.1/src
    <pkg_resources.WorkingSet object at 0x7fdf8c2ba4d0>
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-Ia66L1/django-haystack/setup.py", line 69, in <module>
        setup_requires=['setuptools_scm'],
      File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 142, in setup
        _install_setup_requires(attrs)
      File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 137, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 586, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 780, in resolve
        replace_conflicting=replace_conflicting
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1063, in best_match
        return self.obtain(req, installer)
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1075, in obtain
        return installer(requirement)
      File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 653, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 679, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 890, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1158, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
        raise
      File "/usr/local/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/local/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-ud6TLb/setuptools_scm-6.0.1/setup.py", line 52, in <module>
        },
      File "/tmp/easy_install-ud6TLb/setuptools_scm-6.0.1/setup.py", line 29, in scm_config
        ]
      File "/tmp/easy_install-ud6TLb/setuptools_scm-6.0.1/src/setuptools_scm/__init__.py", line 8, in <module>
      File "/tmp/easy_install-ud6TLb/setuptools_scm-6.0.1/src/setuptools_scm/config.py", line 6, in <module>
      File "/tmp/easy_install-ud6TLb/setuptools_scm-6.0.1/src/setuptools_scm/utils.py", line 41
        print(*k)
              ^
    SyntaxError: invalid syntax

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 8
  • Comments: 17 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Even doing a pip install of setuptools_scm to an earlier version doesn’t solve the issue. @piyush-gommt

Running pip install setuptools-scm==5.0.2 worked for me

python2 support and support for setuptools that builds eggs was dropped, i’ll add a better error but python2 is not coming back, please pin

We are hitting this same issue during pip install of pytest-xdist==1.15.0 using python 3.4.0. We are using pip 10.0.0 and setuptools 39.0.0. Are those versions too old? We have setuptools_scm==1.15.5 in our same requirements file, so that’s the version we expect it to be using, but instead the installation of pytest-xdist==1.15.0 is trying to use setuptools_scm 6.0.1.

You might check that your index server supports PEP 508.

Pip 9.x supports PEP 508. Here’s a demo of it pulling a compatible version from PyPI:

~ $ python2.7 -m pip-run 'pip<10' -- -m pip-run setuptools_scm -- -c pass
Collecting pip<10
  Using cached pip-9.0.3-py2.py3-none-any.whl (1.4 MB)
Installing collected packages: pip
Successfully installed pip-9.0.3
ERROR: pip's legacy dependency resolver does not consider dependency conflicts when selecting packages. This behaviour is the source of the following dependency conflicts.
pip-run 6.2.0 requires pip>=19.3, but you'll have pip 9.0.3 which is incompatible.
Collecting setuptools_scm
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/6a/18/23ad8654c5c8d91d1238b2d52882e50152473f2bd2db0da60215b51f401b/setuptools_scm-5.0.2-py2.py3-none-any.whl
Collecting setuptools (from setuptools_scm)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/e1/b7/182161210a13158cd3ccc41ee19aadef54496b74f2817cc147006ec932b4/setuptools-44.1.1-py2.py3-none-any.whl (583kB)
    100% |████████████████████████████████| 583kB 2.2MB/s 
Installing collected packages: setuptools, setuptools-scm
Successfully installed setuptools-44.1.1 setuptools-scm-5.0.2
You are using pip version 9.0.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

The problem with pinning is that each project declares its own build dependencies and pip installs those in an isolated build environment (if they implement PEP 517), so as an upstream package depending on it, you have little control on how it’s built.

I’m able to build backports.functools_lru_cache from source without problems on Python 2.7 with pip 10:

~ $ python2.7 -m pip-run -q 'pip<11' -- -m pip-run --no-binary backports.functools_lru_cache backports.functools_lru_cache -- -c pass
ERROR: pip's legacy dependency resolver does not consider dependency conflicts when selecting packages. This behaviour is the source of the following dependency conflicts.
pip-run 6.2.0 requires pip>=19.3, but you'll have pip 10.0.1 which is incompatible.
Collecting backports.functools_lru_cache
  Using cached https://files.pythonhosted.org/packages/2d/52/63d9669f7df63a61bc1d7b5ca253eadf36fea239ed89ccafd2ccb3668a3e/backports.functools_lru_cache-1.6.2.tar.gz
  Installing build dependencies ... done
Skipping bdist_wheel for backports.functools-lru-cache, due to binaries being disabled for it.
Installing collected packages: backports.functools-lru-cache
matplotlib 1.3.1 requires nose, which is not installed.
matplotlib 1.3.1 requires tornado, which is not installed.
pip-run 6.2.0 has requirement pip>=19.3, but you'll have pip 10.0.1 which is incompatible.
  Running setup.py install for backports.functools-lru-cache ... done
Successfully installed backports.functools-lru-cache-1.6.2
You are using pip version 10.0.1, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Or install with pip 9 from wheel:

~ $ python2.7 -m pip-run -q 'pip<10' -- -m pip-run backports.functools_lru_cache -- -c pass
ERROR: pip's legacy dependency resolver does not consider dependency conflicts when selecting packages. This behaviour is the source of the following dependency conflicts.
pip-run 6.2.0 requires pip>=19.3, but you'll have pip 9.0.3 which is incompatible.
Collecting backports.functools_lru_cache
  Downloading https://files.pythonhosted.org/packages/bd/08/e5e52f830a63879c92f0067c633c05b856b37b45b23e5cd79e5bc8087836/backports.functools_lru_cache-1.6.3-py2.py3-none-any.whl
Installing collected packages: backports.functools-lru-cache
Successfully installed backports.functools-lru-cache-1.6.3
You are using pip version 9.0.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

I am able to replicate the issue with pip 9 and build from source, because pip 9 doesn’t support PEP 508:

~ $ python2.7 -m pip-run -q 'pip<10' -- -m pip-run --no-binary backports.functools_lru_cache backports.functools_lru_cache -- -c pass
ERROR: pip's legacy dependency resolver does not consider dependency conflicts when selecting packages. This behaviour is the source of the following dependency conflicts.
pip-run 6.2.0 requires pip>=19.3, but you'll have pip 9.0.3 which is incompatible.
Collecting backports.functools_lru_cache
  Downloading https://files.pythonhosted.org/packages/38/bc/4f015f2aee8bf92eefc1f8c7fd736c711f30c91966d7bb92d00e463a54bf/backports.functools_lru_cache-1.6.3.tar.gz
    Complete output from command python setup.py egg_info:
    /var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/easy_install-q6fDzO/setuptools_scm-6.0.1/src
    <pkg_resources.WorkingSet object at 0x10b39d1d0>
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-UWPsvN/backports.functools-lru-cache/setup.py", line 6, in <module>
        setuptools.setup()
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/dist.py", line 717, in fetch_build_eggs
        replace_conflicting=True,
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 782, in resolve
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-UWPsvN/backports.functools-lru-cache/
        replace_conflicting=replace_conflicting
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1077, in obtain
        return installer(requirement)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/dist.py", line 784, in fetch_build_egg
        return cmd.easy_install(req)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 679, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 890, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 1158, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 253, in run_setup
        raise
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/easy_install-q6fDzO/setuptools_scm-6.0.1/setup.py", line 52, in <module>
    
      File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/easy_install-q6fDzO/setuptools_scm-6.0.1/setup.py", line 29, in scm_config
    
      File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/easy_install-q6fDzO/setuptools_scm-6.0.1/src/setuptools_scm/__init__.py", line 8, in <module>
      File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/easy_install-q6fDzO/setuptools_scm-6.0.1/src/setuptools_scm/config.py", line 6, in <module>
      File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/easy_install-q6fDzO/setuptools_scm-6.0.1/src/setuptools_scm/utils.py", line 41
        print(*k)
              ^
    SyntaxError: invalid syntax
    
    ----------------------------------------
You are using pip version 9.0.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/jaraco/Library/Python/2.7/lib/python/site-packages/pip-run.py", line 4, in <module>
    __name__ == '__main__' and run()
  File "/Users/jaraco/Library/Python/2.7/lib/python/site-packages/pip_run/__init__.py", line 18, in run
    with deps.load(*deps.not_installed(pip_args)) as home:
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/Users/jaraco/Library/Python/2.7/lib/python/site-packages/pip_run/deps.py", line 51, in load
    _installable(args) and subprocess.check_call(cmd)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python', '-m', 'pip', 'install', '-t', '/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-sYeUyK', '--no-binary', 'backports.functools_lru_cache', 'backports.functools_lru_cache')' returned non-zero exit status 1