Skip to content

Commit

Permalink
chore(pre-commit): autofix run
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Sep 2, 2024
1 parent 619846f commit 5255f78
Show file tree
Hide file tree
Showing 46 changed files with 199 additions and 155 deletions.
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ class TestConfig(DevConfig):
# pylint: disable=too-few-public-methods
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL",
"postgresql+psycopg2://postgres@localhost/atlas_hub_scrap_test"
"postgresql+psycopg2://postgres@localhost/atlas_hub_scrap_test",
# "sqlite:///../test.sqlite",
).replace("postgres://", "postgresql://")

Expand Down
1 change: 1 addition & 0 deletions runner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
cp web/model.py scheduler/
"""

import logging
import os

Expand Down
1 change: 0 additions & 1 deletion runner/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"""


import datetime
from dataclasses import dataclass
from typing import Optional
Expand Down
1 change: 0 additions & 1 deletion runner/scripts/em_cmd.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Functions used to run system commands."""


import os
import re
import subprocess
Expand Down
1 change: 0 additions & 1 deletion runner/scripts/em_code.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Task source code handler."""


import re
import urllib.parse
from typing import Optional
Expand Down
1 change: 0 additions & 1 deletion runner/scripts/em_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
years
"""


import calendar
import datetime
import re
Expand Down
1 change: 0 additions & 1 deletion runner/scripts/em_ftp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""FTP connection manager."""


import csv
import fnmatch
import ftplib # noqa: S402
Expand Down
1 change: 0 additions & 1 deletion runner/scripts/em_messages.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Exception and logging messages."""


import datetime
import sys
from dataclasses import dataclass
Expand Down
1 change: 0 additions & 1 deletion runner/scripts/em_python.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Python script runner."""


import ast
import datetime
import sys
Expand Down
17 changes: 10 additions & 7 deletions runner/scripts/em_sftp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""SFTP connection manager."""


import csv
import fnmatch
import os
Expand Down Expand Up @@ -39,9 +38,11 @@ def connection_key(connection: ConnectionSftp) -> Optional[paramiko.pkey.PKey]:

key = paramiko.RSAKey.from_private_key_file(
key_file.name,
password=em_decrypt(connection.key_password, app.config["PASS_KEY"])
if connection.key_password
else None,
password=(
em_decrypt(connection.key_password, app.config["PASS_KEY"])
if connection.key_password
else None
),
)

return key
Expand Down Expand Up @@ -81,9 +82,11 @@ def connect(connection: ConnectionSftp) -> Tuple[Transport, SFTPClient]:
transport.auth_publickey(connection.username, key, event=None)
transport.auth_password(
connection.username,
em_decrypt(connection.password, app.config["PASS_KEY"])
if connection.password
else "",
(
em_decrypt(connection.password, app.config["PASS_KEY"])
if connection.password
else ""
),
event=None,
)

Expand Down
1 change: 1 addition & 0 deletions runner/scripts/em_ssh.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""SSH connection handler."""

import select
import sys
import time
Expand Down
1 change: 1 addition & 0 deletions runner/scripts/smb_fix.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Update to an older version of https://github.com/miketeo/pysmb. Waiting for next release."""

# flake8: noqa
# type: ignore
# mypy: ignore-errors
Expand Down
8 changes: 5 additions & 3 deletions runner/scripts/task_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,9 +710,11 @@ def __process(self) -> None:
run_id=self.run_id,
directory=self.temp_path,
source_files=self.source_files,
script=self.task.processing_command or processing_script_name.name
if self.task.processing_type_id != 6 # source code
else processing_script_name.name,
script=(
self.task.processing_command or processing_script_name.name
if self.task.processing_type_id != 6 # source code
else processing_script_name.name
),
params=self.param_loader,
).run()
except BaseException as e:
Expand Down
1 change: 1 addition & 0 deletions runner/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
poetry run pytest runner/tests/ \
--cov --cov-append --cov-branch --cov-report=term-missing --disable-warnings
"""

import sys
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions runner/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Setyp pytest."""

import os

import pytest
Expand Down
1 change: 1 addition & 0 deletions runner/tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

import datetime

from pytest import fixture
Expand Down
1 change: 0 additions & 1 deletion runner/tests/test_scripts_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"""


from pytest import fixture

from runner.extensions import db
Expand Down
1 change: 0 additions & 1 deletion runner/tests/test_scripts_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"""


import calendar
import datetime

Expand Down
1 change: 1 addition & 0 deletions runner/tests/test_scripts_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
--cov --cov-append --cov-branch --cov-report=term-missing --disable-warnings
"""

from pathlib import Path

import pytest
Expand Down
1 change: 1 addition & 0 deletions runner/tests/test_scripts_sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
--cov --cov-append --cov-branch --cov-report=term-missing --disable-warnings
"""

import sys
import tempfile
from pathlib import Path
Expand Down
1 change: 0 additions & 1 deletion runner/tests/test_scripts_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"""


import pytest
from pytest import fixture

Expand Down
1 change: 1 addition & 0 deletions runner/web/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Import web modules."""

print(__name__) # noqa: T201
1 change: 0 additions & 1 deletion scheduler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"""


import contextlib
import logging
import os
Expand Down
1 change: 0 additions & 1 deletion scheduler/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"""


import datetime
from dataclasses import dataclass
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions scheduler/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
poetry run pytest tests/ \
--cov --cov-append --cov-branch --cov-report=term-missing --disable-warnings
"""

import sys
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions scheduler/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Setyp pytest."""

import os
import sys
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions scheduler/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
--cov --cov-append --cov-branch --cov-report=term-missing --disable-warnings
"""

# flake8: noqa,
# pylint: skip-file
# check all admin links
Expand Down
1 change: 1 addition & 0 deletions scheduler/tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
--cov --cov-append --cov-branch --cov-report=term-missing --disable-warnings
"""

print("importing tests")
import time
from datetime import datetime, timedelta
Expand Down
1 change: 0 additions & 1 deletion scripts/crypto.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Password encryption and decryption."""


from base64 import b64decode, b64encode

from cryptography.fernet import Fernet
Expand Down
1 change: 1 addition & 0 deletions web/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""EM Web Custom CLI."""

import sys
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions web/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
scripts after running :obj:`web.create_app`
"""

import logging

from flask_assets import Environment
Expand Down
1 change: 0 additions & 1 deletion web/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"""


import datetime
from dataclasses import dataclass
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions web/seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
flask seed_demo
"""

# pylint: disable=C0301

import sys
Expand Down
1 change: 1 addition & 0 deletions web/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
poetry run pytest tests/ \
--cov --cov-append --cov-branch --cov-report=term-missing --disable-warnings
"""

import sys
from pathlib import Path

Expand Down
1 change: 0 additions & 1 deletion web/tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"""


from flask import url_for
from flask.wrappers import Response
from flask_login import current_user
Expand Down
1 change: 0 additions & 1 deletion web/tests/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"""


from pytest import fixture

from web.extensions import db
Expand Down
1 change: 1 addition & 0 deletions web/tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

import datetime


Expand Down
1 change: 1 addition & 0 deletions web/tests/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

import time
from datetime import datetime

Expand Down
1 change: 1 addition & 0 deletions web/tests/test_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

import json

from pytest import fixture
Expand Down
1 change: 1 addition & 0 deletions web/tests/test_task_controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

import json
import time

Expand Down
1 change: 1 addition & 0 deletions web/tests/test_task_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

from flask import request, url_for
from pytest import fixture

Expand Down
1 change: 0 additions & 1 deletion web/web/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Admin web views."""


import json
import platform
from pathlib import Path
Expand Down
1 change: 0 additions & 1 deletion web/web/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
CSS assets are compiles from scss to css with gulp. Webassets combines the output css and versions them nicely.
"""


from flask_assets import Bundle
from webassets.filter import register_filter
from webassets_rollup import Rollup
Expand Down
1 change: 1 addition & 0 deletions web/web/ldap_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Modification of Flask-SimpleLDAP script by https://github.com/alexferl/flask-simpleldap.
"""

# mypy: ignore-errors
import re

Expand Down
1 change: 0 additions & 1 deletion web/web/saml_auth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""SAML Login/Logout web views."""


from flask import Blueprint, Flask, abort
from flask import current_app as app
from flask import flash, make_response, redirect, request, session, url_for
Expand Down
Loading

0 comments on commit 5255f78

Please sign in to comment.