dbt-labs/dbt-core · error · anyhow
wheel filename not in PEP 491 form
Error message
wheel filename not in PEP 491 form: {filename} What it means
upload_dist failed to parse the wheel filename into PEP 491 components (distribution-version-python_tag-abi_tag-platform_tag), so the name/version/filetype fields required for the twine-style upload payload cannot be derived from the filename.
Solutions
- Rebuild or rename the wheel to the standard '{name}-{version}-{pytag}-{abitag}-{platform}.whl' form
- Check for missing/extra dashes or tags in the filename
- Upload via sdist instead if the wheel name can't be corrected
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/dbt-ci/src/publish.rs:361 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07).
Data as JSON: /api/errors/02edf901a4230cda.
Report an issue: GitHub.
Appendix: source
Thrown at crates/dbt-ci/src/publish.rs:361
dist: &Path,
kind: DistKind,
) -> Result<()> {
let filename = dist
.file_name()
.and_then(|s| s.to_str())
.ok_or_else(|| anyhow!("non-UTF8 distribution filename: {}", dist.display()))?
.to_string();
let metadata = Distribution::new(dist)
.with_context(|| format!("read metadata from {}", dist.display()))?
.metadata()
.clone();
// Wheels carry name/version/pyversion in the filename; the sdist's from PKG-INFO.
let (parsed, filetype) = match kind {
DistKind::Wheel => {
let parsed = parse_wheel_filename(&filename)
.ok_or_else(|| anyhow!("wheel filename not in PEP 491 form: {filename}"))?;
(parsed, "bdist_wheel")
}
DistKind::Sdist => (
ParsedWheel {
name: metadata.name.clone(),
version: metadata.version.clone(),
pyversion: "source".to_string(),
},
"sdist",
),
};
let bytes: Bytes = fs::read(dist)
.with_context(|| format!("read {}", dist.display()))?
.into();
let md5_digest = format!("{:x}", md5::compute(&bytes));
let sha256_digest = sha256_hex(&bytes);
View on GitHub (pinned to 0267ce9170)