Skip to content

Commit

Permalink
fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdeitke committed May 30, 2022
1 parent f5f9177 commit b43f435
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
20 changes: 9 additions & 11 deletions prior/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#%%
import logging
import os
import subprocess
from typing import Any, List, Literal, Optional

import requests
from attrs import define
from github import Github
from github import Github, GithubException


@define
Expand Down Expand Up @@ -36,11 +35,11 @@ def __getitem__(self, index: int) -> Any:
def __repr__(self):
"""Return a string representation of the dataset."""
return (
f"DatasetSplit(\n"
"DatasetSplit(\n"
f" dataset={self.dataset},\n"
f" size={len(self.data)},\n"
f" split={self.split}\n"
f")"
")"
)


Expand Down Expand Up @@ -87,9 +86,9 @@ def load_dataset(
# Try using private repo.
if not os.path.exists(f"{os.environ['HOME']}/.git-credentials"):
raise Exception(
f"Could not find ~/.git-credentials. "
f"Please make sure you're logged into GitHub with the following command:\n"
f" git config --global credential.helper store"
"Could not find ~/.git-credentials. "
"Please make sure you're logged into GitHub with the following command:\n"
" git config --global credential.helper store"
)

with open(f"{os.environ['HOME']}/.git-credentials", "r") as f:
Expand All @@ -115,9 +114,9 @@ def load_dataset(
# make sure the commit_id is valid
try:
repo.get_commit(revision)
except:
raise Exception(
f"Could not find revision={revision} in dataset={dataset}."
except GithubException:
raise GithubException(
f"Could not find revision={revision} in dataset={entity}/{dataset}."
" Please pass a valid commit_id sha, branch name, or tag."
)

Expand Down Expand Up @@ -149,4 +148,3 @@ def load_dataset(
dataset = out["load_dataset"]()
os.chdir(start_dir)
return dataset

4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ def fix_url_dependencies(req: str) -> str:
author="Allen Institute for Artificial Intelligence",
author_email="contact@allenai.org",
license="Apache",
packages=find_packages(
exclude=["*.tests", "*.tests.*", "tests.*", "tests"],
),
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"],),
package_data={"prior": ["py.typed"]},
install_requires=read_requirements("requirements.txt"),
extras_require={"dev": read_requirements("dev-requirements.txt")},
Expand Down

0 comments on commit b43f435

Please sign in to comment.