jarun/buku

Ubuntu 22.04: pipx install buku[server] not working

DiagonalArg opened this issue · 7 comments

$ pipx install buku[server]
Fatal error from pip prevented installation. Full pip output in file:
    /home/user/.local/pipx/logs/cmd_2023-10-28_02.00.37_pip_errors.log

pip seemed to fail to build package:
    flask-reverse-proxy-fix@

Some possibly relevant errors from pip install:
    error: subprocess-exited-with-error
    error: metadata-generation-failed

Error installing buku from spec 'buku[server]'.
PIP STDOUT
----------
Collecting buku[server]
  Downloading buku-4.7.1.tar.gz (225 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 225.8/225.8 kB 1.9 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting flask-reverse-proxy-fix@ https://github.com/rachmadaniHaryono/flask-reverse-proxy-fix/archive/refs/tags/v0.2.2rc1.zip (from buku[server])
  Downloading https://github.com/rachmadaniHaryono/flask-reverse-proxy-fix/archive/refs/tags/v0.2.2rc1.zip
     - 14.2 kB 375.6 kB/s 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'

PIP STDERR
----------
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [59 lines of output]
      /home/user/.local/pipx/shared/lib/python3.10/site-packages/setuptools/dist.py:315: SetuptoolsDeprecationWarning: Invalid version: '0.2.2rc1.devNone'.
      !!
      
              ********************************************************************************
              The version specified is not a valid version according to PEP 440.
              This may not work as expected with newer versions of
              setuptools, pip, and PyPI.
      
              This deprecation is overdue, please update your project and remove deprecated
              calls to avoid build errors in the future.
      
              See https://peps.python.org/pep-0440/ for details.
              ********************************************************************************
      
      !!
        self._validate_version(self.metadata.version)
      running egg_info
      /home/user/.local/pipx/shared/lib/python3.10/site-packages/setuptools/command/egg_info.py:130: SetuptoolsDeprecationWarning: Invalid version: '0.2.2rc1.devNone'.
      !!
      
              ********************************************************************************
              Version '0.2.2rc1.devNone' is not valid according to PEP 440.
      
              Please make sure to specify a valid version for your package.
              Also note that future releases of setuptools may halt the build process
              if an invalid version is given.
      
              This deprecation is overdue, please update your project and remove deprecated
              calls to avoid build errors in the future.
      
              See https://peps.python.org/pep-0440/ for details.
              ********************************************************************************
      
      !!
        return _normalization.best_effort_version(tagged)
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-xfgsxyeu/flask-reverse-proxy-fix_c30b849902aa463892af5dc46c8053b6/setup.py", line 14, in <module>
          setup(
        File "/home/user/.local/pipx/shared/lib/python3.10/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
        File "/home/user/.local/pipx/shared/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/home/user/.local/pipx/shared/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/home/user/.local/pipx/shared/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/home/user/.local/pipx/shared/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
          super().run_command(command)
        File "/home/user/.local/pipx/shared/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
          cmd_obj.ensure_finalized()
        File "/home/user/.local/pipx/shared/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
          self.finalize_options()
        File "/home/user/.local/pipx/shared/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 224, in finalize_options
          parsed_version = packaging.version.Version(self.egg_version)
        File "/home/user/.local/pipx/shared/lib/python3.10/site-packages/setuptools/_vendor/packaging/version.py", line 198, in __init__
          raise InvalidVersion(f"Invalid version: '{version}'")
      setuptools.extern.packaging.version.InvalidVersion: Invalid version: '0.2.2rc1.devNone'
      [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.

…Isn't this a duplicate of #689? Created by the same user 😅

…Isn't this a duplicate of #689? Created by the same user 😅

The error is different, but looking at #685 , I'm realizing the root cause appears to be the same.

I try once in a while, but have simply not been able to get buku installed!

Alas, the 4.7.1 release (which is the latest one on PyPI) has a no-longer-valid dependency, so installing buku[server] isn't going to work until #685 is resolved.

Alright, thank you! :)

I'll close this now.

Technically the error above doesn't happen with the 4.8 deps (it got patched in flask-reverse-proxy-fix@), but flask-reverse-proxy-fix@ is still a no-longer-valid dependency so that only helps with installing from Github tag/release.

@LeXofLeviafan / Would this be the right installation approach for Latest?

pipx install -e "buku[server] @ git+https://github.com/jarun/buku.git"

This appears to work with pipx; though -e (--editable) is unnecessary and is in fact ignored with a warning since pipx disallows it for downloaded packages (as it's meant for development purposes).

As for pip, it disallows installing packages with -e for the same reason (and bails when invoked with such parameters).