Giter Site home page Giter Site logo

gh-py's Introduction

Hi there ๐Ÿ‘‹ I'm Jessica Tegner

JessicaTegner's GitHub stats]

โšก Recent Activity

  1. ๐Ÿ”’ Closed issue #370 in JessicaTegner/pypandoc
  2. ๐ŸŽ‰ Merged PR #371 in JessicaTegner/pypandoc
  3. ๐Ÿ’ช Opened PR #371 in JessicaTegner/pypandoc
  4. ๐ŸŽ‰ Merged PR #22 in JessicaTegner/teamtalk.py
  5. ๐Ÿ’ช Opened PR #42 in ProjectIgnis/windbot
  6. ๐Ÿ—ฃ Commented on #370 in JessicaTegner/pypandoc
  7. ๐Ÿ—ฃ Commented on #367 in JessicaTegner/pypandoc
  8. ๐ŸŽ‰ Merged PR #365 in JessicaTegner/pypandoc
  9. ๐Ÿ—ฃ Commented on #365 in JessicaTegner/pypandoc
  10. ๐Ÿ”’ Closed issue #366 in JessicaTegner/pypandoc

gh-py's People

Contributors

jessicategner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

jimthrashe

gh-py's Issues

Add support for secure token storage

Token storage change in latest release of gh

This is a message from the GitHub CLI team, maintainers of gh, writing to inform you that the most recent release of gh contains changes which may affect your extension. The latest release introduces the feature of storing authentication tokens in the system keyring (encrypted storage) instead of in a plain text file.
The keyrings that are supported are:

  • Keychain on macOS

  • GNOME Keyring on Linux (Secret Service dbus interface)

  • Wincred on Windows

This has huge security benefits for the users of our tool and was one of our oldest outstanding issues. Unfortunately this change has the potential to break extensions that rely on utilizing the users authentication token to work.

In order to have continued compatibility with gh there are some actions you, as an extension author, need to take. These actions will depend on the implementation of your extension.

Extensions built in Go using go-gh:

  1. Upgrade your go-gh version to v1.2.1, the latest version.

  2. Verify that in your extension retrieval of the user authentication token is done using the auth.TokenForHost function.

    • If you were previously accessing the authentication token using any other method it will no longer work.
    • Automatic resolution of the authentication token when using the API clients will continue to work without changes.

All other extensions:

  1. Verify that in your extension retrieval of the user authentication token is done by shelling out to the gh auth token command.

    • If you were previously accessing the authentication token using the gh config get command, reading the configuration file directly, or any other methods it will no longer work.

As of right now storing the authentication token in the system keyring is an opt-in feature, but in the near future it will be required and at that point if the changes above are not made then your extension will be broken for all users. If you have any questions/concerns about this change please feel free to open a discussion in the gh repo.

Thanks,
The GitHub CLI Team

Current versions of gh no longer detect the extension

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

If installed with `pip install gh-py`, can it still be invoked with `gh py`?

Hi @JessicaTegner, thanks for the extension! Per https://github.com/JessicaTegner/gh-py/blob/main/README.md, I see that it can also be installed with pip install gh-py, though I noticed that gh doesn't then know about it (even if installed globally as root):

$ gh extension list
no installed extensions found

It can still be invoked with gh-py, but is there perhaps a way to inform gh of its installation via pip, so that gh py also works, without manually installing it in $HOME/.local/share/gh/extensions/?

Thank you!

Portable Python on Windows

Make the scaffolding able to download a portable python on windows, if no python is found.

This assumes the following:

  • On MacOS and Linux python3 should in 99% already be installed.
  • We should be able to do it without a lot of overhead.

This set some requirements for our python.

  • We need to make sure we have a couple of python versions available (3.7 >< 3.11), or the supported versions of gh-py.
  • If we download a python version, we need to use that to run our python commands.
  • We need to make sure that those python distros has pip or somehow can be able to download poetry.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.