Skip to content

Commit 6051a26

Browse files
authored
Remove test dependency on pg_config (#9853)
By mocking the metadata of `psycopg-c`, we avoid a test dependency on `pg_config` for the warehouse ecosystem test.
1 parent f80ddf1 commit 6051a26

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

crates/uv/tests/it/ecosystem.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@ fn transformers() -> Result<()> {
5656
// Source: https://github.com/konstin/warehouse/blob/baae127d90417104c8dee3fdd3855e2ba17aa428/pyproject.toml
5757
#[test]
5858
fn warehouse() -> Result<()> {
59-
// This build requires running `pg_config`. We could
60-
// probably stub it out, but for now, we just skip the
61-
// test if we can't run `pg_config`.
62-
if std::process::Command::new("pg_config").output().is_err() {
63-
return Ok(());
64-
}
6559
// Also, takes too long on non-Linux in CI.
6660
if !cfg!(target_os = "linux") && std::env::var_os(EnvVars::CI).is_some() {
6761
return Ok(());

crates/uv/tests/it/snapshots/it__ecosystem__warehouse-lock-file.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ requires-python = "==3.11.*"
88
[options]
99
exclude-newer = "2024-08-08T00:00:00Z"
1010

11+
[manifest]
12+
13+
[[manifest.dependency-metadata]]
14+
name = "psycopg-c"
15+
version = "3.2.1"
16+
1117
[[package]]
1218
name = "alabaster"
1319
version = "1.0.0"

ecosystem/warehouse/pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ dev-dependencies = [
153153
requires = ["hatchling"]
154154
build-backend = "hatchling.build"
155155

156+
# Avoid a dependency on `pg_config`
157+
[[tool.uv.dependency-metadata]]
158+
name = "psycopg-c"
159+
version = "3.2.1"
160+
requires-dist = []
161+
156162
[tool.coverage.run]
157163
branch = true
158164
dynamic_context = "test_function"

0 commit comments

Comments
 (0)