Skip to content

Commit

Permalink
fix: add pre-commit config again
Browse files Browse the repository at this point in the history
  • Loading branch information
LennartPurucker committed Jan 10, 2025
1 parent 10c38a2 commit 304cc00
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
57 changes: 57 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
default_language_version:
python: python3
files: |
(?x)^(
src|
tests
)/.*\.py$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
files: ".*"
- id: check-case-conflict
files: ".*"
- id: check-merge-conflict
files: ".*"
- id: check-yaml
files: ".*"
- id: end-of-file-fixer
files: ".*"
types: ["yaml"]
- id: check-toml
files: ".*"
types: ["toml"]
- id: debug-statements
files: '^src/.*\.py$'
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
hooks:
- id: mypy
exclude: "test_comm_task" # Pre-commit mypy hates this one, crashes on (l106)
additional_dependencies:
- "types-pyyaml"
- "types-psutil"
args:
- "--no-warn-return-any" # Disable this because it doesn't know about 3rd party imports
- "--ignore-missing-imports"
- "--show-traceback"
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.30.0
hooks:
- id: check-github-workflows
files: '^github/workflows/.*\.ya?ml$'
types: ["yaml"]
- id: check-dependabot
files: '^\.github/dependabot\.ya?ml$'
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.1.0
hooks:
- id: commitizen
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --no-cache]
- id: ruff-format
4 changes: 2 additions & 2 deletions src/tabpfn/model/loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ def _try_huggingface_downloads(
config_local_path = hf_hub_download(
repo_id=source.repo_id,
filename="config.json",
local_dir=base_path.parent
local_dir=base_path.parent,
)
if Path(config_local_path) != config_path:
Path(config_local_path).rename(config_path)
config_path.unlink()
except Exception as e:
except Exception as e: # noqa: BLE001
logger.warning(f"Failed to download config.json: {e!s}")
# Continue even if config.json download fails

Expand Down

0 comments on commit 304cc00

Please sign in to comment.