11# Contributing to devqubit
22
3- Thanks for your interest in contributing to ** devqubit** ! This guide keeps contributions easy, safe, and predictable.
3+ Thanks for your interest in devqubit! 🎉
44
5- - Please follow our community rules in ** CODE_OF_CONDUCT.md** .
6- - For security issues, ** do not** open a public issue (see [ Security] ( #security ) ).
7- - Questions / support: prefer ** GitHub Discussions** (Issues are for actionable bugs/requests).
5+ Whether it's a typo fix, bug report, new adapter, or a wild feature idea — we appreciate it all. This guide will get you set up quickly.
86
9- ## Project tooling
10-
11- This repository uses:
7+ - Follow our community standards in [ CODE_OF_CONDUCT.md ] ( CODE_OF_CONDUCT.md )
8+ - For security issues, ** do not ** open a public issue — see [ Security ] ( #security )
9+ - Questions or support: use [ GitHub Discussions ] ( https://github.com/devqubit-labs/devqubit/discussions ) (Issues are for actionable bugs/requests)
1210
13- - ** uv** for dependency management and ** workspaces** (monorepo)
14- - ** pre-commit** for formatting/linting and repository hygiene checks
15- - ** pytest** for tests
16- - ** towncrier** for changelog fragments (only for user-facing changes)
17-
18- CI runs:
19- - ` pre-commit ` (lint/format)
20- - ` pytest ` on multiple Python versions (matrix)
11+ ## Where to start?
2112
13+ - Browse [ open issues] ( https://github.com/devqubit-labs/devqubit/issues ) for bugs or feature requests
14+ - Propose an idea or ask questions in [ Discussions] ( https://github.com/devqubit-labs/devqubit/discussions )
15+ - Pick anything that interests you — even small fixes matter
2216## Quickstart
2317
2418``` bash
2519git clone https://github.com/devqubit-labs/devqubit.git
2620cd devqubit
2721
28- # Create/update .venv and install the workspace environment from uv.lock.
29- # --all-packages installs all workspace members.
30- # dev dependencies are synced by default (unless you opt out
22+ # Install all workspace packages
3123uv sync --locked --all-packages
3224
33- # OPTIONAL: install all extras (optional dependencies) as well
25+ # (Optional) Include all extras (adapters, UI, etc.)
3426uv sync --locked --all-packages --all-extras
3527
3628# Install git hooks (required)
3729uv run pre-commit install
3830
39- # Run checks + tests (this should match CI)
31+ # Run checks and tests
4032uv run pre-commit run --all-files
4133uv run pytest
4234```
4335
44- ### Faster local setup (optional )
36+ ### Minimal setup (faster )
4537
46- If you only want the core packages and want to avoid heavy adapter/UI dependencies:
38+ If you only need core packages without heavy adapter/UI dependencies:
4739
4840``` bash
4941uv sync --locked --all-packages
@@ -53,180 +45,177 @@ uv run pytest
5345## Prerequisites
5446
5547- Git
56- - A supported Python version (see ` requires-python ` in ` pyproject.toml ` )
57- - uv (installation docs): https://docs.astral.sh/uv/getting-started/installation/
48+ - Python (see ` requires-python ` in ` pyproject.toml ` for supported versions )
49+ - [ uv ] ( https://docs.astral.sh/uv/getting-started/installation/ )
5850
59- ## Workspace (monorepo) notes
51+ ## Project structure
6052
61- This repo is a ** uv workspace** (multiple packages managed together). By default:
53+ ```
54+ devqubit/ # Metapackage (re-exports from engine)
55+ packages/
56+ ├── devqubit-engine/ # Core: tracking, storage, comparison, CLI
57+ ├── devqubit-ui/ # FastAPI web interface
58+ ├── devqubit-qiskit/ # Qiskit adapter
59+ ├── devqubit-qiskit-runtime/ # IBM Runtime adapter
60+ ├── devqubit-braket/ # Amazon Braket adapter
61+ ├── devqubit-cirq/ # Google Cirq adapter
62+ └── devqubit-pennylane/ # PennyLane adapter
63+ ```
6264
63- - ` uv sync --all-packages ` installs the workspace root and all workspace members.
64- - ` uv run <cmd> ` runs a command inside the workspace virtual environment.
65+ ## Project tooling
6566
66- Run commands against a specific workspace member (optional):
67+ | Tool | Purpose |
68+ | ------| ---------|
69+ | ** uv** | Dependency management, workspaces (monorepo) |
70+ | ** pre-commit** | Formatting, linting, repo hygiene |
71+ | ** pytest** | Testing |
72+ | ** towncrier** | Changelog generation |
6773
68- ``` bash
69- uv run --package < PACKAGE_NAME > < command >
70- ```
74+ CI runs ` pre-commit ` and ` pytest ` across multiple Python versions.
75+
76+ ## Workspace (monorepo)
7177
72- Examples:
78+ This repo uses ** uv workspaces ** — multiple packages managed together.
7379
7480``` bash
81+ # Install all packages
82+ uv sync --all-packages
83+
84+ # Run command in workspace environment
85+ uv run < cmd>
86+
87+ # Run command for a specific package
7588uv run --package devqubit-engine pytest
7689uv run --package devqubit-engine python -m devqubit --help
7790```
7891
79- ## Pre-commit (required)
92+ ## Pre-commit hooks
8093
81- Install the git hook (runs on every commit) :
94+ Pre-commit is ** required ** . Install once :
8295
8396``` bash
8497uv run pre-commit install
8598```
8699
87- Run all hooks manually (this should match CI):
100+ Run manually (matches CI):
88101
89102``` bash
90103uv run pre-commit run --all-files
91104```
92105
93- Run a single hook or file :
106+ Run a specific hook:
94107
95108``` bash
96109uv run pre-commit run < hook_id> --files path/to/file.py
97110```
98111
99- ## Changelog (towncrier) — only for user-facing changes
100-
101- We keep ` CHANGELOG.md ` generated by ** towncrier** from fragments in ` changelog.d/ ` .
102-
103- ### When to add a fragment
112+ ## Running tests
104113
105- Add a fragment ** only** if the change is user-facing, for example:
114+ ``` bash
115+ # Full suite
116+ uv run pytest
106117
107- - New API/CLI features or options
108- - Behavior changes (including breaking changes)
109- - Bug fixes that users would notice
110- - Deprecations / removals
111- - Security fixes
118+ # Stop on first failure
119+ uv run pytest -x
112120
113- Do ** not** add a fragment for internal refactors, tests, CI, formatting-only changes, etc.
121+ # Single file or test
122+ uv run pytest path/to/test_file.py
123+ uv run pytest -k test_name_substring
124+ ```
114125
115- ### Where to put it
126+ ## Making changes
116127
117- Fragments go in ` changelog.d/ ` with the type in the filename:
128+ ### Branching
118129
119- - ` changelog.d/<PR_NUMBER>.<type>.md ` (e.g. ` changelog.d/123.fixed.md ` )
120- - For orphan fragments: ` changelog.d/+<description>.<type>.md ` (e.g. ` changelog.d/+workspace-selector.added.md ` )
130+ Branch from ` main ` :
121131
122- Available types: ` added ` , ` changed ` , ` fixed ` , ` deprecated ` , ` removed ` , ` security `
132+ - ` feat/<short-description> ` — features
133+ - ` fix/<short-description> ` — bug fixes
134+ - ` docs/<short-description> ` — documentation
123135
124- Keep fragments short (1–3 lines) and user-facing (what changed for the user, not how it was implemented).
136+ ### Pull request checklist
125137
126- ### Validating fragments (optional)
138+ Before requesting review:
127139
128- If you added fragments, you can validate them locally:
140+ - [ ] ` uv run pre-commit run --all-files ` passes
141+ - [ ] ` uv run pytest ` passes
142+ - [ ] New/changed behavior is covered by tests
143+ - [ ] User-facing changes include a changelog fragment
144+ - [ ] User-facing changes are documented (README/docs/examples)
129145
130- ``` bash
131- uv run towncrier build --draft
132- ```
146+ ### Code style
133147
134- ### Building the changelog for a version
148+ - Prefer clear, readable code over clever code
149+ - Avoid breaking public APIs without discussion
150+ - Keep changes compatible with supported Python versions
135151
136- To generate CHANGELOG.md with a specific version heading (and consume/remove the used fragments from changelog.d/), run:
152+ ## Changelog (towncrier)
137153
138- ``` bash
139- uv run towncrier build --version < VERSION>
140- ```
154+ We generate ` CHANGELOG.md ` from fragments in ` changelog.d/ ` .
141155
142- ## Running tests
156+ ### When to add a fragment
143157
144- Run the full test suite :
158+ Add a fragment ** only ** for user-facing changes :
145159
146- ``` bash
147- uv run pytest
148- ```
160+ - New API/CLI features
161+ - Behavior changes (including breaking)
162+ - Bug fixes users would notice
163+ - Deprecations, removals
164+ - Security fixes
149165
150- Useful variants:
166+ ** Skip ** for: internal refactors, tests, CI, formatting.
151167
152- ``` bash
153- # stop on first failure
154- uv run pytest -x
168+ ### Fragment format
155169
156- # run a single file or test
157- uv run pytest path/to/test_file.py
158- uv run pytest -k test_name_substring
170+ ```
171+ changelog.d/<PR_NUMBER>.<type>.md
172+ changelog.d/+<description>.<type>.md # orphan (no PR yet)
159173```
160174
161- ## Making changes
162-
163- ### Branching
164-
165- Create a branch from ` main ` :
166-
167- - ` feat/<short-description> ` for features
168- - ` fix/<short-description> ` for bug fixes
169- - ` docs/<short-description> ` for documentation changes
170-
171- ### Pull requests
172-
173- Keep PRs focused and small when possible. If a change is large, split it into incremental PRs.
174-
175- ** Before requesting review, ensure:**
176-
177- - ` uv run pre-commit run --all-files ` passes
178- - ` uv run pytest ` passes
179- - New/changed behavior is covered by tests
180- - User-facing changes include a towncrier fragment in ` changelog.d/ `
181- - User-facing changes are documented (README/docs/examples) when applicable
175+ Types: ` added ` , ` changed ` , ` fixed ` , ` deprecated ` , ` removed ` , ` security `
182176
183- ### Style and compatibility
177+ Keep fragments short (1–3 lines), user-focused.
184178
185- - Prefer clear, readable code over clever code.
186- - Avoid breaking public APIs without discussion.
187- - Keep changes compatible with the supported Python versions in ` pyproject.toml ` .
179+ ### Validate locally
188180
189- ## Adding or updating dependencies
181+ ``` bash
182+ uv run towncrier build --draft
183+ ```
190184
191- If you change dependencies:
185+ ## Dependencies
192186
193- 1 . Update the relevant ` pyproject.toml ` (or use ` uv add ` / ` uv remove ` )
194- 2 . Update the lockfile and re-sync:
187+ When changing dependencies:
195188
196189``` bash
190+ # Update pyproject.toml (or use uv add / uv remove)
197191uv lock
198192uv sync --locked --all-packages
199193```
200194
201- If you want to upgrade locked versions:
195+ Upgrade all locked versions:
202196
203197``` bash
204198uv lock --upgrade
205199uv sync --locked --all-packages
206200```
207201
208- Tip: If ` uv sync --locked ` fails, it usually means uv.lock is out of date - run ` uv lock ` and commit the updated lockfile.
209-
210- ## Documentation
211-
212- - If your change affects the CLI, update help text, docs, or examples.
213- - If your change affects the output format (bundles/artifacts), document it clearly and add tests.
202+ > ** Tip:** If ` uv sync --locked ` fails, run ` uv lock ` and commit the updated lockfile.
214203
215204## Reporting bugs
216205
217- When filing a bug report, please include :
206+ Include :
218207
219- - What you expected vs what happened
220- - Your OS and Python version
221- - devqubit version / git commit
222- - A minimal reproduction (ideally a small snippet or command)
208+ - What you expected vs. what happened
209+ - OS and Python version
210+ - devqubit version or git commit
211+ - Minimal reproduction (code snippet or command)
223212
224213## Security
225214
226- Please do ** not** report security vulnerabilities via public GitHub issues.
215+ ** Do not** report security vulnerabilities via public GitHub issues.
227216
228- Use GitHub “Report a vulnerability” ( Private Vulnerability Reporting).
217+ Use GitHub's [ Private Vulnerability Reporting] ( https://github.com/devqubit-labs/devqubit/security/advisories/new ) .
229218
230219## License
231220
232- By contributing, you agree that your contributions are licensed under the project’s license ( Apache-2.0), unless explicitly stated otherwise .
221+ By contributing, you agree that your contributions are licensed under [ Apache-2.0] ( LICENSE ) .
0 commit comments