Skip to content

Commit c8ea69f

Browse files
authored
Merge pull request #50 from bact/warn-uninstalled-ai-lib
Warn users if AI extraction library is not installed
2 parents 72eb754 + bdc9c9a commit c8ea69f

7 files changed

Lines changed: 26 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ and this project adheres to
1515
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1616

1717
- Full release notes: <https://github.com/bact/pitloom/releases>
18-
- Commit history: <https://github.com/bact/pitloom/compare/v0.3.0...v0.4.0>
18+
- Commit history: <https://github.com/bact/pitloom/compare/v0.4.0...v0.4.1>
19+
20+
## [0.4.1] - 2026-04-02
21+
22+
### Changed
23+
24+
- Warns if the AI extraction library is not installed ([#50][])
25+
26+
[#50]: https://github.com/bact/pitloom/pull/50
1927

2028
## [0.4.0] - 2026-04-02
2129

@@ -91,6 +99,7 @@ release because "Loom" and "Pyloom" were unavailable on PyPI.
9199

92100
---
93101

102+
[0.4.1]: https://github.com/bact/pitloom/compare/v0.4.0...v0.4.1
94103
[0.4.0]: https://github.com/bact/pitloom/compare/v0.3.0...v0.4.0
95104
[0.3.0]: https://github.com/bact/pitloom/compare/v0.2.0...v0.3.0
96105
[0.2.0]: https://github.com/bact/pitloom/compare/v0.1.0...v0.2.0

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ abstract: Automated transparency, woven from the ground up. SBOM generation for
99
repository-code: "https://github.com/bact/pitloom"
1010
type: software
1111
doi: 10.5281/zenodo.19243681
12-
version: 0.4.0
12+
version: 0.4.1
1313
license-url: "https://spdx.org/licenses/Apache-2.0"
1414
keywords:
1515
- sbom

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@
5454
"programmingLanguage": "Python 3",
5555
"readme": "https://github.com/bact/pitloom/blob/main/README.md",
5656
"url": "https://github.com/bact/pitloom",
57-
"version": "0.4.0"
57+
"version": "0.4.1"
5858
}

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ strict = true
142142
strict_equality_for_none = true
143143
warn_unreachable = true
144144

145+
[[tool.mypy.overrides]]
146+
ignore_missing_imports = true
147+
module = ["fasttext", "fasttext.*"]
148+
145149
[[tool.mypy.overrides]]
146150
ignore_missing_imports = true
147151
module = "fickling.*"

src/pitloom/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
"""Package information for Pitloom."""
66

7-
__version__ = "0.4.0"
7+
__version__ = "0.4.1"

src/pitloom/extract/_fasttext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _load_fasttext_model(model_path: Path) -> Any:
3535
"""Load a fastText model with consistent dependency and format errors."""
3636
try:
3737
# pylint: disable=import-outside-toplevel
38-
import fasttext # type: ignore[import-untyped]
38+
import fasttext
3939
except ImportError as exc:
4040
raise ImportError(
4141
"The 'fasttext' package is required to extract fastText model metadata. "

src/pitloom/extract/scanner.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,16 @@ def scan_project_for_ai_models(
6666
log.debug(
6767
"Discovered AI model: %s (format: %s)", pf.distribution_path, fmt
6868
)
69+
except ImportError as e:
70+
log.warning(
71+
"FORMAT=%s FILE=%s: required library not installed; %s",
72+
fmt,
73+
phys_path,
74+
e,
75+
)
6976
except Exception as e: # pylint: disable=broad-exception-caught
7077
log.warning(
71-
"Failed to extract metadata for format %s from %s: %s",
78+
"FORMAT=%s FILE=%s: failed to extract metadata; %s",
7279
fmt,
7380
phys_path,
7481
e,

0 commit comments

Comments
 (0)