Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhill1 committed May 9, 2024
0 parents commit 0e4e7cb
Show file tree
Hide file tree
Showing 42 changed files with 3,074 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Bug report 🚩
description: Create a report to help us improve
title: "[BUG] "
labels: [bug]

body:
- type: markdown
attributes:
value: "Thanks for taking the time to fill out our bug report form."

- type: textarea
attributes:
label: Environment
value: |
- **qbraid-algorithms version**:
- **Python version**:
- **Operating system**:
validations:
required: true

- type: textarea
attributes:
label: What happened?
description: Please provide a detailed description of the bug, accompanied by a minimal code example that demonstrates how the error(s) can be reproduced.
validations:
required: true

- type: textarea
attributes:
label: Suggestions (Optional)
description: We warmly welcome any recommendations on potential fixes, insights, or considerations that contributors should keep in mind when working to resolve this issue.
validations:
required: false
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Feature request 💡
description: Suggest an idea for this project
title: "[FEATURE] "
labels: [enhancement]

body:
- type: markdown
attributes:
value: "Thank you for taking the time to suggest a feature. Please fill out the details below to help us understand your idea better."

- type: textarea
id: feature-description
attributes:
label: Feature Description
description: "Describe the feature you'd like and the problem it solves. Include any specific use cases that illustrate its benefits."
placeholder: "Please describe the feature in detail."
validations:
required: true

- type: textarea
attributes:
label: Implementation (Optional)
description: "Do you have an idea for how this could be implemented? Please include those details here."
validations:
required: false
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- Please link or tag any issues that is PR closes -->

## Changes
27 changes: 27 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build Docs

on:
pull_request:
branches: ['main']
push:
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.11'
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -e '.[docs]'
- name: Build docs
run: |
sphinx-build -W -b html docs docs/build/html
26 changes: 26 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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.11'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install black[jupyter] isort qbraid-cli
- name: Check isort, black, headers
run: |
black --check qbraid_algorithms examples tests tools
isort --check-only qbraid_algorithms tests tools
qbraid admin headers qbraid_algorithms tests tools
70 changes: 70 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI

on:
pull_request:
branches: ['main']
push:
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: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']

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: |
if ($env:RUNNER_OS -eq "Windows") {
Get-ChildItem dist/*.whl | ForEach-Object { pip install $_.FullName }
} else {
pip install dist/*.whl
}
shell: pwsh
- name: Install testing dependencies
run: |
pip install pytest
- name: Run tests with pytest
run: |
pytest tests
37 changes: 37 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Pre-release to PyPI

on:
workflow_dispatch:

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

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

- name: Install build dependencies
run: python -m pip install -U pip wheel build toml-cli qbraid-core

- name: Build binary wheel + source tarball
id: build-dev
run: |
export PRE_RELEASE_VERSION=$(python tools/stamp_pre_release.py)
[[ "$PRE_RELEASE_VERSION" =~ .*(-a\.|-b\.|-rc\.).* ]] && echo "Deploying pre-release version '$PRE_RELEASE_VERSION'" || (echo "not pre-release version"; exit 0)
out_dir="${PWD}/dist"
tools/create_dev_build.sh $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 }}
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish to PyPI

on:
workflow_dispatch:

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

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

- 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 }}
Loading

0 comments on commit 0e4e7cb

Please sign in to comment.