Skip to content

Commit aec3305

Browse files
authored
setting up the repository (#1)
1 parent d91bd87 commit aec3305

38 files changed

+5414
-24
lines changed

.coveragerc

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[run]
2+
parallel = True
3+
branch = True
4+
source =
5+
braket
6+
omit =
7+
**/braket/default_simulator/openqasm/parser/generated/*
8+
**/braket/device_schema/**
9+
**/braket/ir/**
10+
**/braket/task_result/**
11+
12+
[paths]
13+
source =
14+
src/braket/simulatorv_v2
15+
.tox/*/lib/python*/site-packages/braket
16+
17+
[report]
18+
show_missing = True
19+
ignore_errors = True
20+
exclude_lines =
21+
# Have to re-enable the standard pragma
22+
pragma: no cover
23+
24+
# Don't complain if tests don't hit defensive assertion code:
25+
raise NotImplementedError
26+
27+
[html]
28+
directory = build/coverage
29+
30+
[xml]
31+
output = build/coverage/coverage.xml

.github/ISSUE_TEMPLATE/bug_report.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Bug report
3+
about: File a report to help us reproduce and fix the problem
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To reproduce**
14+
A clear, step-by-step set of instructions to reproduce the bug.
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Screenshots or logs**
20+
If applicable, add screenshots or logs to help explain your problem.
21+
22+
**System information**
23+
A description of your system. Please provide:
24+
- **Amazon Braket Python SDK version**:
25+
- **Amazon Braket Python Schemas version**:
26+
- **Amazon Braket Python Default Simulator version**:
27+
- **Python version**:
28+
29+
**Additional context**
30+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Ask a question
4+
url: https://repost.aws/tags/TAhMWeHkpfSMSCxIFNqcqYog/amazon-braket
5+
about: Use AWS re:Post to ask and answer questions.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Documentation request
3+
about: Request improved documentation
4+
title: ''
5+
labels: 'documentation'
6+
assignees: ''
7+
8+
---
9+
10+
**What did you find confusing? Please describe.**
11+
A clear and concise description of what you found confusing. Ex. I tried to [...] but I didn't understand how to [...]
12+
13+
**Describe how documentation can be improved**
14+
A clear and concise description of where documentation was lacking and how it can be improved.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the documentation request here.
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest new functionality for this library
4+
title: ''
5+
labels: 'feature'
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the feature you'd like**
11+
A clear and concise description of the functionality you want.
12+
13+
**How would this feature be used? Please describe.**
14+
A clear and concise description of the use case for this feature. Please provide an example, if possible.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Set update schedule for GitHub Actions
2+
3+
version: 2
4+
updates:
5+
6+
- package-ecosystem: "github-actions"
7+
directory: "/"
8+
schedule:
9+
# Check for updates to GitHub Actions every week
10+
interval: "weekly"
11+
commit-message:
12+
prefix: infra

.github/pull_request_template.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
*Issue #, if available:*
2+
3+
*Description of changes:*
4+
5+
*Testing done:*
6+
7+
## Merge Checklist
8+
9+
_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request._
10+
11+
#### General
12+
13+
- [ ] I have read the [CONTRIBUTING](https://github.com/amazon-braket/amazon-braket-simulator-v2-python/blob/main/CONTRIBUTING.md) doc
14+
- [ ] I used the commit message format described in [CONTRIBUTING](https://github.com/amazon-braket/amazon-braket-simulator-v2-python/blob/main/CONTRIBUTING.md#commit-your-change)
15+
- [ ] I have updated any necessary documentation, including [READMEs](https://github.com/amazon-braket/amazon-braket-simulator-v2-python/blob/main/README.md) and [API docs](https://github.com/amazon-braket/amazon-braket-simulator-v2-python/blob/main/CONTRIBUTING.md#documentation-guidelines) (if appropriate)
16+
17+
#### Tests
18+
19+
- [ ] I have added tests that prove my fix is effective or that my feature works (if appropriate)
20+
- [ ] I have checked that my tests are not configured for a specific region or account (if appropriate)
21+
22+
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

.github/workflows/check-format.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Check code format
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
- feature/**
11+
12+
jobs:
13+
check-code-format:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.9'
21+
- name: Install dependencies
22+
run: |
23+
pip install tox
24+
- name: Run code format checks
25+
run: |
26+
tox -e linters_check

.github/workflows/code-freeze.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Code Freeze
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
env:
13+
FROZEN: ${{ vars.FROZEN }}
14+
UNFROZEN_PREFIX: ${{ vars.UNFROZEN_PREFIX }}
15+
16+
jobs:
17+
check-pr-frozen-status:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Fetch PR data and check if merge allowed
21+
if: env.FROZEN == 'true'
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: |
25+
PR_DATA=$(curl -s \
26+
-H "Authorization: Bearer $GITHUB_TOKEN" \
27+
-H "Accept: application/vnd.github.v3+json" \
28+
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }})
29+
BRANCH_NAME=$(echo $PR_DATA | jq .head.ref -r)
30+
PR_TITLE=$(echo $PR_DATA | jq .title -r)
31+
32+
echo $BRANCH_NAME
33+
echo $PR_TITLE
34+
35+
# if it's not a critical fix
36+
if ! [[ "$PR_TITLE" == fix\(critical\):* ]]; then
37+
# and there's an unfrozen prefix
38+
if ! [[ -z $UNFROZEN_PREFIX ]]; then
39+
# check if the branch matches unfrozen prefix
40+
if [[ "$BRANCH_NAME" != $UNFROZEN_PREFIX* ]]; then
41+
echo "Error: You can only merge from branches that start with '$UNFROZEN_PREFIX', or PRs titled with prefix 'fix(critical): '."
42+
exit 1
43+
fi
44+
# repo is fully frozen
45+
else
46+
echo "Error: You can only merge PRs titled with prefix 'fix(critical): '."
47+
exit 1
48+
fi
49+
fi

.github/workflows/python-package.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ main ]
9+
pull_request:
10+
branches: [ main, feature/** ]
11+
12+
jobs:
13+
build:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
python-version: ["3.9", "3.10", "3.11"]
19+
steps:
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Set up Julia
25+
uses: julia-actions/setup-julia@v1
26+
with:
27+
version: '1'
28+
- name: Get Python Simulator
29+
uses: actions/checkout@v4
30+
with:
31+
path: python_sim
32+
- name: Get Julia Simulator
33+
uses: actions/checkout@v4
34+
with:
35+
repository: amazon-braket/BraketSimulator.jl
36+
token: ${{secrets.TEMP_PAT_EXP_JUL_28}}
37+
ref: main
38+
path: julia_sim
39+
- name: Install dependencies
40+
run: |
41+
pip install tox
42+
- name: Setup Julia Simulator for Windows
43+
run: |
44+
(Get-Content python_sim/src/braket/juliapkg.json).Replace('git@github.com:amazon-braket/BraketSimulator.jl.git', ("${env:GITHUB_WORKSPACE}\julia_sim").Replace('\','\\')) | Set-Content python_sim/src/braket/juliapkg.json
45+
cat python_sim/src/braket/juliapkg.json
46+
if: runner.os == 'Windows'
47+
- name: Setup Julia Simulator for non-Windows
48+
run: |
49+
sed -ie "s#git@github.com:amazon-braket/BraketSimulator.jl.git#$GITHUB_WORKSPACE/julia_sim#" python_sim/src/braket/juliapkg.json
50+
cat python_sim/src/braket/juliapkg.json
51+
if: runner.os != 'Windows'
52+
- name: Run Tests
53+
run: |
54+
cd python_sim
55+
tox -e unit-tests
56+
- name: Upload coverage report to Codecov
57+
uses: codecov/codecov-action@v3
58+
if: ${{ strategy.job-index }} == 0

.github/workflows/stale_issue.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "Close stale issues"
2+
3+
# Controls when the action will run.
4+
# This is every day at 10am
5+
on:
6+
schedule:
7+
- cron: "0 10 * * *"
8+
9+
jobs:
10+
cleanup:
11+
runs-on: ubuntu-latest
12+
name: Stale issue job
13+
steps:
14+
- uses: aws-actions/stale-issue-cleanup@v6
15+
with:
16+
# Setting messages to an empty string will cause the automation to skip
17+
# that category
18+
ancient-issue-message: Greetings! It looks like this issue hasn’t been active in longer than three years. We encourage you to check if this is still an issue in the latest release. Because it has been longer than three years since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment to prevent automatic closure, or if the issue is already closed, please feel free to reopen it.
19+
stale-issue-message: Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.
20+
stale-pr-message: Greetings! It looks like this PR hasn’t been active in longer than a week, add a comment or an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.
21+
22+
# These labels are required
23+
stale-issue-label: closing-soon
24+
exempt-issue-label: auto-label-exempt
25+
stale-pr-label: closing-soon
26+
exempt-pr-label: pr/needs-review
27+
response-requested-label: response-requested
28+
29+
# Don't set closed-for-staleness label to skip closing very old issues
30+
# regardless of label
31+
closed-for-staleness-label: closed-for-staleness
32+
33+
# Issue timing
34+
days-before-stale: 7
35+
days-before-close: 4
36+
days-before-ancient: 1095
37+
38+
# If you don't want to mark a issue as being ancient based on a
39+
# threshold of "upvotes", you can set this here. An "upvote" is
40+
# the total number of +1, heart, hooray, and rocket reactions
41+
# on an issue.
42+
minimum-upvotes-to-exempt: 1
43+
44+
repo-token: ${{ secrets.GITHUB_TOKEN }}
45+
loglevel: DEBUG
46+
# Set dry-run to true to not perform label or close actions.
47+
dry-run: false

.github/workflows/twine-check.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Check long description for PyPI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- feature/**
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
twine-check:
14+
name: Check long description
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.x'
22+
- name: Install wheel
23+
run: python -m pip install --user --upgrade wheel
24+
- name: Install twine
25+
run: python -m pip install --user --upgrade twine
26+
- name: Install setuptools
27+
run: python -m pip install --user --upgrade setuptools
28+
- name: Build a binary wheel and a source tarball
29+
run: python setup.py sdist bdist_wheel
30+
- name: Check that long description will render correctly on PyPI.
31+
run: twine check dist/*

.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
*~
2+
*#
3+
*.swp
4+
*.idea
5+
*.iml
6+
build_files.tar.gz
7+
8+
.ycm_extra_conf.py
9+
.tox
10+
.python-version
11+
12+
__pycache__/
13+
*.py[cod]
14+
*$py.class
15+
*.egg-info/
16+
*.ipynb_checkpoints/
17+
pip-wheel-metadata/
18+
19+
coverage.xml
20+
/.coverage
21+
/.coverage.*
22+
/.cache
23+
/.pytest_cache
24+
/.mypy_cache
25+
26+
/doc/_apidoc/
27+
/build
28+
/venv
29+
/dist
30+
*.DS_Store

CODEOWNERS

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
2+
3+
# These owners will be the default owners for everything in
4+
# the repo. Unless a later match takes precedence, these accounts
5+
# will be requested for review when someone opens a pull request.
6+
* @amazon-braket/braket-maintainers

0 commit comments

Comments
 (0)