Skip to content

Commit 159269b

Browse files
authored
Merge pull request #113 from lsst-sqre/t/DM-54252
DM-54252: Update Python and pre-commit dependencies
2 parents b3340c4 + 50fced3 commit 159269b

File tree

5 files changed

+777
-704
lines changed

5 files changed

+777
-704
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: v6.0.0
44
hooks:
55
- id: check-merge-conflict
66
- id: check-toml
@@ -9,12 +9,12 @@ repos:
99
- id: trailing-whitespace
1010

1111
- repo: https://github.com/astral-sh/uv-pre-commit
12-
rev: 0.7.11
12+
rev: 0.10.5
1313
hooks:
1414
- id: uv-lock
1515

1616
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.11.13
17+
rev: v0.15.2
1818
hooks:
1919
- id: ruff
2020
args: [--fix, --exit-non-zero-on-fix]

pyproject.toml

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,32 @@ crawlspace = "crawlspace.cli:main"
4141
requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=6.2"]
4242
build-backend = "setuptools.build_meta"
4343

44+
[dependency-groups]
45+
dev = [
46+
"asgi-lifespan",
47+
"coverage[toml]",
48+
"httpx",
49+
"pytest",
50+
"pytest-asyncio",
51+
"pytest-cov",
52+
"pytest-sugar",
53+
"scriv[toml]>=1.5",
54+
]
55+
lint = [
56+
"pre-commit",
57+
"pre-commit-uv",
58+
"ruff>=0.9",
59+
]
60+
tox = [
61+
"tox>=4.24",
62+
"tox-docker>=5",
63+
"tox-uv>=1.25",
64+
]
65+
typing = [
66+
"mypy>=1.15",
67+
"types-pyyaml>=6",
68+
]
69+
4470
[tool.coverage.run]
4571
parallel = true
4672
branch = true
@@ -87,7 +113,7 @@ asyncio_default_fixture_loop_scope = "function"
87113
asyncio_mode = "strict"
88114
# The python_files setting is not for test detection (pytest will pick up any
89115
# test files named *_test.py without this setting) but to enable special
90-
# assert processing in any non-test supporting files under tests. We
116+
# assert processing in any non-test supporting files under tests. We
91117
# conventionally put test support functions under tests.support and may
92118
# sometimes use assert in test fixtures in conftest.py, and pytest only
93119
# enables magical assert processing (showing a full diff on assert failures
@@ -103,7 +129,6 @@ extend = "ruff-shared.toml"
103129

104130
[tool.ruff.lint.isort]
105131
known-first-party = ["crawlspace", "tests"]
106-
split-on-trailing-comma = false
107132

108133
[tool.scriv]
109134
categories = [
@@ -118,33 +143,4 @@ md_header_level = "2"
118143
new_fragment_template = "file:changelog.d/_template.md.jinja"
119144
skip_fragments = "_template.md.jinja"
120145

121-
[dependency-groups]
122-
dev = [
123-
"asgi-lifespan",
124-
"coverage[toml]",
125-
"httpx",
126-
"pytest",
127-
"pytest-asyncio",
128-
"pytest-cov",
129-
"pytest-sugar",
130-
"scriv[toml]>=1.5",
131-
]
132-
133-
lint = [
134-
"pre-commit",
135-
"pre-commit-uv",
136-
"ruff>=0.9",
137-
]
138-
139-
tox = [
140-
"tox>=4.24",
141-
"tox-docker>=5",
142-
"tox-uv>=1.25",
143-
]
144-
145-
typing = [
146-
"mypy>=1.15",
147-
"types-pyyaml>=6",
148-
]
149-
150146
[tool.setuptools_scm]

ruff-shared.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
# Reference for rules: https://docs.astral.sh/ruff/rules/
2121
exclude = ["docs/**"]
2222
line-length = 79
23-
target-version = "py312"
2423

2524
[format]
2625
docstring-code-format = true
@@ -34,6 +33,7 @@ ignore = [
3433
"ARG003", # unused class method arguments are often legitimate
3534
"ARG005", # unused lambda arguments are often legitimate
3635
"ASYNC109", # many async functions use asyncio.timeout internally
36+
"ASYNC240", # we don't want to run filesystem operations on threads
3737
"BLE001", # we want to catch and report Exception in background tasks
3838
"C414", # nested sorted is how you sort by multiple keys with reverse
3939
"D102", # sometimes we use docstring inheritence
@@ -147,5 +147,8 @@ builtins-ignorelist = [
147147
fixture-parentheses = false
148148
mark-parentheses = false
149149

150+
[lint.isort]
151+
split-on-trailing-comma = false
152+
150153
[lint.pydocstyle]
151154
convention = "numpy"

src/crawlspace/services/file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def from_blob(cls, path: str, blob: storage.Blob) -> CrawlspaceFile:
5151
media_type = "application/x-votable+xml"
5252
else:
5353
guessed_type, _ = guess_type(path)
54-
media_type = guessed_type if guessed_type else "text/plain"
54+
media_type = guessed_type or "text/plain"
5555
return cls(blob=blob, headers=headers, media_type=media_type)
5656

5757
def download_as_bytes(self) -> bytes:

0 commit comments

Comments
 (0)