Skip to content

Commit

Permalink
Flake fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanJField committed Feb 24, 2025
1 parent 3951420 commit 894ffb3
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 15 deletions.
6 changes: 3 additions & 3 deletions fair/configuration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,14 +704,14 @@ def _get_user_info_and_namespaces(

if not local:
if _remote_auth_provider == "GitHub":
if not "github" in _user_info:
if "github" not in _user_info:
_user_github = click.prompt("GitHub Username")
_user_github_info = _handle_github(_user_github)[0]
_user_info["remote_user"] = _user_github_info["github"]
else:
_user_info["remote_user"] = _user_info["github"]
elif _remote_auth_provider == "GitLab":
if not "gitlab" in _user_info:
if "gitlab" not in _user_info:
_user_gitlab = click.prompt("GitLab Username")
_user_gitlab_info = _handle_gitlab(_user_gitlab, _remote_auth_url)[0]
_user_info["remote_user"] = _user_gitlab_info["gitlab"]
Expand Down Expand Up @@ -787,7 +787,7 @@ def global_config_query(
_rem_key_valid = False
while not _rem_key_valid:
_rem_key = click.prompt(
f"Remote API Token",
"Remote API Token",
)
if len(_rem_key) == 40:
_rem_key_valid = True
Expand Down
5 changes: 0 additions & 5 deletions fair/registry/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@
import logging
import traceback
import os
import re
import shutil
import tempfile
import typing
import platform
import urllib.parse
import urllib.request

Expand All @@ -39,9 +37,6 @@
import fair.exceptions as fdp_exc
import fair.utilities as fdp_util

import ssl
from requests.adapters import HTTPAdapter
from urllib3.poolmanager import PoolManager
from urllib3.exceptions import InsecureRequestWarning

from fake_useragent import UserAgent
Expand Down
2 changes: 1 addition & 1 deletion fair/registry/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def _get_url_from_object(
) -> str:
_desc = data.get("description", None)

if not "authors" in data:
if "authors" not in data:
data["authors"] = [user]

_object_data = {
Expand Down
2 changes: 0 additions & 2 deletions fair/registry/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
import os
import re
import shutil
from threading import local
import typing
import urllib.parse
import traceback

import click
import requests

import fair.exceptions as fdp_exc
Expand Down
10 changes: 7 additions & 3 deletions fair/staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import logging
import os
import typing
import re

import yaml

Expand Down Expand Up @@ -238,8 +237,13 @@ def _get_code_run_entries(self, local_uri: str, job_dir: str) -> typing.List[str
_code_run_urls = []

if (
os.path.exists(_code_run_file)
and open(_code_run_file, encoding="utf-8").read().strip()
os.path.exists
(
_code_run_file
) and open(
_code_run_file,
encoding="utf-8"
).read().strip()
):
self._logger.debug("Found coderuns file, extracting runs")
_runs = [
Expand Down
1 change: 0 additions & 1 deletion fair/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import logging
import os
import shutil
import sys
from types import SimpleNamespace
from venv import EnvBuilder
Expand Down

0 comments on commit 894ffb3

Please sign in to comment.