Skip to content

Commit 6c116dd

Browse files
PhilReinholdstephteojcjaskula-awsaspcompilerPrasahnt Sivarajah
committed
Initial commit
Co-authored-by: Philip Reinhold <[email protected]> Co-authored-by: Stephanie Teo <[email protected]> Co-authored-by: Jean-Christophe Jaskula <[email protected]> Co-authored-by: Li Chen <[email protected]> Co-authored-by: Prasahnt Sivarajah <[email protected]> Co-authored-by: Peter Karalekas <[email protected]>
0 parents  commit 6c116dd

28 files changed

+5547
-0
lines changed

.github/workflows/test.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: test
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
10+
jobs:
11+
check-install:
12+
strategy:
13+
matrix:
14+
os: [ ubuntu-latest ]
15+
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
16+
runs-on: ${{ matrix.os }}
17+
steps:
18+
- name: Check out OQpy
19+
uses: actions/checkout@v3
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
id: setup-python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install OQpy using pip
28+
run: pip install .
29+
30+
- name: Import OQpy and print version
31+
run: python -c "import oqpy; print(oqpy.__version__)"
32+
33+
check-style:
34+
strategy:
35+
matrix:
36+
os: [ ubuntu-latest ]
37+
python-version: [ "3.10" ]
38+
runs-on: ${{ matrix.os }}
39+
steps:
40+
- name: Check out OQpy
41+
uses: actions/checkout@v3
42+
43+
- name: Set up Python ${{ matrix.python-version }}
44+
uses: actions/setup-python@v4
45+
with:
46+
python-version: ${{ matrix.python-version }}
47+
48+
- name: Install poetry
49+
run: |
50+
make install-poetry
51+
poetry --version
52+
poetry config virtualenvs.in-project true
53+
54+
- name: Load cached venv
55+
id: cached-venv
56+
uses: actions/cache@v2
57+
with:
58+
path: .venv
59+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
60+
61+
- name: Install dependencies
62+
if: steps.cached-venv.outputs.cache-hit != 'true'
63+
run: poetry install --no-root
64+
65+
- name: Run black
66+
run: poetry run make check-format
67+
68+
- name: Run mypy
69+
run: poetry run make check-mypy
70+
71+
- name: Run pylint
72+
run: poetry run make check-pylint
73+
74+
- name: Run pydocstyle
75+
run: poetry run make check-pydocstyle
76+
77+
- name: Install OQpy using pip
78+
run: poetry run pip install .
79+
80+
- name: Build and check docs
81+
run: poetry run make docs
82+
83+
check-tests:
84+
strategy:
85+
matrix:
86+
os: [ ubuntu-latest ]
87+
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
88+
runs-on: ${{ matrix.os }}
89+
steps:
90+
- name: Check out OQpy
91+
uses: actions/checkout@v3
92+
93+
- name: Set up Python ${{ matrix.python-version }}
94+
id: setup-python
95+
uses: actions/setup-python@v4
96+
with:
97+
python-version: ${{ matrix.python-version }}
98+
99+
- name: Install poetry
100+
run: |
101+
make install-poetry
102+
poetry --version
103+
poetry config virtualenvs.in-project true
104+
105+
- name: Load cached venv
106+
id: cached-venv
107+
uses: actions/cache@v2
108+
with:
109+
path: .venv
110+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
111+
112+
- name: Install dependencies
113+
if: steps.cached-venv.outputs.cache-hit != 'true'
114+
run: poetry install --no-root
115+
116+
- name: Install OQpy using pip
117+
run: poetry run pip install .
118+
119+
- name: Run pytest
120+
run: poetry run make check-tests

.gitignore

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# Auto generated doc files
2+
docs/_auto
3+
4+
# Byte-compiled / optimized / DLL files
5+
__pycache__/
6+
*.py[cod]
7+
*$py.class
8+
9+
# C extensions
10+
*.so
11+
12+
# Distribution / packaging
13+
.Python
14+
build/
15+
develop-eggs/
16+
dist/
17+
downloads/
18+
eggs/
19+
.eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
wheels/
26+
share/python-wheels/
27+
*.egg-info/
28+
.installed.cfg
29+
*.egg
30+
MANIFEST
31+
32+
# PyInstaller
33+
# Usually these files are written by a python script from a template
34+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
35+
*.manifest
36+
*.spec
37+
38+
# Installer logs
39+
pip-log.txt
40+
pip-delete-this-directory.txt
41+
42+
# Unit test / coverage reports
43+
htmlcov/
44+
.tox/
45+
.nox/
46+
.coverage
47+
.coverage.*
48+
.cache
49+
nosetests.xml
50+
coverage.xml
51+
*.cover
52+
.hypothesis/
53+
.pytest_cache/
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
local_settings.py
62+
db.sqlite3
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# celery beat schedule file
88+
celerybeat-schedule
89+
90+
# SageMath parsed files
91+
*.sage.py
92+
93+
# Environments
94+
.venv
95+
env/
96+
venv/
97+
ENV/
98+
env.bak/
99+
venv.bak/
100+
101+
# Spyder project settings
102+
.spyderproject
103+
.spyproject
104+
105+
# Rope project settings
106+
.ropeproject
107+
108+
# mkdocs documentation
109+
/site
110+
111+
# mypy
112+
.mypy_cache/
113+
.dmypy.json
114+
dmypy.json
115+
116+
# Pyre type checker
117+
.pyre/
118+
119+
# PyCharm
120+
.idea/
121+
122+
#osx files
123+
.DS_Store
124+
125+
# Scratch notebooks
126+
scratch.ipynb
127+
examples/scratch/
128+
docs/examples/scratch/
129+
docs/examples/scratch
130+
scratch/
131+
Untitled.ipynb
132+
133+
# AWS Serverless Application Model (SAM)
134+
.aws-sam/
135+
136+
# VSCode
137+
.vscode/

CODE_OF_CONDUCT.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Code of Conduct
2+
3+
All members of this project agree to adhere to the [Qiskit Code of Conduct][qiskit-coc].
4+
5+
[qiskit-coc]: https://github.com/Qiskit/qiskit/blob/main/CODE_OF_CONDUCT.md

CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Contributing to OQpy
2+
3+
Thanks for your interest in contributing!
4+
5+
Please make sure you follow our [code of conduct][coc] at all times.
6+
7+
We encourage contributions of the following forms:
8+
9+
* Filing bug reports (use [the issue tracker on GitHub][new-issue]).
10+
* Helping answer questions in [existing issues][issue-list].
11+
* Fixing reported bugs via pull requests (but please file the bug report first).
12+
13+
When you make your first pull request, a bot will comment and ask you to sign the contributor
14+
license agreement (CLA). This certifies that you agree to license your contributions under the
15+
[terms of the license in the repository root][license], and that we can distribute them for you.
16+
17+
[coc]: https://github.com/openqasm/oqpy/blob/main/CODE_OF_CONDUCT.md
18+
[new-issue]: https://github.com/openqasm/oqpy/issues/new
19+
[issue-list]: https://github.com/openqasm/oqpy/issues
20+
[license]: https://github.com/openqasm/oqpy/blob/main/LICENSE

0 commit comments

Comments
 (0)