hykilpikonna / hyfetch

šŸ³ļøā€šŸŒˆ šŸ³ļøā€āš§ļø Neofetch with LGBTQ+ pride flags!
MIT License
1.3k stars 96 forks source link

pipx can't install nightly #192

Closed superbonaci closed 1 year ago

superbonaci commented 1 year ago

Describe the bug

A clear and concise description of what the bug is.

$ pipx install git+https://github.com/hykilpikonna/hyfetch.git@master
  error: subprocess-exited-with-error

  Ɨ python setup.py egg_info did not run successfully.
  Ā¦ exit code: 1
  ?-> [18 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-hm4534tt/setup.py", line 6, in <module>
          from hyfetch.__version__ import VERSION
        File "/tmp/pip-req-build-hm4534tt/hyfetch/__init__.py", line 3, in <module>
          from . import main, constants
        File "/tmp/pip-req-build-hm4534tt/hyfetch/main.py", line 12, in <module>
          from . import termenv, neofetch_util, pride_month
        File "/tmp/pip-req-build-hm4534tt/hyfetch/termenv.py", line 7, in <module>
          from .color_util import RGB, AnsiMode
        File "/tmp/pip-req-build-hm4534tt/hyfetch/color_util.py", line 6, in <module>
          from .constants import GLOBAL_CFG
        File "/tmp/pip-req-build-hm4534tt/hyfetch/constants.py", line 8, in <module>
          from .types import LightDark
        File "/tmp/pip-req-build-hm4534tt/hyfetch/types.py", line 1, in <module>
          from typing_extensions import Literal
      ModuleNotFoundError: No module named 'typing_extensions'
      [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.
Cannot determine package name from spec 'git+https://github.com/hykilpikonna/hyfetch.git@master'. Check package spec for errors.
superbonaci commented 1 year ago

When this is fixed the other issue needs to be tested again https://github.com/hykilpikonna/hyfetch/issues/189

hykilpikonna commented 1 year ago

Ok this is a very annoying implementation quirk for both Python runtime and pipx.

Three issues that caused this issue:

  1. When the setup script load the hyfetch.__version__ module, the parent module hyfetch is also loaded even though nothing in the __version__.py asked for anything from its parent.
  2. pipx requires running setup.py egg_info in python, while pip doesn't.
  3. pipx requires running setup.py in an isolated environment, which means it doesn't have the correct dependencies to load the hyfetch module when the setup script is run.

None of these three behaviors are helpful in any way. With that said, I fixed it by reading and parsing __version__.py as a text file instead of (correctly) importing it in setup.py. šŸ™ƒ

image
superbonaci commented 1 year ago

It works now, thank you very much!