setuptools_scm: Missing module name tomli

Since the release of setuptools_scm 6.1.1 a few minutes ago, our jenkins jobs are failing on the following error:

Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/nidar-orchid_master/setup.py", line 7, in <module>
    setuptools.setup(
  File "/root/.pyenv/versions/3.9.5/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/root/.pyenv/versions/3.9.5/lib/python3.9/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/root/.pyenv/versions/3.9.5/lib/python3.9/site-packages/setuptools/dist.py", line 434, in __init__
    _Distribution.__init__(self, {
  File "/root/.pyenv/versions/3.9.5/lib/python3.9/distutils/dist.py", line 292, in __init__
    self.finalize_options()
  File "/root/.pyenv/versions/3.9.5/lib/python3.9/site-packages/setuptools/dist.py", line 743, in finalize_options
    ep(self)
  File "/var/lib/jenkins/workspace/nidar-orchid_master/.eggs/setuptools_scm-6.1.1-py3.9.egg/setuptools_scm/integration.py", line 52, in infer_version
    config = Configuration.from_file(dist_name=dist_name)
  File "/var/lib/jenkins/workspace/nidar-orchid_master/.eggs/setuptools_scm-6.1.1-py3.9.egg/setuptools_scm/config.py", line 187, in from_file
    defn = _load_toml(data)
  File "/var/lib/jenkins/workspace/nidar-orchid_master/.eggs/setuptools_scm-6.1.1-py3.9.egg/setuptools_scm/config.py", line 59, in _lazy_tomli_load
    from tomli import loads
ModuleNotFoundError: No module named 'tomli'

Maybe a missing dependency somewhere?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 54
  • Comments: 39 (3 by maintainers)

Commits related to this issue

Most upvoted comments

I just wanted to say a HUGE THANK YOU @RonnyPfannschmidt, for all your work on setuptools_scm and being able to quickly mitigate this issue.

In open source is easy to get a lot of attention when things stop working, without the much deserved appreciation the maintainers deserve.

i just returned to the computer to yank this release as well, it seems i will have to re engineer the way this is tested to stop missing those issues until reports pour in , a new release with the issue resolved will land later today

Fix is already going up, no need to comment “Same here” https://github.com/pypa/setuptools_scm/pull/628

A well used package - Nine projects reported an issue within 16 minutes 😃

I can see that the METADATA file in the setuptools-scm 6.1.1 package pulls in tomli as part of an extra “tomli”, but it seems that Pip when it uses setuptools-scm under the covers does not install that extra, and setuptools-scm seems to depend on tomli even when the “tomli” extra is not installed.

So if tomli is really an optional extra, then setuptools-scm should not fail when it is not there. If it is required, it should not be an extra. At least IMHO.

+1 for that, the bad version was yanked within the hour and my builds are all ✅ again

Great work @RonnyPfannschmidt 🍰 ✨ 🏆 ⭐

Same here 🆘

Same here ! a Friday evening 🥲

Same here occuring during the installation of black using pre-commit:

[INFO] Installing environment for https://github.com/psf/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\Arbeit\\.cache\\pre-commit\\repojrwwndw1\\py_env-python3\\Scripts\\python.EXE', '-mpip', 'install', '.')
return code: 1
expected return code: 0
stdout:
    Processing c:\users\arbeit\.cache\pre-commit\repojrwwndw1
      Installing build dependencies: started
      Installing build dependencies: finished with status 'done'
      Getting requirements to build wheel: started
      Getting requirements to build wheel: finished with status 'done'
        Preparing wheel metadata: started
        Preparing wheel metadata: finished with status 'error'

stderr:
      DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
       pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
        ERROR: Command errored out with exit status 1:
         command: 'C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\Scripts\python.EXE' 'C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\Arbeit\AppData\Local\Temp\tmpne3a6s_5'
             cwd: C:\Users\Arbeit\AppData\Local\Temp\pip-req-build-79_7d_fq
        Complete output (32 lines):
        C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools_scm\git.py:94: UserWarning: "C:\Users\Arbeit\AppData\Local\Temp\pip-req-build-79_7d_fq" is shallow and may cause errors
          warnings.warn(f'"{wd.path}" is shallow and may cause errors')
        Traceback (most recent call last):
          File "C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 280, in <module>
            main()
          File "C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 263, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
          File "C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 133, in prepare_metadata_for_build_wheel
            return hook(metadata_directory, config_settings)
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools\build_meta.py", line 166, in prepare_metadata_for_build_wheel
            self.run_setup()
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools\build_meta.py", line 150, in run_setup
            exec(compile(code, __file__, 'exec'), locals())
          File "setup.py", line 48, in <module>
            setup(
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools\__init__.py", line 153, in setup
            return distutils.core.setup(**attrs)
          File "C:\Python\Python-3.8.6-x64\lib\distutils\core.py", line 108, in setup
            _setup_distribution = dist = klass(attrs)
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools\dist.py", line 455, in __init__
            _Distribution.__init__(self, {
          File "C:\Python\Python-3.8.6-x64\lib\distutils\dist.py", line 292, in __init__
            self.finalize_options()
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools\dist.py", line 807, in finalize_options
            ep(self)
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools_scm\integration.py", line 52, in infer_version
            config = Configuration.from_file(dist_name=dist_name)
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools_scm\config.py", line 187, in from_file
            defn = _load_toml(data)
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools_scm\config.py", line 59, in _lazy_tomli_load
            from tomli import loads
        ModuleNotFoundError: No module named 'tomli'
        ----------------------------------------
    WARNING: Discarding file:///C:/Users/Arbeit/.cache/pre-commit/repojrwwndw1. Command errored out with exit status 1: 'C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\Scripts\python.EXE' 'C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' p
repare_metadata_for_build_wheel 'C:\Users\Arbeit\AppData\Local\Temp\tmpne3a6s_5' Check the logs for full command output.
    ERROR: Command errored out with exit status 1: 'C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\Scripts\python.EXE' 'C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\Arbeit\AppData\Local\Temp\t
mpne3a6s_5' Check the logs for full command output.

Same issue here. I’ve tried pip install tomli but no results.

Also experiencing the issue. Good vibes and happy Friday to all! ❤️

Thanks @RonnyPfannschmidt , you saved my Friday

Same, seeing CI failures because of this now.

cc @RonnyPfannschmidt who made the transition from toml to tomli in #586.

It’s a Friday evening and I’m sitting with a broken CI 😭

+1 Had the same issue and was just about to open an issue here 😉

In my case it happens when pip builds a wheel for the “lazy-object-proxy” package. We are not explicitly installing “setuptools-scm”, but it seems that Pip uses it under the covers when building a wheel.

Test run that fails: https://github.com/zhmcclient/zhmc-ansible-modules/pull/450/checks?check_run_id=3442020780#step:10:373

We’re also seeing this issue and it’s blocking all of our pip installs + builds

DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
       pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
        ERROR: Command errored out with exit status 1:
         command: /home/circleci/.cache/pre-commit/repoenxu__py/py_env-python3/bin/python /home/circleci/.cache/pre-commit/repoenxu__py/py_env-python3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpgbvrelz1
             cwd: /tmp/pip-req-build-waap9ppu
        Complete output (32 lines):
        /tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools_scm/git.py:94: UserWarning: "/tmp/pip-req-build-waap9ppu" is shallow and may cause errors
          warnings.warn(f'"{wd.path}" is shallow and may cause errors')
        Traceback (most recent call last):
          File "/home/circleci/.cache/pre-commit/repoenxu__py/py_env-python3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
            main()
          File "/home/circleci/.cache/pre-commit/repoenxu__py/py_env-python3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
          File "/home/circleci/.cache/pre-commit/repoenxu__py/py_env-python3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 151, in prepare_metadata_for_build_wheel
            return hook(metadata_directory, config_settings)
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 166, in prepare_metadata_for_build_wheel
            self.run_setup()
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 150, in run_setup
            exec(compile(code, __file__, 'exec'), locals())
          File "setup.py", line 48, in <module>
            setup(
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
            return distutils.core.setup(**attrs)
          File "/home/circleci/.pyenv/versions/3.9.6/lib/python3.9/distutils/core.py", line 108, in setup
            _setup_distribution = dist = klass(attrs)
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 455, in __init__
            _Distribution.__init__(self, {
          File "/home/circleci/.pyenv/versions/3.9.6/lib/python3.9/distutils/dist.py", line 292, in __init__
            self.finalize_options()
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 807, in finalize_options
            ep(self)
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools_scm/integration.py", line 52, in infer_version
            config = Configuration.from_file(dist_name=dist_name)
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools_scm/config.py", line 187, in from_file
            defn = _load_toml(data)
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools_scm/config.py", line 59, in _lazy_tomli_load
            from tomli import loads
        ModuleNotFoundError: No module named 'tomli'