Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing tomli module with v6.3.0 #625

Closed
bonastreyair opened this issue Sep 3, 2021 · 2 comments · Fixed by #628
Closed

Missing tomli module with v6.3.0 #625

bonastreyair opened this issue Sep 3, 2021 · 2 comments · Fixed by #628

Comments

@bonastreyair
Copy link

Since the release of setuptools_scm v6.3.0 a few minutes ago, it breaks pre-commit failing on the following error:

ModuleNotFoundError: No module named 'tomli'

That already appeared with v6.1.1 see #608

Log:

[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: ('/home/runner/.cache/pre-commit/reposyqhxl1x/py_env-python3/bin/python', '-mpip', 'install', '.')
return code: 1
expected return code: 0
stdout:
    Processing /home/runner/.cache/pre-commit/reposyqhxl1x
      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: /home/runner/.cache/pre-commit/reposyqhxl1x/py_env-python3/bin/python /home/runner/.cache/pre-commit/reposyqhxl1x/py_env-python3/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpr9paf95u
             cwd: /tmp/pip-req-build-ipmmr8oz
        Complete output (32 lines):
        /tmp/pip-build-env-g8y0052r/overlay/lib/python3.7/site-packages/setuptools_scm/git.py:94: UserWarning: "/tmp/pip-req-build-ipmmr8oz" is shallow and may cause errors
          warnings.warn(f'"{wd.path}" is shallow and may cause errors')
        Traceback (most recent call last):
          File "/home/runner/.cache/pre-commit/reposyqhxl1x/py_env-python3/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
            main()
          File "/home/runner/.cache/pre-commit/reposyqhxl1x/py_env-python3/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
          File "/home/runner/.cache/pre-commit/reposyqhxl1x/py_env-python3/lib/python3.7/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-g8y0052r/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 166, in prepare_metadata_for_build_wheel
            self.run_setup()
          File "/tmp/pip-build-env-g8y0052r/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 150, in run_setup
            exec(compile(code, __file__, 'exec'), locals())
          File "setup.py", line 111, in <module>
            "black-primer=black_primer.cli:main",
          File "/tmp/pip-build-env-g8y0052r/overlay/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
            return distutils.core.setup(**attrs)
          File "/opt/hostedtoolcache/Python/3.7.11/x64/lib/python3.7/distutils/core.py", line 108, in setup
            _setup_distribution = dist = klass(attrs)
          File "/tmp/pip-build-env-g8y0052r/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 456, in __init__
            k: v for k, v in attrs.items()
          File "/opt/hostedtoolcache/Python/3.7.11/x64/lib/python3.7/distutils/dist.py", line 292, in __init__
            self.finalize_options()
          File "/tmp/pip-build-env-g8y0052r/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 807, in finalize_options
            ep(self)
          File "/tmp/pip-build-env-g8y0052r/overlay/lib/python3.7/site-packages/setuptools_scm/integration.py", line 90, in infer_version
            config = Configuration.from_file(dist_name=dist_name)
          File "/tmp/pip-build-env-g8y0052r/overlay/lib/python3.7/site-packages/setuptools_scm/config.py", line 181, in from_file
            defn = _load_toml(data)
          File "/tmp/pip-build-env-g8y0052r/overlay/lib/python3.7/site-packages/setuptools_scm/config.py", line 53, in _lazy_tomli_load
            from tomli import loads
        ModuleNotFoundError: No module named 'tomli'
        ----------------------------------------
    WARNING: Discarding file:///home/runner/.cache/pre-commit/reposyqhxl1x. Command errored out with exit status 1: /home/runner/.cache/pre-commit/reposyqhxl1x/py_env-python3/bin/python /home/runner/.cache/pre-commit/reposyqhxl1x/py_env-python3/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpr9paf95u Check the logs for full command output.
    ERROR: Command errored out with exit status 1: /home/runner/.cache/pre-commit/reposyqhxl1x/py_env-python3/bin/python /home/runner/.cache/pre-commit/reposyqhxl1x/py_env-python3/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpr9paf95u Check the logs for full command output.
@ssbarnea
Copy link

ssbarnea commented Sep 3, 2021

My impression is that this is a bug in black and many other libraries which are missing to mention toml extra, especially as it needs to be mentioned int 2-3 different places: setup.cfg, setup.py and pyproject.toml. I do expect a huge number of people to hit that.

@RonnyPfannschmidt Is that really a bug in newer setuptools-scm or really the way it was used?

@bonastreyair bonastreyair changed the title 6.3.0 tomli module not found Missing tomli module with v6.3.0 Sep 3, 2021
fantix added a commit to fantix/edgedb that referenced this issue Sep 3, 2021
@RonnyPfannschmidt
Copy link
Contributor

@ssbarnea we are going to make toml the default now - at some point it will have to be anyway and now not adding it breaks pipelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants