Skip to content

Commit

Permalink
Remove test dependency on pg_config (#9853)
Browse files Browse the repository at this point in the history
By mocking the metadata of `psycopg-c`, we avoid a test dependency on
`pg_config` for the warehouse ecosystem test.
  • Loading branch information
konstin authored Dec 13, 2024
1 parent f80ddf1 commit 6051a26
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 0 additions & 6 deletions crates/uv/tests/it/ecosystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ fn transformers() -> Result<()> {
// Source: https://github.com/konstin/warehouse/blob/baae127d90417104c8dee3fdd3855e2ba17aa428/pyproject.toml
#[test]
fn warehouse() -> Result<()> {
// This build requires running `pg_config`. We could
// probably stub it out, but for now, we just skip the
// test if we can't run `pg_config`.
if std::process::Command::new("pg_config").output().is_err() {
return Ok(());
}
// Also, takes too long on non-Linux in CI.
if !cfg!(target_os = "linux") && std::env::var_os(EnvVars::CI).is_some() {
return Ok(());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ requires-python = "==3.11.*"
[options]
exclude-newer = "2024-08-08T00:00:00Z"

[manifest]

[[manifest.dependency-metadata]]
name = "psycopg-c"
version = "3.2.1"

[[package]]
name = "alabaster"
version = "1.0.0"
Expand Down
6 changes: 6 additions & 0 deletions ecosystem/warehouse/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ dev-dependencies = [
requires = ["hatchling"]
build-backend = "hatchling.build"

# Avoid a dependency on `pg_config`
[[tool.uv.dependency-metadata]]
name = "psycopg-c"
version = "3.2.1"
requires-dist = []

[tool.coverage.run]
branch = true
dynamic_context = "test_function"
Expand Down

0 comments on commit 6051a26

Please sign in to comment.