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

pipx can't install nightly #192

Closed
1 task done
superbonaci opened this issue Sep 28, 2023 · 3 comments
Closed
1 task done

pipx can't install nightly #192

superbonaci opened this issue Sep 28, 2023 · 3 comments

Comments

@superbonaci
Copy link

Describe the bug

A clear and concise description of what the bug is.

  • Does this issue still occur in the master branch? (Required)
$ 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
Copy link
Author

When this is fixed the other issue needs to be tested again #189

@hykilpikonna
Copy link
Owner

hykilpikonna commented Oct 2, 2023

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
Copy link
Author

It works now, thank you very much!

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