diff --git a/.github/workflows/ci-code.yml b/.github/workflows/ci-code.yml index 95f2c8676a..704dce0d1c 100644 --- a/.github/workflows/ci-code.yml +++ b/.github/workflows/ci-code.yml @@ -50,7 +50,7 @@ jobs: fail-fast: false matrix: backend: ['django', 'sqlalchemy'] - python-version: [3.6, 3.8] + python-version: [3.7, 3.8] services: postgres: @@ -110,10 +110,10 @@ jobs: .github/workflows/tests.sh - name: Upload coverage report - if: matrix.python-version == 3.6 && github.repository == 'aiidateam/aiida-core' + if: matrix.python-version == 3.7 && github.repository == 'aiidateam/aiida-core' uses: codecov/codecov-action@v1 with: - name: aiida-pytests-py3.6-${{ matrix.backend }} + name: aiida-pytests-py3.7-${{ matrix.backend }} flags: ${{ matrix.backend }} file: ./coverage.xml fail_ci_if_error: false # don't fail job, if coverage upload fails diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 1934e4467a..b9fb994ce9 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -126,7 +126,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9] backend: ['django', 'sqlalchemy'] services: diff --git a/aiida/engine/daemon/runner.py b/aiida/engine/daemon/runner.py index 1826da38c2..c807c54953 100644 --- a/aiida/engine/daemon/runner.py +++ b/aiida/engine/daemon/runner.py @@ -22,17 +22,10 @@ async def shutdown_runner(runner: Runner) -> None: """Cleanup tasks tied to the service's shutdown.""" - LOGGER.info('Received signal to shut down the daemon runner') - - try: - from asyncio import all_tasks - from asyncio import current_task - except ImportError: - # Necessary for Python 3.6 as `asyncio.all_tasks` and `asyncio.current_task` were introduced in Python 3.7. The - # Standalone functions should be used as the classmethods are removed as of Python 3.9. - all_tasks = asyncio.Task.all_tasks - current_task = asyncio.Task.current_task + from asyncio import all_tasks + from asyncio import current_task + LOGGER.info('Received signal to shut down the daemon runner') tasks = [task for task in all_tasks() if task is not current_task()] for task in tasks: diff --git a/aiida/orm/implementation/django/comments.py b/aiida/orm/implementation/django/comments.py index abdcf798ab..1e6f2b0521 100644 --- a/aiida/orm/implementation/django/comments.py +++ b/aiida/orm/implementation/django/comments.py @@ -67,9 +67,7 @@ def store(self): if self._dbmodel.dbnode.id is None or self._dbmodel.user.id is None: raise exceptions.ModificationNotAllowed('The corresponding node and/or user are not stored') - # `contextlib.suppress` provides empty context and can be replaced with `contextlib.nullcontext` after we drop - # support for python 3.6 - with suppress_auto_now([(models.DbComment, ['mtime'])]) if self.mtime else contextlib.suppress(): + with suppress_auto_now([(models.DbComment, ['mtime'])]) if self.mtime else contextlib.nullcontext(): super().store() @property diff --git a/aiida/orm/implementation/django/nodes.py b/aiida/orm/implementation/django/nodes.py index d8f527e5fd..af47942246 100644 --- a/aiida/orm/implementation/django/nodes.py +++ b/aiida/orm/implementation/django/nodes.py @@ -201,10 +201,8 @@ def store(self, links=None, with_transaction=True, clean=True): # pylint: disab if clean: self.clean_values() - # `contextlib.suppress` provides empty context and can be replaced with `contextlib.nullcontext` after we drop - # support for python 3.6 - with transaction.atomic() if with_transaction else contextlib.suppress(): - with suppress_auto_now([(models.DbNode, ['mtime'])]) if self.mtime else contextlib.suppress(): + with transaction.atomic() if with_transaction else contextlib.nullcontext(): + with suppress_auto_now([(models.DbNode, ['mtime'])]) if self.mtime else contextlib.nullcontext(): # We need to save the node model instance itself first such that it has a pk # that can be used in the foreign keys that will be needed for setting the # attributes and links diff --git a/docs/source/intro/install_system.rst b/docs/source/intro/install_system.rst index 39550fd1eb..5df3023a12 100644 --- a/docs/source/intro/install_system.rst +++ b/docs/source/intro/install_system.rst @@ -15,7 +15,7 @@ This is the *recommended* installation method to setup AiiDA on a personal lapto **Install prerequisite services** - AiiDA is designed to run on `Unix `_ operating systems and requires a `bash `_ or `zsh `_ shell, and Python >= 3.6. + AiiDA is designed to run on `Unix `_ operating systems and requires a `bash `_ or `zsh `_ shell, and Python >= 3.7. .. tabbed:: Ubuntu diff --git a/environment.yml b/environment.yml index 71df1d2412..c079a48523 100644 --- a/environment.yml +++ b/environment.yml @@ -15,7 +15,6 @@ dependencies: - click-config-file~=0.6.0 - click-spinner~=0.1.8 - click~=7.1 -- dataclasses~=0.7 - django~=2.2 - ete3~=3.1 - python-graphviz~=0.13 diff --git a/pyproject.toml b/pyproject.toml index 97975b5c3f..70abc15eb5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,7 +76,6 @@ envlist = py37-django [testenv] usedevelop=True deps = - py36: -rrequirements/requirements-py-3.6.txt py37: -rrequirements/requirements-py-3.7.txt py38: -rrequirements/requirements-py-3.8.txt py39: -rrequirements/requirements-py-3.9.txt @@ -109,7 +108,6 @@ commands = # tip: remove apidocs before using this feature (`cd docs; make clean`) description = Build the documentation and launch browser (with live updates) deps = - py36: -rrequirements/requirements-py-3.6.txt py37: -rrequirements/requirements-py-3.7.txt py38: -rrequirements/requirements-py-3.8.txt py39: -rrequirements/requirements-py-3.9.txt diff --git a/requirements/requirements-py-3.6.txt b/requirements/requirements-py-3.6.txt deleted file mode 100644 index a0c58557cc..0000000000 --- a/requirements/requirements-py-3.6.txt +++ /dev/null @@ -1,170 +0,0 @@ -aiida-export-migration-tests==0.9.0 -alabaster==0.7.12 -aldjemy==0.9.1 -alembic==1.4.1 -aio-pika==6.6.1 -aniso8601==8.0.0 -appdirs==1.4.4 -appnope==0.1.0 -archive-path==0.2.1 -ase==3.19.0 -attrs==19.3.0 -Babel==2.8.0 -backcall==0.1.0 -bcrypt==3.1.7 -bleach==3.1.4 -certifi==2019.11.28 -cffi==1.14.0 -chardet==3.0.4 -circus==0.17.1 -Click==7.1.2 -click-completion==0.5.2 -click-config-file==0.6.0 -click-spinner==0.1.8 -configobj==5.0.6 -coverage==4.5.4 -cryptography==3.2 -cycler==0.10.0 -dataclasses==0.7 -decorator==4.4.2 -defusedxml==0.6.0 -Django==2.2.11 -docutils==0.15.2 -entrypoints==0.3 -ete3==3.1.1 -flake8==3.8.3 -Flask==1.1.1 -Flask-Cors==3.0.8 -Flask-RESTful==0.3.8 -frozendict==1.2 -furl==2.1.0 -future==0.18.2 -graphviz==0.13.2 -idna==2.9 -imagesize==1.2.0 -importlib-metadata==1.5.0 -iniconfig==1.1.1 -ipykernel==5.1.4 -ipython==7.13.0 -ipython-genutils==0.2.0 -ipywidgets==7.5.1 -itsdangerous==1.1.0 -jedi==0.16.0 -Jinja2==2.11.1 -jsonschema==3.2.0 -jupyter==1.0.0 -jupyter-client==6.0.0 -jupyter-console==6.1.0 -jupyter-core==4.6.3 -kiwipy==0.7.1 -kiwisolver==1.1.0 -Mako==1.1.2 -MarkupSafe==1.1.1 -matplotlib==3.2.0 -mccabe==0.6.1 -mistune==0.8.4 -monty==3.0.2 -more-itertools==8.2.0 -mpmath==1.1.0 -nbconvert==5.6.1 -nbformat==5.0.4 -networkx==2.4 -notebook==6.1.5 -numpy==1.17.5 -orderedmultidict==1.0.1 -packaging==20.3 -palettable==3.3.0 -pamqp==2.3 -pandas==0.25.3 -pandocfilters==1.4.2 -paramiko==2.7.2 -parso==0.6.2 -pathspec==0.8.0 -pexpect==4.8.0 -pg8000==1.13.2 -pgsu==0.1.0 -pgtest==1.3.2 -pickleshare==0.7.5 -pluggy==0.13.1 -plumpy==0.18.4 -prometheus-client==0.7.1 -prompt-toolkit==3.0.4 -psutil==5.7.0 -psycopg2-binary==2.8.4 -ptyprocess==0.6.0 -py==1.9.0 -py-cpuinfo==7.0.0 -PyCifRW==4.4.1 -pycparser==2.20 -pydata-sphinx-theme==0.4.1 -PyDispatcher==2.0.5 -pyflakes==2.2.0 -Pygments==2.6.1 -pymatgen==2020.3.2 -PyMySQL==0.9.3 -PyNaCl==1.3.0 -pyparsing==2.4.6 -pyrsistent==0.15.7 -pytest==6.0.0 -pytest-benchmark==3.2.3 -pytest-cov==2.8.1 -pytest-rerunfailures==9.1.1 -pytest-timeout==1.3.4 -pytest-asyncio==0.12.0 -python-dateutil==2.8.1 -python-editor==1.0.4 -python-memcached==1.59 -pytz==2019.3 -PyYAML==5.1.2 -pyzmq==19.0.0 -qtconsole==4.7.1 -QtPy==1.9.0 -reentry==1.3.1 -regex==2020.7.14 -requests==2.23.0 -ruamel.yaml==0.16.10 -ruamel.yaml.clib==0.2.0 -scipy==1.4.1 -scramp==1.1.0 -seekpath==1.9.4 -Send2Trash==1.5.0 -shellingham==1.3.2 -shortuuid==1.0.1 -simplejson==3.17.0 -six==1.14.0 -snowballstemmer==2.0.0 -spglib==1.14.1.post0 -Sphinx==3.2.1 -sphinx-copybutton==0.3.0 -sphinx-notfound-page==0.5 -sphinx-panels==0.5.2 -sphinxcontrib-applehelp==1.0.2 -sphinxcontrib-contentui==0.2.4 -sphinxcontrib-details-directive==0.1.0 -sphinxcontrib-devhelp==1.0.2 -sphinxcontrib-htmlhelp==1.0.3 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.3 -sphinxcontrib-serializinghtml==1.1.4 -sphinxext-rediraffe==0.2.4 -SQLAlchemy==1.3.13 -sqlalchemy-diff==0.1.3 -SQLAlchemy-Utils==0.34.2 -sqlparse==0.3.1 -sympy==1.5.1 -tabulate==0.8.6 -terminado==0.8.3 -testpath==0.4.4 -toml==0.10.1 -tqdm==4.45.0 -traitlets==4.3.3 -typed-ast==1.4.1 -tzlocal==2.0.0 -upf-to-json==0.9.2 -urllib3==1.25.8 -wcwidth==0.1.8 -webencodings==0.5.1 -Werkzeug==1.0.0 -widgetsnbextension==3.5.1 -wrapt==1.11.2 -zipp==3.1.0 diff --git a/setup.json b/setup.json index 281c8ad3a3..bafdd8085d 100644 --- a/setup.json +++ b/setup.json @@ -7,14 +7,13 @@ "author_email": "developers@aiida.net", "description": "AiiDA is a workflow manager for computational science with a strong focus on provenance, performance and extensibility.", "include_package_data": true, - "python_requires": ">=3.6.1", + "python_requires": ">=3.7", "classifiers": [ "Framework :: AiiDA", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Operating System :: MacOS :: MacOS X", "Programming Language :: Python", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -30,7 +29,6 @@ "click-config-file~=0.6.0", "click-spinner~=0.1.8", "click~=7.1", - "dataclasses~=0.7; python_version < '3.7.0'", "django~=2.2", "ete3~=3.1", "graphviz~=0.13", diff --git a/utils/dependency_management.py b/utils/dependency_management.py index 14f30c5280..79782e504e 100755 --- a/utils/dependency_management.py +++ b/utils/dependency_management.py @@ -247,7 +247,8 @@ def validate_environment_yml(): # pylint: disable=too-many-branches # The Python version should be specified as supported in 'setup.json'. if not any(spec.version >= other_spec.version for other_spec in python_requires.specifier): raise DependencySpecificationError( - "Required Python version between 'setup.json' and 'environment.yml' not consistent." + f"Required Python version {spec.version} from 'environment.yaml' is not consistent with " + + "required version in 'setup.json'." ) break