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

Add repo setup 2 #6

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
431af74
Add editorconfig following Qiskit/qiskit-terra#6033
ElePT Jul 17, 2023
e08a343
Add git blame ignore file following Qiskit/qiskit-terra#6362
ElePT Jul 17, 2023
60d7957
Copy git ignore from qiskit-machine-learning
ElePT Jul 17, 2023
34b789c
Add mailmap
ElePT Jul 17, 2023
a670329
Add mergify
ElePT Jul 17, 2023
82ca18c
Add empty pylintdict
ElePT Jul 17, 2023
ec83bd2
Copy pylintrc from qiskit-machine-learning
ElePT Jul 17, 2023
42bbb55
Copy stestr.conf from qiskit-machine-learning
ElePT Jul 17, 2023
0e8c580
Copy code of conduct
ElePT Jul 17, 2023
8c983ab
Copy contributing and license
ElePT Jul 17, 2023
1207c83
Add manifest
ElePT Jul 17, 2023
ae92353
Add makefile
ElePT Jul 17, 2023
9f68feb
Add incomplete readme
ElePT Jul 17, 2023
ccffb4b
Copy constraints, mypy ini, pyproject.toml from qiskit-machine-learning
ElePT Jul 17, 2023
3c36bc8
Add requirements
ElePT Jul 17, 2023
10c290a
Add setup
ElePT Jul 17, 2023
43684ac
Add tox.ini
ElePT Jul 17, 2023
b79e823
Add tools
ElePT Jul 17, 2023
af5de6d
Add releasenotes
ElePT Jul 17, 2023
57e466d
Add github setup
ElePT Jul 17, 2023
d09f75d
Add version and py.typed
ElePT Jul 17, 2023
8a9eaa3
Apply suggestions from Steve's code review
ElePT Jul 17, 2023
c3dcbf0
Add optionals
ElePT Jul 17, 2023
4cc5888
Move optionals
ElePT Jul 18, 2023
0014738
Remove duplicates
ElePT Jul 18, 2023
75fc4ca
Merge basic setup
ElePT Jul 18, 2023
49bb306
Update codeowners
ElePT Jul 18, 2023
be8f07b
Remove docs, tutorials, sphinx, etc
ElePT Jul 18, 2023
c189a02
remove neko
ElePT Jul 18, 2023
963807f
Remove aer from workflow
ElePT Jul 18, 2023
a13f3c2
Add suggestions
ElePT Jul 18, 2023
2df436b
Merge branch 'add-repo-setup' of https://github.com/ElePT/qiskit-algo…
ElePT Jul 18, 2023
6245603
Add rustworkx to requirements-dev
ElePT Jul 18, 2023
2ccfd06
Merge branch 'main' of https://github.com/ElePT/qiskit-algorithms int…
ElePT Jul 18, 2023
c4d348a
Replace .pylintrc with pyproject.toml
ElePT Jul 19, 2023
5ef998e
Keep files minimal
ElePT Jul 19, 2023
948ede8
Merge branch 'add-repo-setup' of https://github.com/ElePT/qiskit-algo…
ElePT Jul 19, 2023
54754a8
Remove mypy
ElePT Jul 19, 2023
d5bd9f0
Disable spelling and copyright check
ElePT Jul 19, 2023
8a15213
Fix coverage run
ElePT Jul 19, 2023
6ecab47
Remove if
ElePT Jul 19, 2023
1268003
Remove combine deprecations
ElePT Jul 19, 2023
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
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file defines the persons who will be assigned as reviewers for PRs that
# modify particular files in the repo. The PR can be merged when approved by at
# least one codeowner. However, all Qiskit team members can (and should!) review the PRs.

# Global rule, unless specialized by a later one
* @Cryoris @woodsp-ibm @ElePT

50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: 🐛 Bug report
description: Create a report to help us improve 🤔.
labels: ["bug"]

body:
- type: markdown
attributes:
value: Thank you for reporting! Please also use the search to see if there are any other relevant issues or pull requests.

- type: textarea
attributes:
label: Environment
description: For the version of Algorithms, please give the actual version number (_e.g._ 0.18.3) if you are using a release version, or the first 7-8 characters of the commit hash if you have installed from `git`. If anything else is relevant, you can add it to the list.
# The trailing spaces on the following lines are to make filling the form
# in easier. The type is 'textarea' rather than three separate 'input's
# to make the resulting issue body less noisy with headings.
value: |
- **Qiskit Algorithms version**:
- **Python version**:
- **Operating system**:
validations:
required: true

- type: textarea
attributes:
label: What is happening?
description: A short description of what is going wrong, in words.
validations:
required: true

- type: textarea
attributes:
label: How can we reproduce the issue?
description: Give some steps that show the bug. A [minimal working example](https://stackoverflow.com/help/minimal-reproducible-example) of code with output is best. If you are copying in code, please remember to enclose it in triple backticks (` ``` [multiline code goes here] ``` `) so that it [displays correctly](https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax).
validations:
required: true

- type: textarea
attributes:
label: What should happen?
description: A short description, including about the expected output of any code in the previous section.
validations:
required: true

- type: textarea
attributes:
label: Any suggestions?
description: Not required, but if you have suggestions for how a contributor should fix this, or any problems we should be aware of, let us know.
validations:
required: false
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 🚀 Feature request
description: Suggest an idea for this project 💡!
labels: ["type: feature request"]

body:
- type: markdown
attributes:
value: Please make sure to browse the opened and closed issues to make sure that this idea has not previously been discussed.

- type: textarea
attributes:
label: What should we add?
validations:
required: true
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--
⚠️ If you do not respect this template, your pull request will be closed.
⚠️ Your pull request title should be short detailed and understandable for all.
⚠️ Also, please add it in the CHANGELOG file under Unreleased section.
⚠️ If your pull request fixes an open issue, please link to the issue.
✅ I have added the tests to cover my changes.
✅ I have updated the documentation accordingly.
✅ I have read the CONTRIBUTING document.
-->

### Summary



### Details and comments


22 changes: 22 additions & 0 deletions .github/actions/install-algorithms/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

name: 'Install Qiskit Algorithms'
description: 'Installs Qiskit Algorithms'

runs:
using: "composite"
steps:
- run : |
pip install -e .
pip install -U -c constraints.txt -r requirements-dev.txt
shell: bash
78 changes: 78 additions & 0 deletions .github/actions/install-main-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021, 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

name: 'Install Qiskit Algorithms Main Dependencies'
description: 'Installs Python dependencies from Main'
inputs:
os:
description: 'OS'
required: true
python-version:
description: 'Python version'
required: true
terra-main:
description: 'Use Terra main'
required: true
runs:
using: "composite"
steps:
- name: Get main last commit ids
run: |
echo "TERRA_HASH=$(git ls-remote --heads https://github.com/Qiskit/qiskit-terra.git refs/heads/main | awk '{print $1}')" >> $GITHUB_ENV
shell: bash
- name: Terra Cache
env:
CACHE_VERSION: v1
id: terra-cache
uses: actions/cache@v3
with:
path: terra-cache
key: terra-cache-${{ inputs.os }}-${{ inputs.python-version }}-${{ env.TERRA_HASH }}-${{ env.CACHE_VERSION }}
- name: Install Terra from Main
env:
MACOSX_DEPLOYMENT_TARGET: 10.15
run: |
if [ "${{ inputs.terra-main }}" == "true" ]; then
echo 'Install Terra from Main'
BASE_DIR=terra-cache
build_from_main=true
cache_hit=${{ steps.terra-cache.outputs.cache-hit }}
echo "cache hit: ${cache_hit}"
if [ "$cache_hit" == "true" ]; then
pip_result=0
pushd "${BASE_DIR}"
python -m pip install *.whl && pip_result=$? || pip_result=$?
popd
if [ $pip_result == 0 ]; then
build_from_main=false
fi
else
mkdir -p ${BASE_DIR}
fi
if [ "$build_from_main" == "true" ]; then
echo 'Create wheel file from main'
pip install -U wheel setuptools_rust
git clone --depth 1 --branch main https://github.com/Qiskit/qiskit-terra.git /tmp/qiskit-terra
pushd /tmp/qiskit-terra
python setup.py bdist_wheel
popd
cp -rf /tmp/qiskit-terra/dist/*.whl "${BASE_DIR}"
pushd "${BASE_DIR}"
python -m pip install *.whl
popd
pip uninstall -y setuptools_rust
fi
else
echo 'Install Terra from Stable'
pip install -U qiskit-terra
fi
shell: bash
43 changes: 43 additions & 0 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

name: 'Run Unit Tests'
description: 'Run Unit Tests'
inputs:
os:
description: 'OS'
required: true
event-name:
description: 'Actions event'
required: true
run-slow:
description: 'Run slow tests or not'
required: true
python-version:
description: 'Python version'
required: true
runs:
using: "composite"
steps:
- name: Run Unit Tests
env:
PYTHONWARNINGS: default
run: |
# run slow tests only on scheduled event or if input flag is set
if [ "${{ inputs.event-name }}" == "schedule" ] || [ "${{ inputs.run-slow }}" == "true" ]; then
export QISKIT_TESTS="run_slow"
fi
if [ "${{ inputs.os }}" == "ubuntu-latest" ] && [ "${{ inputs.python-version }}" == "3.8" ]; then
export PYTHON="coverage3 run --source qiskit_algorithms --parallel-mode"
fi
stestr --test-path test run 2> >(tee /dev/stderr out.txt > /dev/null)
shell: bash
39 changes: 39 additions & 0 deletions .github/workflows/deploy-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021, 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

name: Deploy Code

on:
push:
tags:
- '*'

jobs:
code_publish:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Deploy to Pypi
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: qiskit
run : |
pip install -U twine pip setuptools virtualenv wheel
python3 setup.py sdist bdist_wheel
twine upload dist/qiskit*
shell: bash
Loading