joshgoebel / keyszer

a smart, flexible keymapper for X11 (a fork/reboot of xkeysnail )
Other
69 stars 15 forks source link

Failed to install keyszer under Kubuntu 22.10 #120

Closed laech closed 1 year ago

laech commented 1 year ago

Failed to install on a fresh clone with the following error under Kubuntu 22.10:

% pip3 install --user --upgrade .

Processing /home/lae/projects/keyszer
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [31 lines of output]
      Traceback (most recent call last):
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, in prepare_metadata_for_build_wheel
          hook = backend.prepare_metadata_for_build_wheel
      AttributeError: module 'hatchling.build' has no attribute 'prepare_metadata_for_build_wheel'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 160, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
        File "/tmp/pip-build-env-1gxokugn/overlay/local/lib/python3.10/dist-packages/hatchling/build.py", line 41, in build_wheel
          return os.path.basename(next(builder.build(wheel_directory, ['standard'])))
        File "/tmp/pip-build-env-1gxokugn/overlay/local/lib/python3.10/dist-packages/hatchling/builders/plugin/interface.py", line 144, in build
          artifact = version_api[version](directory, **build_data)
        File "/tmp/pip-build-env-1gxokugn/overlay/local/lib/python3.10/dist-packages/hatchling/builders/wheel.py", line 337, in build_standard
          for included_file in self.recurse_included_files():
        File "/tmp/pip-build-env-1gxokugn/overlay/local/lib/python3.10/dist-packages/hatchling/builders/plugin/interface.py", line 166, in recurse_included_files
          yield from self.recurse_explicit_files(self.config.only_include)
        File "/tmp/pip-build-env-1gxokugn/overlay/local/lib/python3.10/dist-packages/hatchling/builders/plugin/interface.py", line 231, in recurse_explicit_files
          if self.config.include_path(relative_file_path, explicit=True, is_package=is_package):
        File "/tmp/pip-build-env-1gxokugn/overlay/local/lib/python3.10/dist-packages/hatchling/builders/config.py", line 81, in include_path
          and not self.path_is_excluded(relative_path)
        File "/tmp/pip-build-env-1gxokugn/overlay/local/lib/python3.10/dist-packages/hatchling/builders/config.py", line 93, in path_is_excluded
          if self.exclude_spec is None:
        File "/tmp/pip-build-env-1gxokugn/overlay/local/lib/python3.10/dist-packages/hatchling/builders/config.py", line 188, in exclude_spec
          self.__exclude_spec = pathspec.GitIgnoreSpec.from_lines(all_exclude_patterns)
      AttributeError: module 'pathspec' has no attribute 'GitIgnoreSpec'
      [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.
ofek commented 1 year ago

Need https://github.com/cpburnz/python-pathspec/blob/master/CHANGES.rst#0100-2022-08-30 which is required https://github.com/pypa/hatch/blob/hatchling-v1.9.0/backend/src/hatchling/ouroboros.py#L39

joshgoebel commented 1 year ago

Is this something I'd need to bump?

ofek commented 1 year ago

No.

Upgrade pip?

ofek commented 1 year ago

https://repology.org/project/python:pathspec/versions

laech commented 1 year ago

This is what I have on an up to date Kubuntu 22.10:

% python3 --version
Python 3.10.7

% pip3 --version
pip 22.2 from /usr/lib/python3/dist-packages/pip (python 3.10)

I'm not a Python developer, is there something I need to do for it to work?

zenny commented 1 year ago

@laech I suggest you to compile in a virtualenv from the master branch of this repo as seems like the outdated default binaries with buntu-. Just my two cents. Cheers,

laech commented 1 year ago

Following this works https://github.com/joshgoebel/keyszer/blob/ca386c291cf71b6c5507409176cf1faa6b8e4e88/README.md?plain=1#L127-L136