Merge branch 'main' into pyinstaller

This commit is contained in:
Theodore Aptekarev
2022-03-26 17:37:13 +03:00
committed by GitHub
7 changed files with 14 additions and 15 deletions

View File

@@ -65,7 +65,6 @@ jobs:
restore-keys: |
macos-pip-
# TODO: Is there a better way to do this?
- name: Uninstall Brotlipy
shell: bash -l {0}
run: |
@@ -76,6 +75,7 @@ jobs:
run: |
conda info
pip install --requirement requirements-full.txt
pip install --requirement bots/requirements.txt
- name: List installed packages (Bash)
shell: bash -l {0}

View File

@@ -237,7 +237,6 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
# TODO: Is there a better way to do this?
- name: Uninstall Brotlipy
shell: bash -l {0}
run: |

View File

@@ -77,7 +77,6 @@ jobs:
restore-keys: |
windows-pip-
# TODO: Is there a better way to do this?
- name: Uninstall Brotlipy
shell: bash -l {0}
run: |
@@ -88,6 +87,7 @@ jobs:
run: |
conda info
pip install --requirement requirements-full.txt
pip install --requirement bots/requirements.txt
- name: List installed packages (Bash)
shell: bash -l {0}

View File

@@ -145,8 +145,8 @@ API_SMARTSTAKE_KEY = os.getenv("GT_API_SMARTSTAKE_KEY") or "REPLACE_ME"
API_SMARTSTAKE_TOKEN = os.getenv("GT_API_SMARTSTAKE_TOKEN") or "REPLACE_ME"
# AWS KEYS
AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID") or "REPLACE_ME"
AWS_ACCESS_KEY = os.getenv("AWS_ACCESS_KEY") or "REPLACE_ME"
AWS_ACCESS_KEY_ID = os.getenv("GT_AWS_ACCESS_KEY_ID") or "REPLACE_ME"
AWS_SECRET_ACCESS_KEY = os.getenv("GT_AWS_SECRET_ACCESS_KEY") or "REPLACE_ME"
# https://messari.io/
API_MESSARI_KEY = os.getenv("GT_API_MESSARI_KEY") or "REPLACE_ME"

View File

@@ -8,9 +8,9 @@ import requests
try:
import boto3
except ImportError:
WITH_BOTO3 = True
finally:
WITH_BOTO3 = False
finally:
WITH_BOTO3 = True
# IMPORTATION INTERNAL
from gamestonk_terminal import config_terminal as cfg
@@ -20,8 +20,8 @@ from gamestonk_terminal.log.constants import DEFAULT_API_URL, DEFAULT_BUCKET
def send_to_s3_directly(
aws_access_key: str,
aws_access_key_id: str,
aws_secret_access_key: str,
bucket: str,
file: Path,
object_key: str,
@@ -31,8 +31,8 @@ def send_to_s3_directly(
s3_client = boto3.client(
service_name="s3",
aws_access_key_id=aws_access_key,
aws_secret_access_key=aws_access_key_id,
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
)
s3_client.upload_file(str(file), bucket, object_key)
@@ -70,8 +70,8 @@ def send_to_s3_using_presigned_url(
def send_to_s3(archives_file: Path, file: Path, object_key: str, tmp_file: Path):
api_url = DEFAULT_API_URL
aws_access_key = cfg.AWS_ACCESS_KEY
aws_access_key_id = cfg.AWS_ACCESS_KEY_ID
aws_secret_access_key = cfg.AWS_SECRET_ACCESS_KEY
bucket = DEFAULT_BUCKET
if file.stat().st_size <= 0:
@@ -81,10 +81,10 @@ def send_to_s3(archives_file: Path, file: Path, object_key: str, tmp_file: Path)
tmp_file.parent.mkdir(exist_ok=True)
file = file.rename(tmp_file)
if aws_access_key != "REPLACE_ME" and aws_access_key_id != "REPLACE_ME":
if aws_access_key_id != "REPLACE_ME" and aws_secret_access_key != "REPLACE_ME":
send_to_s3_directly(
aws_access_key=aws_access_key_id,
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
bucket=bucket,
file=file,
object_key=object_key,

View File

@@ -18,7 +18,7 @@ def get_expired_file_list(directory: Path, before_timestamp: float):
expired_files = list()
if directory.exists and directory.is_dir():
for file in directory.iterdir():
if file.lstat().st_mtime < before_timestamp:
if file.is_file() and file.lstat().st_mtime < before_timestamp:
expired_files.append(file)
return expired_files

View File

@@ -175,6 +175,6 @@ class PathTrackingFileHandler(TimedRotatingFileHandler):
closed_log_path = self.baseFilename
log_sender.send_path(path=Path(closed_log_path), last=True)
try:
log_sender.join()
log_sender.join(timeout=3)
except Exception:
pass