Skip to content

fix: Drop constraints for cryptography and pact-python#38465

Merged
feanil merged 3 commits intomasterfrom
feanil/drop_constraints
Apr 29, 2026
Merged

fix: Drop constraints for cryptography and pact-python#38465
feanil merged 3 commits intomasterfrom
feanil/drop_constraints

Conversation

@feanil
Copy link
Copy Markdown
Contributor

@feanil feanil commented Apr 28, 2026

The latest version of snowflake-connector-python claims to fix the
underlying issue that caused us to pin cryptography so unpin both of
these and re-build dependencies to see if the issues are resolved.

pact-python was also unpinned in the same pass. Upgrading from 1.x to
3.x introduced a breaking API change in the Verifier class: the
constructor no longer accepts provider/provider_base_url kwargs
(now takes name), and verify_pacts() was replaced by a fluent
builder API (.add_transport(), .add_source(), .state_handler(),
.verify()). The three verify_pact.py pact test files were updated
to use the new API. Failure mode was caught by pylint (E1123/E1120)
rather than at runtime since the pact tests are not run in standard CI.

@feanil feanil force-pushed the feanil/drop_constraints branch from 5088181 to 079645c Compare April 28, 2026 18:22
feanil and others added 3 commits April 28, 2026 14:23
The latest version of snowflake-connector-python claims to fix the
underlying issue that caused us to pin cryptography so unpin both of
these and re-build dependencies to see if the issues are resolved.
pact-python 3.x (released after the 1.x series) ships a new Rust FFI-based
verifier that breaks backward compatibility with the old Ruby-based verifier.

The constructor and verification call both changed:

Old API (pact-python 1.x):
    verifier = Verifier(provider='lms', provider_base_url=url)
    output, _ = verifier.verify_pacts(pact_file, headers=[...], provider_states_setup_url=...)
    assert output == 0

New API (pact-python 3.x):
    Verifier(name='lms')
        .add_transport(url=url)
        .add_source(pact_file)
        .add_custom_header('Pact-Authentication', 'Allow')
        .state_handler(provider_states_setup_url, body=True)
        .verify()

Key differences:
- `provider` → `name`, `provider_base_url` → `.add_transport(url=...)`
- `verify_pacts()` is gone; replaced by fluent `.add_source()` + `.verify()`
- Headers are set individually via `.add_custom_header(name, value)` rather
  than as a list of `Key: Value` strings
- `provider_states_setup_url` becomes `.state_handler(url, body=True)`;
  `body=True` is required for URL-based handlers and matches what the
  provider state views already expect (they read from request.body)
- `verify()` raises RuntimeError on failure instead of returning a non-zero
  exit code, so the `assert output == 0` is no longer needed
- The verifier is now created fresh inside the test method rather than in
  setUpClass, because `add_source` and `add_custom_header` accumulate state
  on the underlying FFI handle — sharing a verifier across multiple test
  invocations would cause duplicate sources/headers on the second run

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@feanil feanil force-pushed the feanil/drop_constraints branch from 079645c to 38eed01 Compare April 28, 2026 18:28
@feanil feanil requested a review from bmtcril April 28, 2026 18:28
Copy link
Copy Markdown
Contributor

@bmtcril bmtcril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay! Looks good after a rebase

@feanil feanil merged commit b041c0a into master Apr 29, 2026
46 checks passed
@feanil feanil deleted the feanil/drop_constraints branch April 29, 2026 13:57
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.

2 participants