Skip to content

Commit 8cbb32d

Browse files
authored
fix: add taskipy+pyright dev deps, fix pyright error in core.py (#12)
1 parent b3a7eb2 commit 8cbb32d

3 files changed

Lines changed: 127 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ dev = [
2727
"pytest>=9.0.3",
2828
"pytest-cov>=6.1.1",
2929
"ruff>=0.11.5",
30+
"taskipy>=1.14.1",
31+
"pyright>=1.1.400",
3032
]
3133

3234
[tool.setuptools.packages.find]
@@ -43,4 +45,15 @@ preview = true
4345
testpaths = ["tests"]
4446
python_files = ["test_*.py"]
4547
python_functions = ["test_*"]
46-
addopts = "--tb=short -q"
48+
addopts = "--tb=short -q"
49+
50+
[tool.taskipy.tasks]
51+
lint = "ruff check . && ruff format --check ."
52+
ruff-check = "ruff check ."
53+
ruff-format-check = "ruff format --check ."
54+
static-check = "python -m pyright smith/"
55+
test = "python -m pytest tests/ --tb=short -q"
56+
test-fast = "python -m pytest tests/ --tb=short -q -m 'not slow'"
57+
release-check = "python -m pytest tests/ --tb=short -q && ruff check . && ruff format --check ."
58+
doc-build = "python -c \"print('doc-build placeholder')\""
59+
doc-publish = "python -c \"print('doc-publish placeholder')\""

smith/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ def _extract_tar(content: bytes) -> list[FileSpec]:
178178
continue
179179
path = Path(rel)
180180
if _is_allowed(path):
181-
specs.append(
182-
FileSpec(relative_path=path, content=tar.extractfile(member).read())
183-
)
181+
file_data = tar.extractfile(member)
182+
if file_data is not None:
183+
specs.append(FileSpec(relative_path=path, content=file_data.read()))
184184
if not specs:
185185
raise RuntimeError("No matching files found in tar archive")
186186
return specs

uv.lock

Lines changed: 110 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)