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

Current versions of gh no longer detect the extension #4

Open
ssbarnea opened this issue Jan 19, 2024 · 2 comments
Open

Current versions of gh no longer detect the extension #4

ssbarnea opened this issue Jan 19, 2024 · 2 comments

Comments

@ssbarnea
Copy link

I used the README steps for installing the extension but apparently gh no longer detects the plugin. Based on the age of the repository I am inclined to believe that is no longer usable with current versions of gh (2.42.0).

Also after creating a new extension using gh-py cli directly, I tried to install it and got a stack trace:

ssbarnea@m1: ~/c/os
$ gh-py create
Extension name: gh-prep
Creating extension gh-prep
Creating scaffolding...
Created extension gh-prep

ssbarnea@m1: ~/c/os
$ cd gh-prep

ssbarnea@m1: ~/c/os/gh-prep
$ pip install -e .
Obtaining file:///Users/ssbarnea/c/os/gh-prep
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
ERROR: Exception:
Traceback (most recent call last):
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_vendor/packaging/requirements.py", line 102, in __init__
    req = REQUIREMENT.parseString(requirement_string)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_vendor/pyparsing/util.py", line 256, in _inner
    return fn(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_vendor/pyparsing/core.py", line 1190, in parse_string
    raise exc.with_traceback(None)
pip._vendor.pyparsing.exceptions.ParseException: Expected string_end, found 'GH'  (at char 3), (line:1, col:4)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 245, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/commands/install.py", line 377, in run
    requirement_set = resolver.resolve(
                      ^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 76, in resolve
    collected = self.factory.collect_root_requirements(root_reqs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 534, in collect_root_requirements
    reqs = list(
           ^^^^^
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 490, in _make_requirements_from_install_req
    cand = self._make_base_candidate_from_link(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 207, in _make_base_candidate_from_link
    self._editable_candidate_cache[link] = EditableCandidate(
                                           ^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 318, in __init__
    super().__init__(
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 156, in __init__
    self.dist = self._prepare()
                ^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 225, in _prepare
    dist = self._prepare_distribution()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 328, in _prepare_distribution
    return self._factory.preparer.prepare_editable_requirement(self._ireq)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 696, in prepare_editable_requirement
    dist = _get_prepared_distribution(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 71, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py", line 67, in prepare_distribution_metadata
    self.req.prepare_metadata()
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/req/req_install.py", line 593, in prepare_metadata
    self._set_requirement()
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_internal/req/req_install.py", line 393, in _set_requirement
    self.req = Requirement(
               ^^^^^^^^^^^^
  File "/Users/ssbarnea/.asdf/installs/python/3.12.1/lib/python3.12/site-packages/pip/_vendor/packaging/requirements.py", line 104, in __init__
    raise InvalidRequirement(
pip._vendor.packaging.requirements.InvalidRequirement: Parse error at "'GH Exten'": Expected string_end
@JessicaTegner
Copy link
Owner

hey :)

Truth is that I haven't looked at this in ages so it is probably broken. Didn't think anyone would use it. But if you are still up for it, I can take a look to see why it doesn't work anymore.
You are also more than welcome to.

@JessicaTegner
Copy link
Owner

hey @ssbarnea

So if we split your issue up into 2.

gh no longer recognizing "py" as an extension.
I was not able to reproduce this.

I ran the following

$ gh ext install JessicaTegner/gh-py

Creating an extension:

$ gh py create

extension name: test_extension

Allows me to do the following

$ cd gh-test_extension
$ gh ext install .
$ gh test_extension
Installing extension environment.                                                                                       
Extension environment installed.                                                                                        
My Awesome Gh Extension (version 0.1.0)                                                                                 
                                                                                                                        
Usage:                                                                                                                  
  command [options] [arguments]                                                                                         
                                                                                                                        
Options:                                                                                                                
  -h, --help            Display help for the given command. When no command is given display help for the list command. 
  -q, --quiet           Do not output any message.                                                                      
  -V, --version         Display this application version.                                                               
      --ansi            Force ANSI output.                                                                              
      --no-ansi         Disable ANSI output.                                                                            
  -n, --no-interaction  Do not ask any interactive question.                                                            
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.                                                                                                                     
                                                                                                                        
Available commands:                                                                                                     
  hello  Say hello to the console.                                                                                      
  help   Displays help for a command.                                                                                   
  list   Lists commands.                                                                                                

I'm running gh 2.43.1

Second part:

Your trace. I was able to reproduce it, but I would prefer if we focused on part 1, since if it's true, would completely hinder the usability of this, making point 2 null anyway.

Would you mind going through what I did in part 1, and try that, and let me know what happens, as well as telling me if you have tried anything else, because form what I can see, gh haven't changed the way they pick up, install and/or run extensions.

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