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

Pre-commit installation errors out when used in git submodule #131

Open
krassowski opened this issue Oct 8, 2023 · 1 comment
Open

Pre-commit installation errors out when used in git submodule #131

krassowski opened this issue Oct 8, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@krassowski
Copy link
Member

Description

I tried to setup a jupyterlab extension to install jupyterlab from a branch. To use portal in yarn I wanted to use submodule. Submodule has .git file which is not a folder so precommit hook fails. It would be good to have a way to ignore this failure as currently it just errors out installation

× Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [30 lines of output]
      INFO:hatch_jupyter_builder.utils:Running jupyter-builder
      INFO:hatch_jupyter_builder.utils:Writing pre-commit hook
      Traceback (most recent call last):
        File "/opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 167, in prepare_metadata_for_build_editable
          hook = backend.prepare_metadata_for_build_editable
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'hatchling.build' has no attribute 'prepare_metadata_for_build_editable'
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 176, in prepare_metadata_for_build_editable
          whl_basename = build_hook(metadata_directory, config_settings)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vk89r8tu/overlay/lib/python3.11/site-packages/hatchling/build.py", line 78, in build_editable
          return os.path.basename(next(builder.build(wheel_directory, ['editable'])))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vk89r8tu/overlay/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 150, in build
          build_hook.initialize(version, build_data)
        File "/tmp/pip-build-env-vk89r8tu/normal/lib/python3.11/site-packages/hatch_jupyter_builder/plugin.py", line 59, in initialize
          install_pre_commit_hook()
        File "/tmp/pip-build-env-vk89r8tu/normal/lib/python3.11/site-packages/hatch_jupyter_builder/utils.py", line 265, in install_pre_commit_hook
          with open(path, "w") as fid:
               ^^^^^^^^^^^^^^^
      NotADirectoryError: [Errno 20] Not a directory: '.git/hooks/pre-commit'
      [end of output]
@krassowski krassowski added the bug Something isn't working label Oct 8, 2023
@welcome
Copy link

welcome bot commented Oct 8, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant