-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
21 additions
and
62 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ authors = [ | |
{name = "Albert Hopkins", email = "[email protected]"}, | ||
] | ||
dependencies = [ | ||
"gbpcli>=1.7.0", | ||
"gbpcli>=2.0.0", | ||
"rich>=13.6.0", | ||
] | ||
requires-python = ">=3.11" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1 @@ | ||
"""gbp-ps command-line interface""" | ||
from typing import cast | ||
|
||
from gbpcli import GBP | ||
from gbpcli.graphql import Query | ||
|
||
|
||
def get_dist_query(name: str, gbp: GBP, distribution: str = "gbp_ps") -> Query: | ||
"""Return the query with the given name | ||
This function has a side-effect on pre 2.0 versions of gbpcli in that it mutates the | ||
gbp argument to point to the given distribution's query database. | ||
""" | ||
if hasattr(gbp.query, "_distribution"): | ||
# Older GBP can only see the queries for the "gbpcli" distribution and need to | ||
# be overridden to see queries from other distributions | ||
gbp.query._distribution = distribution # pylint: disable=protected-access | ||
return cast(Query, getattr(gbp.query, name)) | ||
|
||
return cast(Query, getattr(getattr(gbp.query, distribution), name)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters