Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial repo setup #1

Merged
merged 6 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This file is being listed as code owner means the user
# will be empowered to approve and merge pull request for
# that directory of code.
#
# qBraid maintainers
* @ryanhill1
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Bug Report
description: Report a Bug 🪳
labels: ["type: bug"]

body:
- type: markdown
attributes:
value: Before submitting, please ensure that this issue has not already been reported by checking existing issues.

- type: textarea
attributes:
label: Environment
description: Please provide details about your environment to help us understand the context of the bug.
value: |
- **Python version**:
- **Operating system**:
validations:
required: true

- type: textarea
attributes:
label: What Happened?
description: Provide a brief description of the issue and steps to reproduce it.
validations:
required: true

- type: textarea
attributes:
label: Expected Outcome
description: Describe what you expected to happen instead of the bug.
validations:
required: true

- type: textarea
attributes:
label: Suggestions for Resolution
description: If you have any suggestions for resolving the issue, please share them here. Your input is valuable, but not required.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Feature Request
description: Suggest a New Feature! 💡
labels: ["type: feature request"]

body:
- type: markdown
attributes:
value: Before submitting your feature request, please ensure it hasn't already been suggested by checking existing issues.

- type: textarea
attributes:
label: Feature Description
description: Clearly describe the feature you would like to see added. Explain why this feature would be beneficial.
validations:
required: true

- type: textarea
attributes:
label: Proposed Implementation
description: |
Do you have a specific implementation in mind for this feature? Please share your ideas or any relevant details here. Your suggestions are greatly appreciated, but not mandatory.
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
*issue tag, if exist*

## Changes:

## Details or comments:

## Checklist before merge
Add an `x` between the boxes braket that apply, meaning to complete the check before any merge happen, feel free to ask help if you are unsure about anything.

### General
- [ ] I have read `CONTRIBUTING.md`.

- [ ] All new code includes corresponding unit tests and satisfies codecov.

- [ ] API Reference docstrings and/or User Guide have been updated to account for new features.

- [ ] All integration tests, including remote tests, are passing.

11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
26 changes: 26 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Docs

on:
pull_request:
branches: ['main']
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: pip
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r docs/requirements.txt
python3 -m pip install -e .
- name: Build docs
run: |
sphinx-build -W -b html docs/ docs/build/html
28 changes: 28 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Formatting check

on:
pull_request:
branches: ['main']
workflow_dispatch:

jobs:
main:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
python3 -m pip install -r requirements-dev.txt
- name: Check isort, pylint, black, headers
run: |
pylint qbraid_qir tests tools
black --check qbraid_qir tests tools
isort --check-only qbraid_qir tests tools
python tools/verify_headers.py qbraid_qir tests
62 changes: 62 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI

on:
pull_request:
branches: ['main']
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Upgrade pip and install build tools
run: |
python -m pip install --upgrade pip
pip install setuptools wheel build
- name: Build the package
run: |
python -m build
- name: Upload built package
uses: actions/upload-artifact@v3
with:
name: built-package
path: dist/*.whl

test:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Download built package
uses: actions/download-artifact@v3
with:
name: built-package
path: dist
- name: Install package
run: |
pip install dist/*.whl
- name: Install pytest
run: |
pip install pytest
- name: Run tests
run: |
pytest tests
42 changes: 42 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Pre-release qbraid to PyPi

on:
# push:
# branches:
# - main
workflow_dispatch:

jobs:
pypi-publish:
name: Build dist & upload to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install build

- name: Build binary wheel + source tarball
id: build-dev
run: |
export QBRAID_PRE_RELEASE_VERSION=$(tools/stamp_dev_version.sh)
[[ "$QBRAID_PRE_RELEASE_VERSION" =~ .*dev.* ]] && echo "Deploying dev version '$QBRAID_PRE_RELEASE_VERSION'" || (echo "not dev version"; exit 0)
out_dir="${PWD}/dist"
tools/create_dev_build.sh $QBRAID_PRE_RELEASE_VERSION "${out_dir}"
echo "dir=$out_dir" >> $GITHUB_OUTPUT

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: ${{ steps.build-dev.outputs.dir }}
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish to PyPI

on:
release:
types: [published]
workflow_dispatch:

jobs:
pypi-publish:
name: Build dist & upload to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Build binary wheel + source tarball
run: |
python3 -m pip install --upgrade pip build
python3 -m build

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/test-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish to TestPyPI

on:
workflow_dispatch:

jobs:
pypi-publish:
name: Build dist & upload to TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Build binary wheel + source tarball
run: |
python3 -m pip install --upgrade pip build
python3 -m build

- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
24 changes: 24 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
tools:
python: "3.10"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: requirements.txt
- method: pip
path: .
extra_requirements:
- docs
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include *.txt *.md
recursive-include docs *.rst *.py *.png *.ico *.txt
recursive-include qbraid_qir *.py
recursive-include tools *.py
prune docs/build/
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
# qbraid-qir
qBraid-SDK QIR transpiler integration

qBraid-SDK extension providing support for QIR conversions

## Local install

```bash
git clone https://github.com/qBraid/qbraid-qir.git
cd qbraid-qir
pip install -e .
```

## Run tests

```bash
pip install -r requirements-dev.txt
pytest tests
```

with coverage report

```bash
pytest --cov=qbraid_qir --cov-report=term tests/
```

## Build docs

```bash
pip install -r docs/requirements.txt
make docs/html
```
Loading