Skip to content

Commit

Permalink
Merge pull request #178 from MITLibraries/maintenance-week
Browse files Browse the repository at this point in the history
Maintenance week updates
  • Loading branch information
ehanson8 committed May 8, 2024
2 parents 132785c + 36be039 commit ed33a71
Show file tree
Hide file tree
Showing 8 changed files with 450 additions and 374 deletions.
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.4
3.12
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM public.ecr.aws/lambda/python:3.11
FROM public.ecr.aws/lambda/python:3.12

# Copy function code
COPY . ${LAMBDA_TASK_ROOT}/
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ pytest = "*"
ruff = "*"

[requires]
python_version = "3.11"
python_version = "3.12"
758 changes: 428 additions & 330 deletions Pipfile.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions lambdas/format_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def lambda_handler(event: dict, _context: dict) -> dict:
"for the provided date and source, something likely went wrong."
)
elif run_type == "daily":
result[
"success"
] = "There were no daily new/updated/deleted records to harvest."
result["success"] = (
"There were no daily new/updated/deleted records to harvest."
)
return result
logger.info(
"%s extracted files found in TIMDEX S3 bucket for date '%s' and source '%s'",
Expand Down
30 changes: 14 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# We do our best to sync this template with the latest version in our internal documentation.
# For MIT developers, we strongly recommend copying the pyproject.toml template from:
# https://mitlibraries.atlassian.net/wiki/spaces/IN/pages/3432415247/Python+Project+Linters#Template-for-pyproject.toml

[tool.black]
line-length = 90

Expand All @@ -14,7 +10,15 @@ exclude = ["tests/"]
log_level = "INFO"

[tool.ruff]
target-version = "py311"
target-version = "py312"

# set max line length
line-length = 90

# enumerate all fixed violations
show-fixes = true

[tool.ruff.lint]
select = ["ALL", "PT"]

ignore = [
Expand Down Expand Up @@ -43,27 +47,21 @@ ignore = [
# allow autofix behavior for specified rules
fixable = ["E", "F", "I", "Q"]

# set max line length
line-length = 90

# enumerate all fixed violations
show-fixes = true

[tool.ruff.flake8-annotations]
[tool.ruff.lint.flake8-annotations]
mypy-init-return = true

[tool.ruff.flake8-pytest-style]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"tests/**/*" = [
"ANN",
"ARG001",
"S101",
]

[tool.ruff.pycodestyle]
[tool.ruff.lint.pycodestyle]
max-doc-length = 90

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "google"
20 changes: 0 additions & 20 deletions setup.cfg

This file was deleted.

4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import boto3
import pytest
from moto import mock_s3
from moto import mock_aws


@pytest.fixture(autouse=True)
Expand All @@ -17,7 +17,7 @@ def _test_env(monkeypatch):

@pytest.fixture(autouse=True)
def mocked_s3():
with mock_s3():
with mock_aws():
client = boto3.client("s3", region_name="us-east-1")
client.create_bucket(Bucket="test-timdex-bucket")
client.create_bucket(Bucket="test-alma-bucket")
Expand Down

0 comments on commit ed33a71

Please sign in to comment.