diff --git a/app/commands.py b/app/commands.py index d8b9d283e..c97a2f774 100644 --- a/app/commands.py +++ b/app/commands.py @@ -593,10 +593,10 @@ def process_row_from_job(job_id, job_row_number): @click.option("-f", "--csv_filename", required=True, help="csv file name") def download_csv_file_by_name(csv_filename): - bucket_name = (current_app.config["CSV_UPLOAD_BUCKET"]["bucket"],) - access_key = (current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"],) - secret = (current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"],) - region = (current_app.config["CSV_UPLOAD_BUCKET"]["region"],) + bucket_name = current_app.config["CSV_UPLOAD_BUCKET"]["bucket"] + access_key = current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"] + secret = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"] + region = current_app.config["CSV_UPLOAD_BUCKET"]["region"] print(s3.get_s3_file(bucket_name, csv_filename, access_key, secret, region)) @@ -865,14 +865,12 @@ def promote_user_to_platform_admin(user_email_address): @notify_command(name="purge-csv-bucket") def purge_csv_bucket(): - bucket_name = (current_app.config["CSV_UPLOAD_BUCKET"]["bucket"],) - access_key = (current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"],) - secret = (current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"],) - region = (current_app.config["CSV_UPLOAD_BUCKET"]["region"],) + bucket_name = current_app.config["CSV_UPLOAD_BUCKET"]["bucket"] + access_key = current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"] + secret = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"] + region = current_app.config["CSV_UPLOAD_BUCKET"]["region"] - print("ABOUT TO RUN PURGE CSV BUCKET") s3.purge_bucket(bucket_name, access_key, secret, region) - print("RAN PURGE CSV BUCKET") """ diff --git a/docs/all.md b/docs/all.md index 3d66dd5cf..a59bd761c 100644 --- a/docs/all.md +++ b/docs/all.md @@ -505,7 +505,7 @@ flask command purge_functional_test_data -u Running on cloud.gov: ``` -cf run-task notify-api "flask command purge_functional_test_data -u " +cf run-task notify-api --comand "flask command purge_functional_test_data -u " ``` @@ -1339,9 +1339,15 @@ In the api logs, search by job_id. Either you will see evidence of the job fail ## Viewing the csv file -If you need to view the questionable csv file, run the following command: +If you need to view the questionable csv file on production, run the following command: ``` -cf run-task notify-api "flask command download_csv_file_by_name -f " +cf run-task notify-api-production --command "flask command download-csv-file-by-name -f " +``` + +locally, just do: + +``` +poetry run flask command download-csv-file-by-name -f ``` diff --git a/poetry.lock b/poetry.lock index a98017bdf..990fdec8d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -204,17 +204,17 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p [[package]] name = "awscli" -version = "1.33.18" +version = "1.33.20" description = "Universal Command Line Environment for AWS." optional = false python-versions = ">=3.8" files = [ - {file = "awscli-1.33.18-py3-none-any.whl", hash = "sha256:4065a0c9ee7bd2281e0b04616242693abbe17cd9d7be966abc7a850d5044226d"}, - {file = "awscli-1.33.18.tar.gz", hash = "sha256:800cae2c020dae7e86877e2b53dee637c19acc62de8084bc67e3434ac174ca35"}, + {file = "awscli-1.33.20-py3-none-any.whl", hash = "sha256:bcb0d8e10ddeb966a2d87b7e5b564c9d849ada0a0819e1fd14e6afc9e319abf9"}, + {file = "awscli-1.33.20.tar.gz", hash = "sha256:d8167ac869b1e3750790944c56d5fd2f468d75163c3d0cbcf78444158541d9b5"}, ] [package.dependencies] -botocore = "1.34.136" +botocore = "1.34.138" colorama = ">=0.2.5,<0.4.7" docutils = ">=0.10,<0.17" PyYAML = ">=3.10,<6.1" @@ -422,13 +422,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.34.136" +version = "1.34.138" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" files = [ - {file = "botocore-1.34.136-py3-none-any.whl", hash = "sha256:c63fe9032091fb9e9477706a3ebfa4d0c109b807907051d892ed574f9b573e61"}, - {file = "botocore-1.34.136.tar.gz", hash = "sha256:7f7135178692b39143c8f152a618d2a3b71065a317569a7102d2306d4946f42f"}, + {file = "botocore-1.34.138-py3-none-any.whl", hash = "sha256:84e96a954c39a6f09cae4ea95b2ae582b5ae01b5040c92507b60509c9be5377a"}, + {file = "botocore-1.34.138.tar.gz", hash = "sha256:f558bbea96c4a4abbaeeedc477dabb00902311ba1ca6327974a6819b9f384920"}, ] [package.dependencies] @@ -2385,13 +2385,13 @@ files = [ [[package]] name = "moto" -version = "5.0.9" +version = "5.0.10" description = "" optional = false python-versions = ">=3.8" files = [ - {file = "moto-5.0.9-py2.py3-none-any.whl", hash = "sha256:21a13e02f83d6a18cfcd99949c96abb2e889f4bd51c4c6a3ecc8b78765cb854e"}, - {file = "moto-5.0.9.tar.gz", hash = "sha256:eb71f1cba01c70fff1f16086acb24d6d9aeb32830d646d8989f98a29aeae24ba"}, + {file = "moto-5.0.10-py2.py3-none-any.whl", hash = "sha256:9ffae2f64cc8fe95b9a12d63ae7268a7d6bea9993b922905b5abd8197d852cd0"}, + {file = "moto-5.0.10.tar.gz", hash = "sha256:eff37363221c93ea44f95721ae0ddb56f977fe70437a041b6cc641ee90266279"}, ] [package.dependencies] @@ -2823,13 +2823,13 @@ ptyprocess = ">=0.5" [[package]] name = "phonenumbers" -version = "8.13.39" +version = "8.13.40" description = "Python version of Google's common library for parsing, formatting, storing and validating international phone numbers." optional = false python-versions = "*" files = [ - {file = "phonenumbers-8.13.39-py2.py3-none-any.whl", hash = "sha256:3ad2d086fa71e7eef409001b9195ac54bebb0c6e3e752209b558ca192c9229a0"}, - {file = "phonenumbers-8.13.39.tar.gz", hash = "sha256:db7ca4970d206b2056231105300753b1a5b229f43416f8c2b3010e63fbb68d77"}, + {file = "phonenumbers-8.13.40-py2.py3-none-any.whl", hash = "sha256:9582752c20a1da5ec4449f7f97542bf8a793c8e2fec0ab57f767177bb8fc0b1d"}, + {file = "phonenumbers-8.13.40.tar.gz", hash = "sha256:f137c2848b8e83dd064b71881b65680584417efa202177fd330e2f7ff6c68113"}, ] [[package]] @@ -4017,18 +4017,18 @@ jeepney = ">=0.6" [[package]] name = "setuptools" -version = "70.1.1" +version = "70.2.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-70.1.1-py3-none-any.whl", hash = "sha256:a58a8fde0541dab0419750bcc521fbdf8585f6e5cb41909df3a472ef7b81ca95"}, - {file = "setuptools-70.1.1.tar.gz", hash = "sha256:937a48c7cdb7a21eb53cd7f9b59e525503aa8abaf3584c730dc5f7a5bec3a650"}, + {file = "setuptools-70.2.0-py3-none-any.whl", hash = "sha256:b8b8060bb426838fbe942479c90296ce976249451118ef566a5a0b7d8b78fb05"}, + {file = "setuptools-70.2.0.tar.gz", hash = "sha256:bd63e505105011b25c3c11f753f7e3b8465ea739efddaccef8f0efac2137bac1"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "shapely" @@ -4748,4 +4748,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "d3ca67b44f40fb25b724b8468e07d30901ddced875ffe5d6b6710a17e492b072" +content-hash = "cdc89ac0f5e246e8f15c9e6c434a4838324b8e7e0c4987ab355c93a9c4a5fa00" diff --git a/pyproject.toml b/pyproject.toml index 5d6d8b8df..fa2331c1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ alembic = "==1.13.2" amqp = "==5.2.0" beautifulsoup4 = "==4.12.3" boto3 = "^1.34.136" -botocore = "^1.34.136" +botocore = "^1.34.138" cachetools = "==5.3.3" celery = {version = "==5.4.0", extras = ["redis"]} certifi = ">=2022.12.7" @@ -55,7 +55,7 @@ geojson = "^3.1.0" govuk-bank-holidays = "^0.14" numpy = "^1.26.4" ordered-set = "^4.1.0" -phonenumbers = "^8.13.39" +phonenumbers = "^8.13.40" python-json-logger = "^2.0.7" pytz = "^2024.1" regex = "^2024.5.15" @@ -92,7 +92,7 @@ freezegun = "^1.5.1" honcho = "*" isort = "^5.13.2" jinja2-cli = {version = "==0.8.2", extras = ["yaml"]} -moto = "==5.0.9" +moto = "==5.0.10" pip-audit = "*" pre-commit = "^3.7.1" pytest = "^8.2.2" @@ -102,7 +102,7 @@ pytest-cov = "^5.0.0" pytest-xdist = "^3.5.0" radon = "^6.0.1" requests-mock = "^1.11.0" -setuptools = "^70.1.1" +setuptools = "^70.2.0" sqlalchemy-utils = "^0.41.2" vulture = "^2.10" detect-secrets = "^1.5.0"