Skip to content

Commit

Permalink
Merge pull request #93 from cda-tum/predictor_paths_integration
Browse files Browse the repository at this point in the history
Predictor paths integration
  • Loading branch information
nquetschlich authored Sep 1, 2022
2 parents 4c06813 + 529e42d commit 5595f97
Show file tree
Hide file tree
Showing 78 changed files with 4,926 additions and 5,021 deletions.
18 changes: 18 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[flake8]
extend-select = B9
extend-ignore = E203, E231, E501, E722, W503, B950, B014, W504, E123, E126, E226, E121
per-file-ignores = __init__.py:F401
max-line-length = 120
show-source = true
exclude =
.git,
.idea,
.eggs,
__pycache__,
.tox,
docs/source/conf.py,
build,
.nox,
venv,
.venv
application-import-names = mqt.bench
2 changes: 1 addition & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ coverage:
threshold: 0.5%
patch:
default:
threshold: 1%
threshold: 1%
16 changes: 9 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
interval: "weekly"
day: "friday"
time: "06:00"
timezone: "Europe/Berlin"
assignees:
- "nquetschlich"
reviewers:
- "nquetschlich"
- package-ecosystem: "github-actions"
directory: "/"
directory: "/"
schedule:
interval: "weekly"
day: "friday"
time: "06:00"
day: "friday"
time: "06:00"
timezone: "Europe/Berlin"
assignees:
- "nquetschlich"
- "nquetschlich"
36 changes: 17 additions & 19 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,27 @@ name: CodeCov

on:
push:
branches: [ main, master ]
branches: [main, master]
pull_request:
branches: [ main, master ]
branches: [main, master]
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: snow-actions/[email protected]
with:
patterns: "mqt"
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install MQT Bench
run: pip install .\[all\]
- name: Generate Report
run: |
pip install pytest-cov
pytest -v --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install MQT Bench
run: pip install -e .
- name: Generate Report
run: |
pip install pytest-cov
pytest -v --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
54 changes: 26 additions & 28 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,68 @@ name: Deploy to PyPI

on:
release:
types: [ published ]
types: [published]
push:
branches: [ main, master ]
branches: [main, master]
pull_request:
branches: [ main, master ]
branches: [main, master]
workflow_dispatch:

jobs:
build_wheel:
name: Build wheel
name: Build wheel
runs-on: ubuntu-latest
steps:
- uses: snow-actions/[email protected]
with:
patterns: "mqt"
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
- name: Install dependencies
run: python -m pip install build
python-version: "3.8"
name: Install Python
- name: Build wheel
run: python -m build --wheel
run: pipx run build --wheel
- name: Install wheel
run: python -m pip install --verbose dist/*.whl
- name: Run tests
run: |
pip install pytest
pytest mqt/benchviewer/src/tests/test_backend.py -k 'test_flask_server'
- uses: actions/upload-artifact@v3
with:
path: dist/*.whl

build_sdist:
name: Build source distribution
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: snow-actions/[email protected]
with:
patterns: "mqt"
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
- name: Install dependencies
run: python -m pip install build
python-version: "3.8"
name: Install Python
- name: Build sdist
run: python -m build --sdist
run: pipx run build --sdist
- name: Install sdist
run: python -m pip install --verbose dist/*.tar.gz
- name: Run tests
run: |
pip install pytest
pytest mqt/benchviewer/src/tests/test_backend.py -k 'test_flask_server'
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

upload_pypi:
needs: [ build_wheel, build_sdist ]
needs: [build_wheel, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
user: __token__
password: ${{ secrets.pypi_password }}
skip_existing: true
verbose: true


verbose: true
6 changes: 2 additions & 4 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ jobs:
Black:
runs-on: ubuntu-latest
steps:
- uses: snow-actions/[email protected]
with:
patterns: "mqt"
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: "3.8"
- name: Black
uses: psf/black@stable
44 changes: 44 additions & 0 deletions .github/workflows/server_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Based on: https://zartman.xyz/blog/gh-static-deploy/
name: Server Deployment
on:
push:
branches:
- main
workflow_dispatch:

env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
KNOWN_HOSTS: ${{ secrets.KNOWN_HOSTS }}
CDA_HOST_NAME: tueicda-cda.srv.mwn.de
CDA_USER_NAME: web-user
CDA_TARGET_DIR: /var/www/cda/app/
CDA_GIT_DIR: .git/

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install wheel
run: pip install wheel
- name: Install MQT Bench
run: pip install .
- name: Run tests
run: |
pip install pytest-cov
pytest -v
- name: Setup SSH via the stored Action Secrets
run: |
mkdir -p ~/.ssh
echo "${KNOWN_HOSTS}" >> ~/.ssh/known_hosts
echo "${DEPLOY_KEY}" > ~/.ssh/my_rsync_key
echo "IdentityFile ~/.ssh/my_rsync_key" >> ~/.ssh/config
chmod -R 700 ~/.ssh
- name: Deployment on Webserver
working-directory: ${{ github.workspace }}
run: |
rsync -avz --update -e ssh --cvs-exclude --exclude "*__pycache__/" --exclude "*.qasm" . ${CDA_USER_NAME}@${CDA_HOST_NAME}:${CDA_TARGET_DIR}
52 changes: 0 additions & 52 deletions .github/workflows/server_deployment.yml

This file was deleted.

5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
### Manually added
/hist_output/*
/qasm_output/*
/benchviewer/static/files/qasm_output_big
/benchviewer/static/files/qasm_output_small

*.qasm

.idea/*
*.DS_Store
*hist_output/*png
Expand Down
Loading

0 comments on commit 5595f97

Please sign in to comment.