Skip to content

Commit

Permalink
BUILD: drop support for python 3.6 (#4701)
Browse files Browse the repository at this point in the history
Following our support table, we drop python 3.6 support.
  • Loading branch information
ltalirz authored Feb 8, 2021
1 parent 998a967 commit 285ca45
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 199 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 3 additions & 10 deletions aiida/engine/daemon/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions aiida/orm/implementation/django/comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions aiida/orm/implementation/django/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/source/intro/install_system.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://en.wikipedia.org/wiki/Unix>`_ operating systems and requires a `bash <https://en.wikipedia.org/wiki/Bash_(Unix_shell)>`_ or `zsh <https://en.wikipedia.org/wiki/Z_shell>`_ shell, and Python >= 3.6.
AiiDA is designed to run on `Unix <https://en.wikipedia.org/wiki/Unix>`_ operating systems and requires a `bash <https://en.wikipedia.org/wiki/Bash_(Unix_shell)>`_ or `zsh <https://en.wikipedia.org/wiki/Z_shell>`_ shell, and Python >= 3.7.

.. tabbed:: Ubuntu

Expand Down
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
170 changes: 0 additions & 170 deletions requirements/requirements-py-3.6.txt

This file was deleted.

4 changes: 1 addition & 3 deletions setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
"author_email": "[email protected]",
"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",
Expand All @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion utils/dependency_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 285ca45

Please sign in to comment.