Skip to content
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
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
* **I'm submitting a ...**
- [ ] bug report
- [ ] feature request


* **What is the current behavior?**



* **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem**



* **What is the expected behavior?**



* **What is the motivation / use case for changing the behavior?**



* **Please tell us about your environment:**

- Version:
- Platform:
- Subsystem:


* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
23 changes: 23 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
* **Please check if the PR fulfills these requirements**
- [ ] The commit message follows our guidelines
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)


* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)



* **What is the current behavior?** (You can also link to an open issue here)



* **What is the new behavior (if this is a feature change)?**



* **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?)



* **Other information**:
10 changes: 4 additions & 6 deletions .github/workflows/check_code_format.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
name: Check Code Format
name: Ruff Static Code Analysis

on: pull_request

jobs:
lint:
ruff_static_code_analysis:
name: Ruff Static Code Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
- uses: astral-sh/ruff-action@v2
with:
options: "--check --verbose"
src: "./src"
jupyter: true
version: "~= 24.0"
15 changes: 15 additions & 0 deletions .github/workflows/check_copyright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Copyright Header Check

on: pull_request

jobs:
copyright_header_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check license & copyright headers
uses: viperproject/check-license-header@v2
with:
path:
config: .github/workflows/check_copyright_config.json
# strict: true
13 changes: 13 additions & 0 deletions .github/workflows/check_copyright_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"include": [
"src/**",
"tests/**"
],
"exclude": [
"docs/**",
"**/*.ini"
],
"license": ".github/workflows/copyright.txt"
}
]
24 changes: 24 additions & 0 deletions .github/workflows/check_mkdocs_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check Mkdocs Build

on: pull_request

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Install uv
uses: astral-sh/setup-uv@v4
# - run: cp -r examples/ docs/examples/
- run: uv pip install .[docs] --system
- run: mkdocs build
13 changes: 13 additions & 0 deletions .github/workflows/copyright.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024-2025 Open Quantum Design

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
29 changes: 16 additions & 13 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read
Expand All @@ -21,23 +19,28 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
os:
- ubuntu-latest
- "3.13"

os: [ubuntu-latest, windows-latest, macos-latest]
arch:
- x64
name: Python ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[server]
- name: Run unittest
run: |
python -m unittest discover tests -v

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true

- name: Install the project
run: uv pip install .[tests]

- name: Run tests
run: uv run pytest tests
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,6 @@ cython_debug/

*.sublime-*
*.code-workspace
.github/workflows/_*.yml
.github/workflows/_*.yml

uv.lock
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
Open Quantum Design: Cloud
</h2>

[![doc](https://img.shields.io/badge/documentation-lightblue)](https://docs.openquantumdesign.org/open-quantum-design-cloud)
[![docs](https://img.shields.io/badge/documentation-lightblue)](https://docs.openquantumdesign.org/open-quantum-design-cloud)
[![PyPI Version](https://img.shields.io/pypi/v/oqd-cloud)](https://pypi.org/project/oqd-cloud)
[![CI](https://github.com/OpenQuantumDesign/oqd-cloud/actions/workflows/pytest.yml/badge.svg)](https://github.com/OpenQuantumDesign/oqd-cloud/actions/workflows/pytest.yml)
![versions](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue)
[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg)](https://opensource.org/licenses/Apache-2.0)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)



Expand Down
2 changes: 0 additions & 2 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ plugins:
import:
- https://docs.python.org/3/objects.inv
- https://docs.pydantic.dev/latest/objects.inv
- mkdocs-jupyter:
ignore_h1_titles: True

markdown_extensions:
- attr_list
Expand Down
16 changes: 6 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ classifiers = [
dependencies = [
"requests",
"pydantic>=2.4",
"numpy~=1.0",
"oqd-compiler-infrastructure",
"oqd-core",
"oqd-analog-emulator"
"oqd-core@git+https://github.com/openquantumdesign/oqd-core",
]

[project.optional-dependencies]
Expand All @@ -41,22 +38,21 @@ docs = [
"mkdocstrings",
"mkdocs-material",
"mkdocstrings-python",
"mdx_truly_sane_lists"
]

test = ["unittest_prettify"]
tests = ["pytest"]

server = [
"pydantic>=2.4",
"qutip~=5.0.1",
"asyncpg",
"uvicorn",
"python-jose",
"passlib",
"python-multipart",
#
"oqd-compiler-infrastructure",
"oqd-core",
"oqd-analog-emulator",
"oqd-compiler-infrastructure@git+https://github.com/openquantumdesign/oqd-compiler-infrastructure",
"oqd-core@git+https://github.com/openquantumdesign/oqd-core",
"oqd-compiler-infrastructure@git+https://github.com/openquantumdesign/oqd-analog-emulator",
]


Expand Down
2 changes: 1 addition & 1 deletion src/oqd_cloud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Open Quantum Design
# Copyright 2024-2025 Open Quantum Design

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
8 changes: 4 additions & 4 deletions src/oqd_cloud/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Open Quantum Design
# Copyright 2024-2025 Open Quantum Design

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,12 +14,12 @@


from typing import Literal, Optional
from pydantic import BaseModel, ConfigDict
import requests

import requests
from oqd_core.backend.task import Task
from oqd_cloud.provider import Provider
from pydantic import BaseModel, ConfigDict

from oqd_cloud.provider import Provider

__all__ = ["Job", "Client"]

Expand Down
2 changes: 1 addition & 1 deletion src/oqd_cloud/provider.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Open Quantum Design
# Copyright 2024-2025 Open Quantum Design

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/oqd_cloud/server/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Open Quantum Design
# Copyright 2024-2025 Open Quantum Design

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
10 changes: 5 additions & 5 deletions src/oqd_cloud/server/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Open Quantum Design
# Copyright 2024-2025 Open Quantum Design

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from fastapi import FastAPI
from contextlib import asynccontextmanager

########################################################################################
from fastapi import FastAPI

from oqd_cloud.server.database import engine, Base
from oqd_cloud.server.route import user_router, auth_router, job_router
########################################################################################
from oqd_cloud.server.database import Base, engine
from oqd_cloud.server.route import auth_router, job_router, user_router

########################################################################################

Expand Down
11 changes: 5 additions & 6 deletions src/oqd_cloud/server/database.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Open Quantum Design
# Copyright 2024-2025 Open Quantum Design

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,16 +13,15 @@
# limitations under the License.

import os
from typing import Annotated, Optional, List
from datetime import datetime
from typing import Annotated, List, Optional
from uuid import uuid4
from fastapi import Depends

from dotenv import load_dotenv
from fastapi import Depends
from sqlalchemy import ForeignKey
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, relationship
from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker, AsyncSession

from dotenv import load_dotenv

load_dotenv()

Expand Down
12 changes: 4 additions & 8 deletions src/oqd_cloud/server/jobqueue.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Open Quantum Design
# Copyright 2024-2025 Open Quantum Design

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,20 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import asyncio
import os
from contextlib import asynccontextmanager

from redis import Redis
from rq import Queue

from sqlalchemy import select

import asyncio

from contextlib import asynccontextmanager

########################################################################################

from oqd_cloud.server.database import get_db, JobInDB
from oqd_cloud.server.database import JobInDB, get_db

########################################################################################

Expand Down
Loading
Loading