Contribution Guidelines
Open Pull Request
If you'd like to contribute by fixing an issue or adding a new feature to prefect-qiskit
,
please open a pull request from a fork of the repository.
Follow these steps to open a pull request:
- Fork the repository:
Create a copy of the repository under your GitHub account. - Clone the forked repository:
Download the repository to your local machine:git clone git@github.com:<your-github-account>/prefect-qiskit.git
- Install the repository with
dev
dependency:pip install -e '.[dev]'
- Update code:
Ensure functions and classes are documented and type hinted. - Add tests:
Write tests that cover the new changes or bug fixes. Confirm your changes don't break any test cases:pytest tests/
- Install
pre-commit
:
Perform code quality checks before committing:pre-commit install
- Commit and push:
Usegit add
,git commit
, andgit push
to update your forked repository and open a pull request.
Provide Vendor Implementation
We welcome the implementation of clients for other quantum computing vendors. Follow these instructions to add support for a new vendor. Feel free to contact us via GitHub issues if you need support.
Protocol and Block
A typical module structure for a specific vendor implementation looks like this:
prefect_qiskit
│ README.md
│ ...
│
└───vendors
│ │ __init__.py
│ │
│ └───vendor_xyz
│ │ __init__.py
│ │ client.py
│ │ credentials.py
- Client file (
client.py
):
Implement theAsyncRuntimeClientInterface
protocol, which is the core of your work. - Credential file (
credentials.py
)
Implement the PrefectCredentialsBlock
to store access credentials for your backend provider.
After implementing the new credential block, add it to the QuantumCredentialsT
alias in prefect_qiskit.vendors.__init__.py
.
This allows QuantumRuntime
to find the data model so that end users can set a credential for your provider on the Prefect console.
Add Test Module
Add test cases for the new vendor to prevent future breaking API changes.
Create a new test module in tests.vendors
.
Ideally, include at least one end-to-end test if it makes sense.
Avoid including real credentials or tests relying on such credentials due to security concerns. If you implement a client for REST API, you can dump the server response in JSON files and write practical test cases against this mock server.
Warning
Remove all secrets from test data to avoid any security risks.
Misc
Update the Supported Vendors list in documentation as well. Add the new vendor module to the API Reference.