Hello everyone. I'd like to know if we have a meth...
# pact-python
a
Hello everyone. I'd like to know if we have a method to publish contract programmatically in Pact V3. I have the below code in Pact V2, but I haven't find out an example to do the same in V3.
Copy code
pact: Pact = Consumer(
            name=self.consumer_name,
            version=self.pact_version_manager.get_publish_version(),
            branch=self.pact_version_manager.get_branch_version(),
            tags=self.tags,
        ).has_pact_with(
            Provider(self.provider_name),
            publish_to_broker=True,
            broker_base_url=self.pact_settings.get_host(),
            broker_username=self.pact_settings.get_username(),
            broker_password=self.pact_settings.get_password(),
            pact_dir="./pacts",
        )
Thanks in advance.
y
the api has been removed as the pact broker client is no longer bundled with the pact core in the move from ruby to rust. the cli is available via pypi https://pact-foundation.github.io/pact-python/pact-python-cli/?h=cli or can separately installed. we have since rewritten the cli in rust which is available here https://docs.pact.io/implementation_guides/cli/pact-cli
☝️ 1