Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
astafan8 authored Dec 7, 2021
2 parents 8ad39f8 + 238f4f7 commit 62550c8
Show file tree
Hide file tree
Showing 24 changed files with 3,542 additions and 617 deletions.
17 changes: 17 additions & 0 deletions .github/actions/prepare-cache-pip/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "prepare-cache-pip"
description: "Prepare setup cache of pip wheels"
outputs:
cache-dir:
description: "Pip cache dir"
value: ${{ steps.get-pip-cache-dir.outputs.dir }}
runs:
using: "composite"
steps:
- name: upgrade pip setuptools wheel
run: python -m pip install --upgrade pip setuptools wheel
shell: bash
- name: Get pip cache dir
id: get-pip-cache-dir
run: |
echo "::set-output name=dir::$(pip cache dir)"
shell: bash
10 changes: 10 additions & 0 deletions .github/actions/setup-ubuntu-latest-xvfb/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "setup-ubuntu-latest-xvfb"
description: "Setup xvfb on ubuntu"
runs:
using: "composite"
steps:
- name: Setup xvfb on ubuntu
run: |
sudo apt install xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
shell: bash
102 changes: 102 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: build docs

on:
push:
branches:
- 'master'
- 'release/*'
tags:
- 'v*'
pull_request:

jobs:
builddocs:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
exclude:
- os: windows-latest
python-version: 3.8
- os: windows-latest
python-version: 3.9
env:
DISPLAY: ':99.0'
OS: ${{ matrix.os }}
UPLOAD_TO_GHPAGES: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.7' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: '0'
# if we upload to ghpages we need the full
# history to generate correct version info
if: ${{ fromJSON(env.UPLOAD_TO_GHPAGES) }}
- uses: actions/[email protected]
if: ${{ !fromJSON(env.UPLOAD_TO_GHPAGES) }}
- name: setup ubuntu-latest xvfb
uses: ./.github/actions/setup-ubuntu-latest-xvfb
if: runner.os == 'Linux'
- name: install pandoc linux
run: sudo apt install pandoc
if: runner.os == 'Linux'
- name: Install pandoc on windows
uses: crazy-max/[email protected]
with:
args: install pandoc
if: runner.os == 'Windows'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: prepare pip cache
id: prepare-cache-pip
uses: ./.github/actions/prepare-cache-pip
- name: download requirements
run: |
curl https://raw.githubusercontent.com/QCoDeS/Qcodes/master/requirements.txt > requirements.txt
curl https://raw.githubusercontent.com/QCoDeS/Qcodes/master/test_requirements.txt > test_requirements.txt
curl https://raw.githubusercontent.com/QCoDeS/Qcodes/master/docs_requirements.txt > docs_requirements.txt
- name: pip cache
uses: actions/[email protected]
with:
path: ${{ steps.prepare-cache-pip.outputs.cache-dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/docs_requirements.txt') }}-${{ hashFiles('**/setup.cfg') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- name: install requirements.txt
run: |
pip install -r requirements.txt
- name: install docs_requirements.txt
run: |
pip install -r docs_requirements.txt
- name: install qcodes
run: pip install .
- name: Build docs on linux
run: |
cd docs
export SPHINXOPTS="-W -v"
make html
if: runner.os == 'Linux'
- name: Build docs on windows
run: |
cd docs
$env:SPHINXOPTS = "-W -v"
./make.bat html
if: runner.os == 'Windows'
- name: Upload build docs
uses: actions/upload-artifact@v2
with:
name: docs_${{ matrix.python-version }}_${{ matrix.os }}
path: ${{ github.workspace }}/docs/_build/html
- name: Deploy to gh pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: ${{ github.workspace }}/docs/_build/html
clean: true
single-commit: true
git-config-email: "bot"
git-config-name: "Documentation Bot"
if: ${{ fromJSON(env.UPLOAD_TO_GHPAGES) }}
78 changes: 78 additions & 0 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Run mypy and pytest

on:
push:
branches:
- 'master'
- 'release/*'
- 'staging'
- 'trying'
tags:
- 'v*'
pull_request:

jobs:
pytestmypy:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
exclude:
- os: windows-latest
python-version: 3.8
- os: windows-latest
python-version: 3.9
env:
DISPLAY: ':99.0'
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/[email protected]
with:
submodules: true
- name: setup ubuntu-latest xvfb
uses: ./.github/actions/setup-ubuntu-latest-xvfb
if: runner.os == 'Linux'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}

- name: download requirements
run: |
curl https://raw.githubusercontent.com/QCoDeS/Qcodes/master/requirements.txt > requirements.txt
curl https://raw.githubusercontent.com/QCoDeS/Qcodes/master/test_requirements.txt > test_requirements.txt
curl https://raw.githubusercontent.com/QCoDeS/Qcodes/master/docs_requirements.txt > docs_requirements.txt
- name: prepare pip cache
id: prepare-cache-pip
uses: ./.github/actions/prepare-cache-pip
- name: pip cache
uses: actions/[email protected]
with:
path: ${{ steps.prepare-cache-pip.outputs.cache-dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/test_requirements.txt') }}-${{ hashFiles('**/setup.cfg') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- name: install requirements.txt
run: |
pip install -r requirements.txt
- name: install test_requirements.txt
run: |
pip install -r test_requirements.txt
- name: install package
run: |
pip install .
- name: Run Mypy
run: mypy qcodes_contrib_drivers
- name: Run tests
run: |
pytest --cov=qcodes_contrib_drivers --cov-report xml --cov-config=setup.cfg qcodes_contrib_drivers
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
file: ./coverage.xml
env_vars: OS,PYTHON
31 changes: 31 additions & 0 deletions .github/workflows/upload_to_pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Upload Python Package

on:
push:
tags:
- v*

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.7'
- name: Install build deps
run: pip install --upgrade pip setuptools wheel build
- name: Build
run: |
python -m build
- name: Install Twine
run: pip install twine
- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,7 @@ venv.bak/

#Pycharm
.idea

# System files
*.DS_Store
desktop.ini
7 changes: 6 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ Install the contrib drivers with ``pip``
pip install qcodes_contrib_drivers
Drivers documentation
*********************

The documentations of the drivers in this repository can be read `here <https://qcodes.github.io/Qcodes_contrib_drivers>`_.

Contributing
############

Expand All @@ -46,4 +51,4 @@ LICENSE
#######

QCoDeS-Contrib-drivers is licensed under the MIT license except the ``Tektronix AWG520`` and
``Tektronix Keithley 2700`` drivers which are licensed under the GPL 2 or later License.
``Tektronix Keithley 2700`` drivers which are licensed under the GPL 2 or later License.
Loading

0 comments on commit 62550c8

Please sign in to comment.