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

Update pre-commit to fix Sphinx Lint #113015

Merged
merged 1 commit into from
Dec 12, 2023
Merged

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Dec 12, 2023

This fixes this error on pre-commit/linting:

[INFO] Initializing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Installing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/sphinx-contrib/sphinx-lint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/Users/hugo/.cache/pre-commit/repouv8h8bwe/py_env-python3/bin/python', '-mpip', 'install', '.')
return code: 1
stdout:
    Processing /Users/hugo/.cache/pre-commit/repouv8h8bwe
      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 metadata (pyproject.toml): started
      Preparing metadata (pyproject.toml): finished with status 'error'
stderr:
      error: subprocess-exited-with-error

      × Preparing metadata (pyproject.toml) did not run successfully.
      │ exit code: 1
      ╰─> [43 lines of output]
          /private/var/folders/c8/hl_96fcs0hjgr29njx33x20c0000gn/T/pip-build-env-77idmup0/overlay/lib/python3.12/site-packages/setuptools_scm/git.py:163: UserWarning: "/Users/hugo/.cache/pre-commit/repouv8h8bwe" is shallow and may cause errors
            warnings.warn(f'"{wd.path}" is shallow and may cause errors')
          Traceback (most recent call last):
            File "/Users/hugo/.cache/pre-commit/repouv8h8bwe/py_env-python3/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
              main()
            File "/Users/hugo/.cache/pre-commit/repouv8h8bwe/py_env-python3/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
              json_out['return_val'] = hook(**hook_input['kwargs'])
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/Users/hugo/.cache/pre-commit/repouv8h8bwe/py_env-python3/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
              whl_basename = backend.build_wheel(metadata_directory, config_settings)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/private/var/folders/c8/hl_96fcs0hjgr29njx33x20c0000gn/T/pip-build-env-77idmup0/overlay/lib/python3.12/site-packages/hatchling/build.py", line 58, in build_wheel
              return os.path.basename(next(builder.build(directory=wheel_directory, versions=['standard'])))
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/private/var/folders/c8/hl_96fcs0hjgr29njx33x20c0000gn/T/pip-build-env-77idmup0/overlay/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 155, in build
              artifact = version_api[version](directory, **build_data)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/private/var/folders/c8/hl_96fcs0hjgr29njx33x20c0000gn/T/pip-build-env-77idmup0/overlay/lib/python3.12/site-packages/hatchling/builders/wheel.py", line 407, in build_standard
              for included_file in self.recurse_included_files():
            File "/private/var/folders/c8/hl_96fcs0hjgr29njx33x20c0000gn/T/pip-build-env-77idmup0/overlay/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 176, in recurse_included_files
              yield from self.recurse_selected_project_files()
            File "/private/var/folders/c8/hl_96fcs0hjgr29njx33x20c0000gn/T/pip-build-env-77idmup0/overlay/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 180, in recurse_selected_project_files
              if self.config.only_include:
                 ^^^^^^^^^^^^^^^^^^^^^^^^
            File "/private/var/folders/c8/hl_96fcs0hjgr29njx33x20c0000gn/T/pip-build-env-77idmup0/overlay/lib/python3.12/site-packages/hatchling/builders/config.py", line 781, in only_include
              only_include = only_include_config.get('only-include', self.default_only_include()) or self.packages
                                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/private/var/folders/c8/hl_96fcs0hjgr29njx33x20c0000gn/T/pip-build-env-77idmup0/overlay/lib/python3.12/site-packages/hatchling/builders/wheel.py", line 235, in default_only_include
              return self.default_file_selection_options.only_include
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/functools.py", line 995, in __get__
              val = self.func(instance)
                    ^^^^^^^^^^^^^^^^^^^
            File "/private/var/folders/c8/hl_96fcs0hjgr29njx33x20c0000gn/T/pip-build-env-77idmup0/overlay/lib/python3.12/site-packages/hatchling/builders/wheel.py", line 223, in default_file_selection_options
              raise ValueError(message)
          ValueError: Unable to determine which files to ship inside the wheel using the following heuristics: https://hatch.pypa.io/latest/plugins/builder/wheel/#default-file-selection

          At least one file selection option must be defined in the `tool.hatch.build.targets.wheel` table, see: https://hatch.pypa.io/latest/config/build/

          As an example, if you intend to ship a directory named `foo` that resides within a `src` directory located at the root of your project, you can define the following:

          [tool.hatch.build.targets.wheel]
          packages = ["src/foo"]
          [end of output]

      note: This error originates from a subprocess, and is likely not a problem with pip.
    error: metadata-generation-failed

    × Encountered error while generating package metadata.
    ╰─> See above for output.

    note: This is an issue with the package mentioned above, not pip.
    hint: See above for details.
Check the log at /Users/hugo/.cache/pre-commit/pre-commit.log

sphinx-contrib/sphinx-lint#106

@AlexWaygood AlexWaygood merged commit eafc238 into python:main Dec 12, 2023
26 checks passed
@miss-islington-app
Copy link

Thanks @hugovk for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@AlexWaygood
Copy link
Member

Thanks!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 12, 2023
(cherry picked from commit eafc238)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Dec 12, 2023

GH-113017 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Dec 12, 2023
@bedevere-app
Copy link

bedevere-app bot commented Dec 12, 2023

GH-113018 is a backport of this pull request to the 3.11 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 12, 2023
(cherry picked from commit eafc238)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Dec 12, 2023
AlexWaygood pushed a commit that referenced this pull request Dec 12, 2023
Update pre-commit to fix Sphinx Lint (GH-113015)
(cherry picked from commit eafc238)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
AlexWaygood pushed a commit that referenced this pull request Dec 12, 2023
Update pre-commit to fix Sphinx Lint (GH-113015)
(cherry picked from commit eafc238)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@hugovk hugovk deleted the update-sphinx-lint branch December 12, 2023 16:44
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants