Skip to content

Commit

Permalink
🤖 Update dependencies (#47)
Browse files Browse the repository at this point in the history
* 🤖 Update dependencies

* Migrates to requests-oauth2client~=1.6

* Fixes bearer token

* Adds pdm scripts

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Harpo Harbert <[email protected]>
  • Loading branch information
github-actions[bot] and mrharpo authored Sep 19, 2024
1 parent 99a0a44 commit 8dfd7c1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
8 changes: 4 additions & 4 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 25 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
name = 'sonyci'
description = 'A Sony Ci api client'
authors = [{ name = 'WGBH-MLA', email = '[email protected]' }]
dependencies = ["pydantic~=2.9", "requests-oauth2client<1.6", "loguru~=0.7"]
dependencies = [
"pydantic~=2.9",
"requests-oauth2client~=1.6",
"loguru~=0.7",
]
requires-python = '>=3.8'
readme = 'README.md'
license = { text = 'MIT' }
Expand All @@ -21,9 +25,15 @@ test = [
"pytest-xdist~=3.6",
"urllib3~=1.26",
]
cli = ["typer[all]~=0.12"]
cli-ci = ["typer~=0.12"]
tui = ["trogon~=0.5"]
cli = [
"typer[all]~=0.12",
]
cli-ci = [
"typer~=0.12",
]
tui = [
"trogon~=0.5",
]
docs = [
"mkdocs~=1.6",
"mkdocs-material~=9.5",
Expand All @@ -41,7 +51,17 @@ build-backend = 'pdm.backend'
version = { source = 'file', path = 'sonyci/_version.py' }

[tool.pdm.dev-dependencies]
dev = ["ruff~=0.6", "black~=24.8", "pre-commit~=3.5"]
dev = [
"ruff~=0.6",
"black~=24.8",
"pre-commit~=3.5",
]

[tool.pdm.scripts]
test = 'pytest --vcr-record=none'
docs = 'mkdocs serve'
lint = 'ruff check . --fix'
format = 'black -S .'

[tool.pytest.ini_options]
testpaths = ['tests']
Expand Down
4 changes: 2 additions & 2 deletions sonyci/sonyci.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, ClassVar

from requests_oauth2client import ApiClient, OAuth2Client
from requests_oauth2client.auth import BearerAuth, OAuth2AccessTokenAuth
from requests_oauth2client.auth import OAuth2AccessTokenAuth
from requests_oauth2client.tokens import BearerToken

from sonyci.config import Config
Expand Down Expand Up @@ -50,7 +50,7 @@ def auth(self) -> OAuth2AccessTokenAuth:
"""
if self.client_id and self.client_secret:
return OAuth2AccessTokenAuth(client=self.oauth, token=self.token)
return BearerAuth(token=self.token)
return BearerToken(self.token.access_token)

@property
def client(self) -> ApiClient:
Expand Down

0 comments on commit 8dfd7c1

Please sign in to comment.