diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1d7fd16f..f7603581 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8f744032..3ea257a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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 diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 723c4917..dfb56a1c 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -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 @@ -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 @@ -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. @@ -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/ @@ -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. diff --git a/Makefile b/Makefile index 2175ae44..fdafd8d0 100644 --- a/Makefile +++ b/Makefile @@ -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) @@ -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" diff --git a/docs/conf.py b/docs/conf.py index f456ed93..21188e38 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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", @@ -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--------------------------------------------------- diff --git a/setup.cfg b/setup.cfg index d19ac121..74f3fdee 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,3 @@ -[bdist_wheel] -universal = 1 - [flake8] exclude = docs max-line-length = 79 diff --git a/setup.py b/setup.py index 9009ca3e..ddffad9b 100644 --- a/setup.py +++ b/setup.py @@ -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.*', @@ -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', @@ -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', @@ -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", diff --git a/tox-conda.ini b/tox-conda.ini index 1589ebb6..81a650e6 100644 --- a/tox-conda.ini +++ b/tox-conda.ini @@ -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] @@ -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 @@ -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] @@ -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"))' diff --git a/tox-pyenv.ini b/tox-pyenv.ini index fb71bfca..21192a27 100644 --- a/tox-pyenv.ini +++ b/tox-pyenv.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.7 -envlist = py35-{test,runcmd}, py36-{test,runcmd}, py37-{test,runcmd}, py38-{test,runcmd}, py38qtm-{test,runcmd}, run-{cmd,blackcheck,black,isort,isortcheck}, docs, coverage +envlist = py36-{test,runcmd}, py37-{test,runcmd}, py38-{test,runcmd}, py38qtm-{test,runcmd}, run-{cmd,blackcheck,black,isort,isortcheck}, docs, coverage [testenv:.tox] envdir = {toxworkdir}/.tox @@ -9,34 +9,30 @@ 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 py38qtm: python3.8 - 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 py38qtm: {toxworkdir}/py38qtm - py38: {toxworkdir}/py38 + py37: {toxworkdir}/py37 py36: {toxworkdir}/py36 - py35: {toxworkdir}/py35 deps = - py35,py36,py37,py38,py38qtm,run,docs,coverage: cython - py38,py38qtm: numpy==1.18.1 - py37,run,docs,coverage: numpy==1.17.2 + py36,py37,py38,py38qtm,run,docs,coverage: cython + py38,py38qtm,run,docs,coverage: numpy==1.20.3 + py37: numpy==1.17.2 py36: numpy==1.15.4 - py35: numpy==1.15.4 - py38,py38qtm: scipy==1.4.1 - py37,run,docs,coverage: scipy==1.3.1 + py38,py38qtm,run,docs,coverage: scipy==1.6.3 + py37: scipy==1.3.1 py36: scipy==1.2.0 - py35: scipy==1.1.0 py38qtm: git+https://github.com/qutip/qutip.git@master - 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 install_command=python scripts/pip_sequential.py install {opts} -- {packages} usedevelop = true extras= @@ -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,38qtm}-runcmd: {posargs:python -c 'print("No command")'} - py{35,36,37,38,38qtm}-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,38qtm}-runcmd: {posargs:python -c 'print("No command")'} + py{36,37,38,38qtm}-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] @@ -145,7 +141,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"))'