Skip to content

Conversation

mlanett
Copy link

@mlanett mlanett commented Oct 13, 2025

Summary

Fixes handling of remote constraint files in requirements.txt.

uv would fail with "Network connectivity is disabled" when trying to recompile a requirements.txt that contains a remote --constraint directive. This is required for AWS MWAA workflows where the constraint must be in the output file.

Cause

When reading the output file for preferences, uv operates in offline mode.
When it would encounter the remote --constraint directive in the output file and try to process it, because it was in offline mode, it would fail with "Network connectivity is disabled".

Fix

The fix is to skip the constraints file in this case because it is not needed for preferences.

This does not affect actual resolution because in true offline mode, the resolution will still fail.

Test Code

There is a new test case compile_with_remote_constraint_in_output.
It sets up a mock server for the constraints file, a mock requirement, then compiles it.
It verifies a successful output which constains the constraint.
It adds the constraint to the output (as per MWAA), then compiles it again.
It verifies successful output again, which would have failed previously.

…nt directive

uv would fail with "Network connectivity is disabled" when trying to recompile a requirements.txt that contains a remote --constraint directive.
This is required for AWS MWAA workflows where the constraint must be in the output file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant