Skip to content

Commit

Permalink
Update upstream packages
Browse files Browse the repository at this point in the history
* Use docs-versions-menu instead of doctr-versions-menu
* Use Python 3.8 as main development version
* Use latest QuTiP, Scipy, and Numpy packages
* Drop support for Python 3.5
  • Loading branch information
goerz committed May 28, 2021
1 parent c9e7883 commit cfe6b10
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 96 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
- uses: actions/checkout@v2

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

- name: Install apt packages
run: sudo apt-get install graphviz imagemagick pandoc pandoc-citeproc
Expand Down Expand Up @@ -50,12 +50,12 @@ jobs:
steps:

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

- name: Install deploy requirements
run: pip install git+https://github.com/goerz/doctr_versions_menu.git@master#egg=doctr_versions_menu
run: pip install docs-versions-menu

- name: Get branch name
shell: bash
Expand Down Expand Up @@ -96,8 +96,8 @@ jobs:
shell: bash
run: rm -rf _krotov_docs

- name: Run doctr-versions-menu
run: doctr-versions-menu
- name: Run docs-versions-menu
run: docs-versions-menu

- name: Get the previous commit message
id: get_previous_commit
Expand Down
48 changes: 24 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
include:
- title: Codestyle and Main Tests
os: ubuntu-18.04
python: 3.7
python: 3.8
commands: |
$tox -e run-blackcheck,run-isortcheck
$tox -e py37-test -- $default_tests
$tox -e py38-test -- $default_tests
coverage: true
- title: Oldest supported Python
os: ubuntu-18.04
python: 3.5
commands: $tox -e py35-test -- $default_tests
python: 3.6
commands: $tox -e py36-test -- $default_tests
coverage: false
- title: QuTiP master
os: ubuntu-18.04
Expand All @@ -40,53 +40,53 @@ jobs:
coverage: false
- title: MacOS
os: macos-latest
python: 3.7
commands: $tox -e py37-test -- $default_tests docs/notebooks/01_example_simple_state_to_state.ipynb
python: 3.8
commands: $tox -e py38-test -- $default_tests docs/notebooks/01_example_simple_state_to_state.ipynb
coverage: true
- title: Notebook 1 (State-to-State)
os: ubuntu-18.04
python: 3.7
commands: $tox -e py37-test -- docs/notebooks/01_example_simple_state_to_state.ipynb
python: 3.8
commands: $tox -e py38-test -- docs/notebooks/01_example_simple_state_to_state.ipynb
coverage: true
- title: Notebook 2 (RWA)
os: ubuntu-18.04
python: 3.7
commands: $tox -e py37-test -- docs/notebooks/02_example_lambda_system_rwa_complex_pulse.ipynb
python: 3.8
commands: $tox -e py38-test -- docs/notebooks/02_example_lambda_system_rwa_complex_pulse.ipynb
coverage: true
- title: Notebook 3 (Non-Hermitian)
os: ubuntu-18.04
python: 3.7
commands: $tox -e py37-test -- docs/notebooks/03_example_lambda_system_rwa_non_hermitian.ipynb
python: 3.8
commands: $tox -e py38-test -- docs/notebooks/03_example_lambda_system_rwa_non_hermitian.ipynb
coverage: true
- title: Notebook 4 (Density Matrix)
os: ubuntu-18.04
python: 3.7
commands: $tox -e py37-test -- docs/notebooks/04_example_dissipative_qubit_reset.ipynb
python: 3.8
commands: $tox -e py38-test -- docs/notebooks/04_example_dissipative_qubit_reset.ipynb
coverage: true
- title: Notebook 5 (Quantum Gate)
os: ubuntu-18.04
python: 3.7
commands: $tox -e py37-test -- docs/notebooks/05_example_transmon_xgate.ipynb
python: 3.8
commands: $tox -e py38-test -- docs/notebooks/05_example_transmon_xgate.ipynb
coverage: true
- title: Notebook 6 (3 States)
os: ubuntu-18.04
python: 3.7
commands: $tox -e py37-test -- docs/notebooks/06_example_3states.ipynb
python: 3.8
commands: $tox -e py38-test -- docs/notebooks/06_example_3states.ipynb
coverage: true
- title: Notebook 7 (Perfect Entanglers)
os: ubuntu-18.04
python: 3.7
commands: $tox -e py37-test -- docs/notebooks/07_example_PE.ipynb
python: 3.8
commands: $tox -e py38-test -- docs/notebooks/07_example_PE.ipynb
coverage: true
- title: Notebook 8 (Ensemble Optimization)
os: ubuntu-18.04
python: 3.7
commands: $tox -e py37-test -- docs/notebooks/08_example_ensemble.ipynb
python: 3.8
commands: $tox -e py38-test -- docs/notebooks/08_example_ensemble.ipynb
coverage: true
- title: Notebook 9 (NumPy)
os: ubuntu-18.04
python: 3.7
commands: $tox -e py37-test -- docs/notebooks/09_example_numpy.ipynb
python: 3.8
commands: $tox -e py38-test -- docs/notebooks/09_example_numpy.ipynb
coverage: true
steps:
- uses: actions/checkout@v2
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ If you are a member of the `qucontrol organization`_, there is no need to fork
Development Prerequisites
-------------------------

Contributing to the package's developments requires that you have Python 3.7
Contributing to the package's developments requires that you have Python 3.8
and tox_ installed. It is strongly recommended that you also have installations
of all other supported Python versions. The recommended way to install multiple
versions of Python at the same time is through pyenv_ (or pyenv-win_ on
Expand All @@ -136,7 +136,7 @@ that you may run into occasional binary incompatibilities between conda packages
If you want to use `conda`, you must use the ``tox-conda.ini`` configuration
file. That is, run all ``make`` comands as e.g.
``make TOXINI=tox-conda.ini test`` and ``tox`` commands as e.g.
``tox -c tox-conda.ini -e py35-test,py36-test,py37-test``. Alternatively,
``tox -c tox-conda.ini -e py38-test``. Alternatively,
make ``tox-conda.ini`` the default by copying it to ``tox.ini``.

.. _pyenv: https://github.com/pyenv/pyenv
Expand Down Expand Up @@ -264,7 +264,7 @@ to run the entire test suite, or

.. code-block:: shell
tox -e py35-test,py36-test,py37-test
tox -e py38-test
if ``make`` is not available.

Expand All @@ -278,7 +278,7 @@ the `nbval plugin`_.

.. _test coverage: https://codecov.io/gh/qucontrol/krotov
.. _pytest: https://docs.pytest.org/en/latest/
.. _doctests: https://docs.python.org/3.7/library/doctest.html
.. _doctests: https://docs.python.org/3.8/library/doctest.html
.. _pytest doctest plugin: https://docs.pytest.org/en/latest/doctest.html
.. _nbval plugin: https://nbval.readthedocs.io/en/latest/

Expand Down Expand Up @@ -680,11 +680,11 @@ To run e.g. only the tests defined in ``tests/test_krotov.py``, use any of the f

make test TESTS=tests/test_krotov.py

tox -e py37-test -- tests/test_krotov.py
tox -e py38-test -- tests/test_krotov.py

tox -e run-cmd -- pytest tests/test_krotov.py

.tox/py37/bin/pytest tests/test_krotov.py
.tox/py38/bin/pytest tests/test_krotov.py

See the `pytest test selection docs`_ for details.

Expand Down
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ pylint-check: bootstrap ## check style with pylint
$(TOX) -e run-pylint

test: bootstrap ## run tests for current stable Python release
$(TOX) -e py37-test -- $(TESTS)

test35: bootstrap ## run tests for Python 3.5
$(TOX) -e py35-test -- $(TESTS)
$(TOX) -e py38-test -- $(TESTS)

test36: bootstrap ## run tests for Python 3.6
$(TOX) -e py36-test -- $(TESTS)
Expand Down Expand Up @@ -101,7 +98,7 @@ isort-check: bootstrap ## Check all src and test files for correctly sorted impo
isort: bootstrap ## Sort imports in all src and test files
$(TOX) -e run-isort

coverage: test37 ## generate coverage report in ./htmlcov
coverage: test38 ## generate coverage report in ./htmlcov
$(TOX) -e coverage
@echo "open htmlcov/index.html"

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def generate_patched_readme(_):
nitpick_ignore = [("py:class", "callable")]

extensions = [
"doctr_versions_menu",
"docs_versions_menu",
"nbsphinx",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
Expand Down Expand Up @@ -506,7 +506,7 @@ def iad_add_directive_header(self, sig):
# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None

doctr_versions_menu_conf = {'menu_title': 'Docs'}
docs_versions_menu_conf = {'menu_title': 'Docs'}

# -- Options for nbsphinx -0---------------------------------------------------

Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[bdist_wheel]
universal = 1

[flake8]
exclude = docs
max-line-length = 79
Expand Down
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ def get_version(filename):

# requirements for development (testing, generating docs)
dev_requirements = [
'better-apidoc==0.3.1',
'better-apidoc==0.3.2',
'click',
'codecov',
'coverage<5.0',
# https://github.com/computationalmodelling/nbval/issues/129
'doctr',
'doctr-versions-menu',
'docs-versions-menu',
'flake8',
'gitpython',
'isort==4.3.*',
Expand All @@ -59,7 +58,7 @@ def get_version(filename):
'pytest',
'pytest-cov<=2.6.1',
'pytest-xdist',
'sphinx',
'sphinx<4.0',
'sphinx-autobuild',
'sphinx-copybutton',
'sphinx_rtd_theme',
Expand Down Expand Up @@ -87,10 +86,10 @@ def get_version(filename):
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Framework :: Jupyter',
'Natural Language :: English',
'Operating System :: OS Independent',
Expand All @@ -100,7 +99,7 @@ def get_version(filename):
description=(
"Python implementation of Krotov's method for quantum optimal control"
),
python_requires='~=3.5',
python_requires='~=3.6',
install_requires=requirements,
extras_require={'dev': dev_requirements, 'extras': dev_extras},
license="BSD license",
Expand Down
38 changes: 17 additions & 21 deletions tox-conda.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
minversion = 3.7
envlist = py35-{test,runcmd}, py36-{test,runcmd}, py37-{test,runcmd}, py38-{test,runcmd}, run-{cmd,blackcheck,black,isort,isortcheck}, docs, coverage
envlist = py36-{test,runcmd}, py37-{test,runcmd}, py38-{test,runcmd}, run-{cmd,blackcheck,black,isort,isortcheck}, docs, coverage
requires = tox-conda

[testenv:.tox]
Expand All @@ -10,31 +10,27 @@ envdir = {toxworkdir}/.tox
[testenv]
basepython =
# current "stable" python
py37,run,docs,coverage,clean,bootstrap: python3.7
py38,run,docs,coverage,clean,bootstrap: python3.8
# older pythons
py38: python3.8
py37: python3.7
py36: python3.6
py35: python3.5
envdir =
# current "stable" environment
py37,run,docs,coverage: {toxworkdir}/py37
py38,run,docs,coverage: {toxworkdir}/py38
# other "stable" environment
py38: {toxworkdir}/py38
py37: {toxworkdir}/py37
py36: {toxworkdir}/py36
py35: {toxworkdir}/py35
conda_deps =
cython
py38: numpy=1.18.1
py37,run,docs,coverage: numpy=1.17.2
py38,run,docs,coverage: numpy=1.20.3
py37: numpy=1.17.2
py36: numpy=1.15.4
py35: numpy=1.15.2
py38: scipy=1.4.1
py37,run,docs,coverage: scipy=1.3.1
py38,run,docs,coverage: scipy=1.6.3
py37: scipy=1.3.1
py36: scipy=1.2.0
py35: scipy=1.1.0
py38: qutip=4.5.0
py37,run,docs,coverage: qutip=4.5.0
py36,py35: qutip=4.3.1
py38,run,docs,coverage: qutip=4.6.1
py37: qutip=4.5.0
py36: qutip=4.3.1
conda_channels=
default
conda-forge
Expand All @@ -45,15 +41,15 @@ setenv =
MATPLOTLIBRC = tests
passenv = HOME CI TRAVIS TRAVIS_* COVERALLS* CODECOV* SPELLCHECK SSH_AUTH_SOCK http_proxy https_proxy no_proxy
description =
py{35,36,37,38}-test: Run tests in the corresponding environment
py{35,36,37,38}-runcmd: Run arbitrary command following "--" in the corresponding environment
py{36,37,38}-test: Run tests in the corresponding environment
py{36,37,38}-runcmd: Run arbitrary command following "--" in the corresponding environment
py38qtm-test: Run tests with Python 3.8 and the QuTiP-master
py38qtm-runcmd: Run arbitrary command following "--" in the environment for py38qtm-test
commands_pre =
python -V
commands =
py{35,36,37,38}-runcmd: {posargs:python -c 'print("No command")'}
py{35,36,37,38}-test: py.test -vvv --doctest-modules --cov=krotov --nbval --sanitize-with docs/nbval_sanitize.cfg --ignore docs/_build/ --durations=10 -x -s {posargs:src tests docs README.rst}
py{36,37,38}-runcmd: {posargs:python -c 'print("No command")'}
py{36,37,38}-test: py.test -vvv --doctest-modules --cov=krotov --nbval --sanitize-with docs/nbval_sanitize.cfg --ignore docs/_build/ --durations=10 -x -s {posargs:src tests docs README.rst}


[testenv:docs]
Expand Down Expand Up @@ -147,7 +143,7 @@ commands =

[testenv:coverage]
description = Generate a coverage report
depends = py37-test
depends = py38-test
commands =
coverage html
python -c 'import pathlib; print("coverage report available in \{\}".format(pathlib.Path(".") / "htmlcov" / "index.html"))'
Expand Down
Loading

0 comments on commit cfe6b10

Please sign in to comment.