Skip to content

Commit

Permalink
Merge branch 'master' into feature/add-support-for-combined-bosonic-a…
Browse files Browse the repository at this point in the history
…nd-fermionic-heom-baths
  • Loading branch information
hodgestar committed Feb 13, 2023
2 parents 8059a4d + f3189a9 commit 44b19f5
Show file tree
Hide file tree
Showing 168 changed files with 6,520 additions and 10,752 deletions.
9 changes: 2 additions & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ Thank you for contributing to QuTiP! Please make sure you have finished the foll
You can use [pycodestyle](http://pycodestyle.pycqa.org/en/latest/index.html) to check your code automatically
- [ ] Please add tests to cover your changes if applicable.
- [ ] If the behavior of the code has changed or new feature has been added, please also update the documentation in the `doc` folder, and the [notebook](https://github.com/qutip/qutip-notebooks). Feel free to ask if you are not sure.
- [ ] Include the changelog in a file named: `doc/changes/<PR number>.<type>` 'type' can be one of the following: feature, bugfix, doc, removal, misc, or deprecation (see [here](http://qutip.org/docs/latest/development/contributing.html#Changelog%20Generation) for more information).

Delete this checklist after you have completed all the tasks. If you have not finished them all, you can also open a [Draft Pull Request](https://github.blog/2019-02-14-introducing-draft-pull-requests/) to let the others know this on-going work and keep this checklist in the PR description.

**Description**
Describe here the proposed change.

**Related issues or PRs**
Please mention the related issues or PRs here. If the PR fixes an issue, use the keyword fix/fixes/fixed followed by the issue id, e.g. fix #1184

**Changelog**
Give a short description of the PR in a few words. This will be shown in the QuTiP change log after the PR gets merged.
For example:
Fixed error checking for null matrix in essolve.
Added option for specifying resolution in Bloch.save function.
Please mention the related issues or PRs here. If the PR fixes an issue, use the keyword fix/fixes/fixed followed by the issue id, e.g. fix #1184
102 changes: 69 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ on:


jobs:
# The deploy_test job is part of the test of whether we should deploy to PyPI.
# The job will succeed if either the confirmation reference is empty or if the
# confirmation is the selected branch or tag name. It will fail if it is
# nonempty and does not match. All later jobs depend on this job, so that
# they will be immediately cancelled if the confirmation is bad. The
# dependency is currently necessary (2021-03) because GitHub Actions does not
# have a simpler method of cancelling an entire workflow---the normal use-case
# expects to try and run as much as possible despite one or two failures.
# The deploy_test job is part of the test of whether we should deploy to PyPI
# or test.PyPI. The job will succeed if either the confirmation reference is
# empty, 'test' or if the confirmation is the selected branch or tag name.
# It will fail if it is nonempty and does not match. All later jobs depend
# on this job, so that they will be immediately cancelled if the confirmation
# is bad. The dependency is currently necessary (2021-03) because GitHub
# Actions does not have a simpler method of cancelling an entire workflow---
# the normal use-case expects to try and run as much as possible despite one
# or two failures.
deploy_test:
name: Verify PyPI deployment confirmation
runs-on: ubuntu-latest
Expand All @@ -30,8 +31,10 @@ jobs:
- name: Compare confirmation to current reference
shell: bash
run: |
[[ -z $CONFIRM_REF || $GITHUB_REF =~ ^refs/(heads|tags)/$CONFIRM_REF$ ]]
if [[ -z $CONFIRM_REF ]]; then
[[ -z $CONFIRM_REF || $GITHUB_REF =~ ^refs/(heads|tags)/$CONFIRM_REF$ || $CONFIRM_REF == "test" ]]
if [[ $CONFIRM_REF == "test" ]]; then
echo "Build and deploy to test.pypi.org."
elif [[ -z $CONFIRM_REF ]]; then
echo "Build only. Nothing will be uploaded to PyPI."
else
echo "Full build and deploy. Wheels and source will be uploaded to PyPI."
Expand All @@ -46,15 +49,15 @@ jobs:
OVERRIDE_VERSION: ${{ github.event.inputs.override_version }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
# For the sdist we should be as conservative as possible with our
# Python version. This should be the lowest supported version. This
# means that no unsupported syntax can sneak through.
python-version: '3.6'
python-version: '3.8'

- name: Install pip build
run: |
Expand Down Expand Up @@ -87,7 +90,7 @@ jobs:
zip "$zipfile" -r "$stem"
rm -r "$stem"
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: sdist
path: |
Expand All @@ -104,27 +107,27 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
env:
# Set up wheels matrix. This is CPython 3.6--3.10 for all OS targets.
CIBW_BUILD: "cp3{6,7,8,9,10}-*"
# Numpy and SciPy do not supply wheels for i686 for Python 3.10, so we
# skip those too:
CIBW_SKIP: "*-musllinux* cp310-manylinux_i686 cp310-win32"
# Set up wheels matrix. This is CPython 3.8--3.10 for all OS targets.
CIBW_BUILD: "cp3{8,9,10,11}-*"
# Numpy and SciPy do not supply wheels for i686 or win32 for
# Python 3.10+, so we skip those:
CIBW_SKIP: "*-musllinux* cp3{8,9,10,11}-manylinux_i686 cp3{8,9,10,11}-win32"
OVERRIDE_VERSION: ${{ github.event.inputs.override_version }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
# This is about the build environment, not the released wheel version.
python-version: '3.7'
python-version: '3.8'

- name: Install cibuildwheel
run: |
# cibuildwheel does the heavy lifting for us. Originally tested on
# 2.3.0, but should be fine at least up to any minor new release.
python -m pip install 'cibuildwheel==2.3.*'
# 2.11.3, but should be fine at least up to any minor new release.
python -m pip install 'cibuildwheel==2.11.*'
- name: Build wheels
shell: bash
Expand All @@ -134,7 +137,7 @@ jobs:
if [[ ! -z "$OVERRIDE_VERSION" ]]; then echo "$OVERRIDE_VERSION" > VERSION; fi
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl
Expand All @@ -143,10 +146,10 @@ jobs:
deploy:
name: "Deploy to PyPI if desired"
# The confirmation is tested explicitly in `deploy_test`, so we know it is
# either a missing confirmation (so we shouldn't run this job) or a valid
# confirmation. We don't need to retest the value of the confirmation,
# beyond checking that one existed.
if: ${{ github.event.inputs.confirm_ref != '' }}
# either a missing confirmation (so we shouldn't run this job), 'test' or a
# valid confirmation. We don't need to retest the value of the
# confirmation, beyond checking that one existed.
if: ${{ github.event.inputs.confirm_ref != '' && github.event.inputs.confirm_ref != 'test' }}
needs: [deploy_test, build_sdist, build_wheels]
runs-on: ubuntu-latest
env:
Expand All @@ -157,17 +160,17 @@ jobs:

steps:
- name: Download build artifacts to local runner
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.7'
python-version: '3.8'

- name: Verify this is not a dev version
shell: bash
run: |
python -m pip install wheels/*-cp37-cp37m-*.manylinux2010_x86_64.whl
python -m pip install wheels/*-cp38-cp38-manylinux*.whl
python -c 'import qutip; print(qutip.__version__); assert "dev" not in qutip.__version__; assert "+" not in qutip.__version__'
# We built the zipfile for convenience distributing to Windows users on
Expand All @@ -176,3 +179,36 @@ jobs:
run: |
python -m pip install "twine"
python -m twine upload --verbose wheels/*.whl sdist/*.tar.gz
deploy_testpypi:
name: "Deploy to TestPyPI if desired"
if: ${{ github.event.inputs.confirm_ref == 'test' }}
needs: [deploy_test, build_sdist, build_wheels]
runs-on: ubuntu-latest
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }}
TWINE_NON_INTERACTIVE: 1

steps:
- name: Download build artifacts to local runner
uses: actions/download-artifact@v3

- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'

- name: Verify this is not a dev version
shell: bash
run: |
python -m pip install wheels/*-cp38-cp38-manylinux*.whl
python -c 'import qutip; print(qutip.__version__); assert "dev" not in qutip.__version__; assert "+" not in qutip.__version__'
# We built the zipfile for convenience distributing to Windows users on
# our end, but PyPI only needs the tarball.
- name: Upload sdist and wheels to TestPyPI
run: |
python -m pip install "twine"
python -m twine upload --repository testpypi --verbose wheels/*.whl sdist/*.tar.gz
30 changes: 24 additions & 6 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build HTML documentation
name: Build documentation

on:
[push, pull_request]
Expand All @@ -9,9 +9,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'
Expand All @@ -20,6 +20,8 @@ jobs:
run: |
pip install pip --upgrade
python -mpip install -r doc/requirements.txt
sudo apt-get update
sudo apt-get install texlive-full
- name: Install QuTiP from GitHub
run: |
Expand All @@ -31,7 +33,23 @@ jobs:
# because we're importing from the wrong location.
python -c 'import qutip; qutip.about()'
- name: Build documentation
- name: Build PDF documentation
working-directory: doc
run: |
make latexpdf SPHINXOPTS="-W --keep-going -T"
# Above flags are:
# -W : turn warnings into errors
# --keep-going : do not stop after the first error
# -T : display a full traceback if a Python exception occurs
- name: Upload built PDF files
uses: actions/upload-artifact@v3
with:
name: qutip_pdf_docs
path: doc/_build/latex/*
if-no-files-found: error

- name: Build HTML documentation
working-directory: doc
run: |
make html SPHINXOPTS="-W --keep-going -T"
Expand All @@ -40,8 +58,8 @@ jobs:
# --keep-going : do not stop after the first error
# -T : display a full traceback if a Python exception occurs
- name: Upload built files
uses: actions/upload-artifact@v2
- name: Upload built HTML files
uses: actions/upload-artifact@v3
with:
name: qutip_html_docs
path: doc/_build/html/*
Expand Down
Loading

0 comments on commit 44b19f5

Please sign in to comment.