Skip to content

Commit b0d253e

Browse files
committed
token import
1 parent 142e7e5 commit b0d253e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

asyncPyGithub/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@
1010
MinimalRepository,
1111
)
1212

13-
from .base import req, write_json, read_json, CACHE_DIR, API_ENDPOINT
13+
from .base import (
14+
req,
15+
write_json,
16+
read_json,
17+
CACHE_DIR,
18+
API_ENDPOINT
19+
)
1420

1521

1622
from .User import GitHubUserPortal, UserQueryReturnable

asyncPyGithub/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121

2222
REPO_CACHE_LOCK: Lock = Lock()
2323
USER_CACHE_LOCK: Lock = Lock()
24-
24+
API_VERSION: Final[str] = "2022-11-28"
25+
API_ENDPOINT: Final[str] = "https://api.github.com"
26+
TOKEN: Final[str | None] = None
2527

2628
try:
2729
assert load_dotenv(
2830
verbose=True
2931
), "Failed to load environment variables from .env file."
3032
TOKEN: Final[str | None] = environ.get("GITHUB_TOKEN", environ.get("TOKEN", None))
31-
API_VERSION: Final[str] = "2022-11-28"
32-
API_ENDPOINT: Final[str] = "https://api.github.com"
3333

3434
assert TOKEN is not None, "GITHUB_TOKEN must be set in environment variables."
3535
except (AssertionError, AttributeError, OSError) as err:

0 commit comments

Comments
 (0)