Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
ci: be less strict with linter for now
Browse files Browse the repository at this point in the history
  • Loading branch information
PrettyWood committed Feb 14, 2022
1 parent 5a867b1 commit c37efee
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
max-line-length = 100
max-line-length = 125
ignore = Q000, W503
exclude = __init__.py
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ install:

.PHONY: format
format:
poetry run pre-commit run --all-files
$(black)
$(isort)

.PHONY: lint
lint:
Expand Down
2 changes: 1 addition & 1 deletion toucan_data_sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import shutil
import tempfile
import zipfile
from typing import Any, Dict, List, Literal, Optional, Union
from typing import Any, Dict, List, Literal, Optional

import joblib
import pandas as pd
Expand Down
6 changes: 5 additions & 1 deletion toucan_data_sdk/utils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,11 @@ def f(**tmp_extra_kwargs):
result = f(**tmp_extra_kwargs)

if limit is not None:
clean_cachedir_old_entries(f.store_backend, func.__name__, limit) # type: ignore[attr-defined]
clean_cachedir_old_entries(
f.store_backend, # type: ignore[attr-defined]
func.__name__,
limit,
)

return result

Expand Down
4 changes: 3 additions & 1 deletion toucan_data_sdk/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ def clean_cachedir_old_entries(cachedir: StoreBackendBase, func_name: str, limit
raise ValueError("'limit' must be greater or equal to 1")

cache_entries = get_cachedir_entries(cachedir, func_name)
cache_entries = sorted(cache_entries, key=lambda e: e.last_access, reverse=True) # type: ignore[no-any-return]
cache_entries = sorted(
cache_entries, key=lambda e: e.last_access, reverse=True # type: ignore[no-any-return]
)
cache_entries_to_remove = cache_entries[limit:]
for entry in cache_entries_to_remove:
shutil.rmtree(entry.path, ignore_errors=True)
Expand Down

0 comments on commit c37efee

Please sign in to comment.