Index: upstream-ontologist/src/lib.rs
===================================================================
--- upstream-ontologist.orig/src/lib.rs
+++ upstream-ontologist/src/lib.rs
@@ -36,7 +36,7 @@ pub mod repology;
 pub mod vcs;
 pub mod vcs_command;
 
-#[cfg(test)]
+#[cfg(all(test, feature="setup-cfg", feature="pyo3", feature="debian", feature="python-pkginfo", feature="pyproject-toml", feature="r-description", feature="dist-ini"))]
 mod upstream_tests {
     include!(concat!(env!("OUT_DIR"), "/upstream_tests.rs"));
 }
