Skip to content

Commit

Permalink
updated several files to do with testing locally
Browse files Browse the repository at this point in the history
  • Loading branch information
lambeb committed Jan 27, 2025
1 parent f9d8ad9 commit a15985b
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 44 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
.vscode
.DS_Store
.env
/requirements.txt
/venv/
/app.yaml
.pytest_cache
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ gcloud compute start-iap-tunnel restapi-1 80 --local-host-port=localhost:8011


export BLAISE_API_URL="localhost:8011"
export BLAISE_SERVER_PARK="gusty"
export BLAISE_SERVER_PARK="gusty"

Run main.py
29 changes: 5 additions & 24 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import logging
import os

from google.cloud import storage
from dotenv import load_dotenv

import utils
from dotenv import load_dotenv
from appconfig.config import Config
from services.blaise_service import BlaiseService
from services.validation_service import ValidationService
Expand Down Expand Up @@ -35,20 +34,7 @@ def process_zip_file(data):
print(f"File {file_name} is not a zip file, skipping.")
return

print(f"Processing ZIP file: {file_name} from bucket {bucket_name}")

# Initialize the client
storage_client = storage.Client()

# Reference to the bucket
bucket = storage_client.get_bucket(bucket_name)

# Get the uploaded ZIP file
blob = bucket.blob(file_name)

# Debug: Print out the file's metadata
print(f"File {file_name} uploaded to {bucket_name}.")
print(f"Blob size: {blob.size} bytes")
logging.info(f"Processing ZIP file: {file_name} from bucket {bucket_name}")

# Config Handler
blaise_config = Config.from_env()
Expand Down Expand Up @@ -91,14 +77,9 @@ def process_zip_file(data):


if os.path.isfile("./.env"):
print("Loading environment variables from dotenv file")
logging.info("Loading environment variables from dotenv file")
load_dotenv()

# Testing

if __name__ == "__main__":
process_zip_file(
{
"bucket": "ons-blaise-v2-dev-rr3-ingest",
"name": "IPS2501A.zip"
}
)
process_zip_file({"bucket": "ons-blaise-v2-dev-rr3-ingest", "name": "IPS2501A.zip"})
7 changes: 0 additions & 7 deletions mypi.ini

This file was deleted.

22 changes: 11 additions & 11 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions services/mypi.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[mypy]
disallow_untyped_defs = False
namespace_packages = True
exclude = "scripts/"

[mypy-blaise_restapi.*]
ignore_missing_imports = True

[mypy-flask_httpauth.*]
ignore_missing_imports = True

[mypy-google.auth.transport.requests.*]
ignore_missing_imports = True

[mypy-google.oauth2.*]
ignore_missing_imports = True

[mypy-dataclass_wizard.*]
ignore_missing_imports = True

0 comments on commit a15985b

Please sign in to comment.