Skip to content

Commit

Permalink
fix token load order
Browse files Browse the repository at this point in the history
  • Loading branch information
donn committed Aug 20, 2024
1 parent 3d3ad49 commit 0090420
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion volare/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.19.0"
__version__ = "0.19.1"

if __name__ == "__main__":
print(__version__, end="")
14 changes: 3 additions & 11 deletions volare/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ def api(self):
)


class Token:
override: ClassVar[Optional[str]] = None

@classmethod
def set_override_token(Self, override: str):
Self.override = override


class GitHubSession(httpx.Client):
class Token(object):
override: ClassVar[Optional[str]] = None
Expand Down Expand Up @@ -125,15 +117,15 @@ def __init__(
exit(-1)
else:
raise e from None
github_token = github_token or GitHubSession.Token.get_gh_token()
self.github_token = github_token

raw_headers = {
"User-Agent": type(self).get_user_agent(),
}
if github_token is not None:
raw_headers["Authorization"] = f"Bearer {github_token}"
self.headers = httpx.Headers(raw_headers)
if github_token is None:
github_token = GitHubSession.Token.get_gh_token()
self.github_token = github_token

def api(
self,
Expand Down

0 comments on commit 0090420

Please sign in to comment.