Skip to content

Commit

Permalink
Release commit of QURI Algo
Browse files Browse the repository at this point in the history
Co-authored-by: Ming-Zhi Chung <[email protected]>
Co-authored-by: Henry Liao <[email protected]>
Co-authored-by: Andreas Thomasen <[email protected]>
  • Loading branch information
3 people committed Oct 28, 2024
0 parents commit 348b654
Show file tree
Hide file tree
Showing 78 changed files with 8,884 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 88
extend-select = B950
extend-ignore = E203,E501,E701
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Bug Report
about: Bug report
title: ''
labels: bug
assignees: ''

---

## Bug description

...

## How to reproduce

...

## How to resolve

...
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/small_enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Small Enhancement
about: Small Enhancement
title: ''
labels: enhancement
assignees: ''

---

## Description

...

## Acceptance Criteria

...
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/user_story.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: User Story
about: User story
title: ''
labels: user story
assignees: ''

---

## Story Description

...

## Specifications from the user's point of view

...

## Acceptance Criteria

...

### Sub tasks

- [ ] ...
21 changes: 21 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Setup

runs:
using: "composite"
steps:
- uses: actions/checkout@v3
with:
token: ${{ github.token }}

- name: git config
shell: bash
run: |
git config --global url."https://x-access-token:${{ github.token }}@github.com/".insteadOf https://github.com/
- name: Install Poetry
shell: bash
env:
POETRY_VERSION: 1.4.0
run: |
curl -sSL https://install.python-poetry.org | python -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 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: "daily"
time: "10:00"
timezone: "Asia/Tokyo"
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Issue

This PR closes # .

## Changes

Changes proposed in this pull-request

- ...

## Progress

- [ ] Main implementation written
- [ ] Functions as intended
- [ ] Unit tests have been written
- [ ] readme.md has been updated
34 changes: 34 additions & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Contributor License Agreement

on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]

jobs:
cla:
runs-on: ubuntu-latest

steps:
- name: Get CLA Manager access token
id: cla-token
uses: getsentry/[email protected]
with:
app_id: ${{ secrets.CLA_MANAGER_APP_ID }}
private_key: ${{ secrets.CLA_MANAGER_PRIVATE_KEY}}

- name: cla
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
uses: contributor-assistant/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ steps.cla-token.outputs.token }}
with:
path-to-document: 'https://cla.qunasys.com'
remote-organization-name: 'QunaSys'
remote-repository-name: 'cla'
branch: 'main'
path-to-signatures: 'signatures/v1/cla.json'
custom-notsigned-prcomment: '<br/>Thank you for your submission, we really appreciate it. We ask that $you sign our [Contributor License Agreement](https://cla.qunasys.com) before we can accept your contribution. This CLA will also cover your future contributions submitted to QunaSys. You can sign the CLA by just posting a pull request comment same as the below format.<br/>'
allowlist: dependabot*
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Lint

on:
pull_request:
paths:
- pyproject.toml
- poetry.lock
- quri_algo/**.py
- .flake8
- .github/workflows/lint.yml
push:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: ./.github/actions/setup

- uses: actions/setup-python@v4
with:
python-version: '3.11'

- run: |
poetry install --only lint
- run: poetry run isort quri_algo --check --diff
if: success() || failure()

- run: poetry run black quri_algo --check
if: success() || failure()

- run: poetry run flake8 quri_algo --show-source
if: success() || failure()

- run: poetry run docformatter -c -r quri_algo
if: success() || failure()
55 changes: 55 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Package and release

on:
pull_request:
push:
branches: [main]
release:
types: [published]

jobs:
package:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
# Necessary to get tags for correct versioning
fetch-depth: 0

- uses: ./.github/actions/setup

- run: |
poetry self add "poetry-dynamic-versioning[plugin]"
- uses: actions/setup-python@v4
with:
python-version: '3.11'

- run: |
poetry env use 3.11
poetry build
- uses: actions/upload-artifact@v3
with:
name: QURI Algo packages
path: dist/*
if-no-files-found: error

release:
needs: [package]
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: QURI Algo packages

- name: Install Twine
run: python -m pip install twine

- name: Release to PyPI
run: python -m twine upload *
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.TWINE_API_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
pull_request:
paths:
- pyproject.toml
- poetry.lock
- quri_algo/**.py
- .github/workflows/pytest.yml
push:
branches: [main]

jobs:
pytest:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: ./.github/actions/setup

- uses: actions/setup-python@v4
with:
python-version: '3.11'

- run: |
poetry install
- run: poetry run pytest tests/
30 changes: 30 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Typecheck

on:
pull_request:
paths:
- pyproject.toml
- poetry.lock
- quri_algo/**.py
- mypy.ini
- .github/workflows/typecheck.yml
push:
branches: [main]

jobs:
mypy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: ./.github/actions/setup

- uses: actions/setup-python@v4
with:
python-version: '3.11'

- run: |
poetry install --only main,typecheck
- run: poetry run mypy tests/ quri_algo/
Loading

0 comments on commit 348b654

Please sign in to comment.