Skip to content

Commit

Permalink
Merge AQT version, support new portal. (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
airwoodix authored Sep 25, 2023
2 parents c09e2a2 + d3420c1 commit 5fda86c
Show file tree
Hide file tree
Showing 83 changed files with 11,081 additions and 1,436 deletions.
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ labels: documentation
assignees: ''

---


2 changes: 0 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@


### Details and comments


29 changes: 0 additions & 29 deletions .github/workflows/docs.yml

This file was deleted.

83 changes: 0 additions & 83 deletions .github/workflows/main.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/poetry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Tests
on:
push:
branches: [ master, 'stable/*' ]
pull_request:
branches: [ master, 'stable/*' ]
jobs:
tests:
name: tests-python${{ matrix.python-version }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
poetry-version: [1.5.1]
os: ["ubuntu-latest"]
steps:
- uses: actions/checkout@v3
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Check Poetry lock file status
run: poetry lock --check
- name: Check shell scripts
uses: ludeeus/[email protected]
- name: Install coverage tool
run: |
poetry run pip install coverage[toml]
- name: Install examples dependencies (Py3.11)
run: |
poetry install --only main --extras examples
# tweedledum has no wheel for Python3.11 and the build errors
if: matrix.python-version == '3.11'
- name: Install examples dependencies (~Py3.11)
run: |
poetry install --only main --all-extras
if: matrix.python-version != '3.11'
- name: Run examples
run: |
poetry run examples/run_all.sh -c
- name: Install all dependencies
run: poetry install --sync
- name: Check formatting
run: poetry run poe format_check
- name: Linting
run: poetry run poe lint
- name: Type checking
run: poetry run poe typecheck
- name: Testing
run: poetry run poe test --cov_opts="-a" # add to examples coverage
- name: Docs
run: poetry run poe docs
- name: Generate HTML coverage report
run: poetry run coverage html --show-contexts
- name: Upload HTML coverage report
uses: actions/upload-artifact@v3
with:
name: html-coverage
path: htmlcov/
- name: Generate XML coverage report
run: poetry run coverage xml -o coverage.xml
# - name: Read global coverage target
# id: coverage-target
# run: echo "fail-under=$(poetry run python scripts/read-target-coverage.py)" >> $GITHUB_OUTPUT
# - name: Post coverage comment
# if: ${{ github.event_name == 'pull_request' }}
# uses: orgoro/coverage@v3
# with:
# coverageFile: coverage.xml
# token: ${{ secrets.GITHUB_TOKEN }}
# thresholdAll: ${{ steps.coverage-target.outputs.fail-under }}
# thresholdNew: 0
# thresholdModified: 0
38 changes: 25 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,41 @@ name: Release Artifacts
on:
push:
tags:
- '*'
- 'v*'
jobs:
wheel-build:
name: Build and Publish Release Artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
- name: Checkout code
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Deps
run: pip install -U twine wheel
- name: Build Artifacts
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.5.1'
- name: Install release dependencies
run: pip install -U twine wheel typer mistletoe
- name: Build packages
run: |
python setup.py sdist
python setup.py bdist_wheel
poetry build
shell: bash
- uses: actions/upload-artifact@v2
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
path: ./dist/qiskit*
- name: Publish to PyPi
- name: Extract changelog
run: python scripts/extract-changelog.py ${{ github.ref_name }} | tee ${{ github.workspace }}-CHANGELOG.txt
- name: Create Github release
uses: softprops/action-gh-release@v1
with:
files: ./dist/qiskit*
body_path: ${{ github.workspace }}-CHANGELOG.txt
- name: Publish to PyPI
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: qiskit
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_USERNAME: __token__
run: twine upload dist/qiskit*
3 changes: 3 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ Ali Javadi-Abhari <[email protected]> <[email protected]>
Ali Javadi-Abhari <[email protected]> <[email protected]>
Matthew Treinish <[email protected]> <[email protected]>
Paul Nation <[email protected]> <[email protected]>
Wilfried Huss <[email protected]> <[email protected]>
Etienne Wodey <[email protected]> <[email protected]>
Albert Frisch <[email protected]> <[email protected]>
109 changes: 109 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
[mypy]
# Show error codes in error messages.
show_error_codes = True

# Arguments with a default value of None are not implicitly Optional.
no_implicit_optional = True

# Prohibit equality checks, identity checks, and container checks between non-overlapping types.
strict_equality = True

# Warns about casting an expression to its inferred type.
warn_redundant_casts = True

# Warns about unneeded # type: ignore comments.
warn_unused_ignores = True

# Warns when mypy configuration contains unknown options
warn_unused_configs = True

# Shows errors for missing return statements on some execution paths.
warn_no_return = True

# Check unannotated functions for type errors
check_untyped_defs = True

# Disallows defining functions without type annotations or with incomplete type annotations.
disallow_untyped_defs = True

# Disallows defining functions with incomplete type annotations.
disallow_incomplete_defs = True

# Disallows calling functions without type annotations from functions with type annotations.
disallow_untyped_calls = True

# Reports an error whenever a function with type annotations is decorated with
# a decorator without annotations.
disallow_untyped_decorators = True

# Shows a warning when returning a value with type Any from a function declared
# with a non-Any return type.
warn_return_any = True

# Shows a warning when encountering any code inferred to be
# unreachable or redundant after performing type analysis.
warn_unreachable = True

# Disallows usage of types that come from unfollowed imports
# (anything imported from an unfollowed import is automatically given a type of Any).
disallow_any_unimported = False

# Disallows all expressions in the module that have type Any.
disallow_any_expr = False

# Disallows functions that have Any in their signature after decorator transformation.
disallow_any_decorated = False

# Disallows explicit Any in type positions such as type annotations and generic type parameters.
disallow_any_explicit = False

# Disallows usage of generic types that do not specify explicit type parameters.
disallow_any_generics = True

# Disallows subclassing a value of type Any.
disallow_subclassing_any = False

# By default, imported values to a module are treated as exported and mypy allows
# other modules to import them. When false, mypy will not re-export unless the item
# is imported using from-as or is included in __all__.
# Note that mypy treats stub files as if this is always disabled.
implicit_reexport = True

# Use an SQLite database to store the cache.
sqlite_cache = False

# Include fine-grained dependency information in the cache for the mypy daemon.
cache_fine_grained = False

# --------------------------------------------------------------------------------------------------
# End of default settings
# --------------------------------------------------------------------------------------------------

exclude = (?x)(
# Python virtual environment
^venv/
| ^build/
| ^docs/
| ^tools/
)

[mypy-mistletoe.*]
ignore_missing_imports = True

# [mypy-numpy.*]
# ignore_missing_imports = True

[mypy-qiskit.*]
ignore_missing_imports = True

[mypy-qiskit_aer.*]
ignore_missing_imports = True

[mypy-qiskit_experiments.*]
ignore_missing_imports = True

[mypy-scipy.*]
ignore_missing_imports = True

[mypy-tweedledum.*]
ignore_missing_imports = True
Loading

0 comments on commit 5fda86c

Please sign in to comment.