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

hatch shell failed #1174

Closed
foxmask opened this issue Dec 24, 2023 · 3 comments
Closed

hatch shell failed #1174

foxmask opened this issue Dec 24, 2023 · 3 comments

Comments

@foxmask
Copy link

foxmask commented Dec 24, 2023

hello,
I tested hatch then try ahtch shell but got that error

14:48 $ hatch shell
  error: subprocess-exited-with-error
  
  × Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "/home/foxmask/.local/share/hatch/env/virtual/shaarpy/ZM8a-pCl/shaarpy/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/foxmask/.local/share/hatch/env/virtual/shaarpy/ZM8a-pCl/shaarpy/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 "/home/foxmask/.local/share/hatch/env/virtual/shaarpy/ZM8a-pCl/shaarpy/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-xczvi96b/overlay/lib/python3.11/site-packages/hatchling/build.py", line 82, in build_editable
          return os.path.basename(next(builder.build(directory=wheel_directory, versions=['editable'])))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-xczvi96b/overlay/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 90, in build
          self.metadata.validate_fields()
        File "/tmp/pip-build-env-xczvi96b/overlay/lib/python3.11/site-packages/hatchling/metadata/core.py", line 243, in validate_fields
          _ = self.version
              ^^^^^^^^^^^^
        File "/tmp/pip-build-env-xczvi96b/overlay/lib/python3.11/site-packages/hatchling/metadata/core.py", line 128, in version
          self._version = self._get_version()
                          ^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-xczvi96b/overlay/lib/python3.11/site-packages/hatchling/metadata/core.py", line 238, in _get_version
          raise ValueError(message) from None
      ValueError: Invalid version `.` from source `regex`, see https://peps.python.org/pep-0440/
      [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.

hatch and python version used

(shaarpy2) ✔ ~/Projects/shaarpy2_hatch/shaarpy [main|✚ 1…4] 
14:49 $ hatch --version
Hatch, version 1.9.0
(shaarpy2) ✔ ~/Projects/shaarpy2_hatch/shaarpy [main|✚ 1…4] 
14:49 $ python --version
Python 3.11.7
@ofek
Copy link
Collaborator

ofek commented Dec 24, 2023

Show your config? And also the version variable line in the file you are targeting

@foxmask
Copy link
Author

foxmask commented Dec 27, 2023

What config do you need I show you ?

And also the version variable line in the file you are targeting
what do you mean ?

I've just run hatch from a venv

in the meantime my setup changed as I have to change of linux distrib

now I have hatch 1.9.1 and python 3.11.2

@foxmask
Copy link
Author

foxmask commented Dec 27, 2023

it looks like we use hatch shell as if we do source bin/activate inside a venv

image

So the issue should not appear if we use hatch "correctly" and not after activated a venv ;)

@foxmask foxmask closed this as completed Dec 27, 2023
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

No branches or pull requests

2 participants