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

GitHub ci #4

Merged
merged 7 commits into from
Jul 19, 2024
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
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
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_parts_qsci
- .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.9'

- run: |
poetry install --only lint

- run: poetry run isort quri_parts_qsci --check --diff
if: success() || failure()

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

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

- run: poetry run docformatter -c -r quri_parts_qsci
if: success() || failure()
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_parts_qsci
- .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.9'

- run: |
poetry install

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

on:
pull_request:
paths:
- pyproject.toml
- poetry.lock
- quri_parts_qsci
- 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.9'

- run: |
poetry install --only typecheck

- run: poetry run mypy quri_parts_qsci
- run: poetry run mypy tests
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# QURI Parts QSCI


QURI Parts QSCI an open source library for executing the [Quantum Selected Configuration Interaction (QSCI) algorithm.](https://arxiv.org/abs/2311.01105)
QURI Parts QSCI is an open source library for executing the [Quantum Selected Configuration Interaction (QSCI) algorithm.](https://arxiv.org/abs/2311.01105)



## Installation

QURI Parts requires Python 3.9.8 or later. Use `pip` to install QURI Parts QSCI.
QURI Parts QSCI requires Python 3.9.8 or later. Use `pip` to install QURI Parts QSCI.

```
pip install quri-parts-qsci
Expand All @@ -16,7 +16,6 @@ pip install quri-parts-qsci
### Installation from local source tree

If you check out the QURI Parts QSCI repository and want to install from that local source tree, you can use `requirements-local.txt`.
In `requirements-local.txt`, optional components are commented out, so please uncomment them as necessary.

```
pip install -r requirements-local.txt
Expand Down
9 changes: 9 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@ mypy_path = quri_parts_qsci

[mypy-scipy.*]
ignore_missing_imports = True

[mypy-numpy.*]
ignore_missing_imports = True

[mypy-quri_parts.*]
ignore_missing_imports = True

[mypy-pytest.*]
ignore_missing_imports = True
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.1.0"
description = ""
authors = ["QunaSys"]
readme = "README.md"
packages = [
{ include = "quri_parts_qsci" }
]

[tool.poetry.dependencies]
python = "^3.9.8,<3.12"
Expand Down
Loading