Skip to content

Commit 285ca45

Browse files
authored
BUILD: drop support for python 3.6 (#4701)
Following our support table, we drop python 3.6 support.
1 parent 998a967 commit 285ca45

11 files changed

Lines changed: 14 additions & 199 deletions

File tree

.github/workflows/ci-code.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
fail-fast: false
5151
matrix:
5252
backend: ['django', 'sqlalchemy']
53-
python-version: [3.6, 3.8]
53+
python-version: [3.7, 3.8]
5454

5555
services:
5656
postgres:
@@ -110,10 +110,10 @@ jobs:
110110
.github/workflows/tests.sh
111111

112112
- name: Upload coverage report
113-
if: matrix.python-version == 3.6 && github.repository == 'aiidateam/aiida-core'
113+
if: matrix.python-version == 3.7 && github.repository == 'aiidateam/aiida-core'
114114
uses: codecov/codecov-action@v1
115115
with:
116-
name: aiida-pytests-py3.6-${{ matrix.backend }}
116+
name: aiida-pytests-py3.7-${{ matrix.backend }}
117117
flags: ${{ matrix.backend }}
118118
file: ./coverage.xml
119119
fail_ci_if_error: false # don't fail job, if coverage upload fails

.github/workflows/test-install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ jobs:
126126
strategy:
127127
fail-fast: false
128128
matrix:
129-
python-version: [3.6, 3.7, 3.8, 3.9]
129+
python-version: [3.7, 3.8, 3.9]
130130
backend: ['django', 'sqlalchemy']
131131

132132
services:

aiida/engine/daemon/runner.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,10 @@
2222

2323
async def shutdown_runner(runner: Runner) -> None:
2424
"""Cleanup tasks tied to the service's shutdown."""
25-
LOGGER.info('Received signal to shut down the daemon runner')
26-
27-
try:
28-
from asyncio import all_tasks
29-
from asyncio import current_task
30-
except ImportError:
31-
# Necessary for Python 3.6 as `asyncio.all_tasks` and `asyncio.current_task` were introduced in Python 3.7. The
32-
# Standalone functions should be used as the classmethods are removed as of Python 3.9.
33-
all_tasks = asyncio.Task.all_tasks
34-
current_task = asyncio.Task.current_task
25+
from asyncio import all_tasks
26+
from asyncio import current_task
3527

28+
LOGGER.info('Received signal to shut down the daemon runner')
3629
tasks = [task for task in all_tasks() if task is not current_task()]
3730

3831
for task in tasks:

aiida/orm/implementation/django/comments.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ def store(self):
6767
if self._dbmodel.dbnode.id is None or self._dbmodel.user.id is None:
6868
raise exceptions.ModificationNotAllowed('The corresponding node and/or user are not stored')
6969

70-
# `contextlib.suppress` provides empty context and can be replaced with `contextlib.nullcontext` after we drop
71-
# support for python 3.6
72-
with suppress_auto_now([(models.DbComment, ['mtime'])]) if self.mtime else contextlib.suppress():
70+
with suppress_auto_now([(models.DbComment, ['mtime'])]) if self.mtime else contextlib.nullcontext():
7371
super().store()
7472

7573
@property

aiida/orm/implementation/django/nodes.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,8 @@ def store(self, links=None, with_transaction=True, clean=True): # pylint: disab
201201
if clean:
202202
self.clean_values()
203203

204-
# `contextlib.suppress` provides empty context and can be replaced with `contextlib.nullcontext` after we drop
205-
# support for python 3.6
206-
with transaction.atomic() if with_transaction else contextlib.suppress():
207-
with suppress_auto_now([(models.DbNode, ['mtime'])]) if self.mtime else contextlib.suppress():
204+
with transaction.atomic() if with_transaction else contextlib.nullcontext():
205+
with suppress_auto_now([(models.DbNode, ['mtime'])]) if self.mtime else contextlib.nullcontext():
208206
# We need to save the node model instance itself first such that it has a pk
209207
# that can be used in the foreign keys that will be needed for setting the
210208
# attributes and links

docs/source/intro/install_system.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This is the *recommended* installation method to setup AiiDA on a personal lapto
1515

1616
**Install prerequisite services**
1717

18-
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.
18+
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.
1919

2020
.. tabbed:: Ubuntu
2121

environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ dependencies:
1515
- click-config-file~=0.6.0
1616
- click-spinner~=0.1.8
1717
- click~=7.1
18-
- dataclasses~=0.7
1918
- django~=2.2
2019
- ete3~=3.1
2120
- python-graphviz~=0.13

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ envlist = py37-django
7676
[testenv]
7777
usedevelop=True
7878
deps =
79-
py36: -rrequirements/requirements-py-3.6.txt
8079
py37: -rrequirements/requirements-py-3.7.txt
8180
py38: -rrequirements/requirements-py-3.8.txt
8281
py39: -rrequirements/requirements-py-3.9.txt
@@ -109,7 +108,6 @@ commands =
109108
# tip: remove apidocs before using this feature (`cd docs; make clean`)
110109
description = Build the documentation and launch browser (with live updates)
111110
deps =
112-
py36: -rrequirements/requirements-py-3.6.txt
113111
py37: -rrequirements/requirements-py-3.7.txt
114112
py38: -rrequirements/requirements-py-3.8.txt
115113
py39: -rrequirements/requirements-py-3.9.txt

requirements/requirements-py-3.6.txt

Lines changed: 0 additions & 170 deletions
This file was deleted.

setup.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@
77
"author_email": "developers@aiida.net",
88
"description": "AiiDA is a workflow manager for computational science with a strong focus on provenance, performance and extensibility.",
99
"include_package_data": true,
10-
"python_requires": ">=3.6.1",
10+
"python_requires": ">=3.7",
1111
"classifiers": [
1212
"Framework :: AiiDA",
1313
"License :: OSI Approved :: MIT License",
1414
"Operating System :: POSIX :: Linux",
1515
"Operating System :: MacOS :: MacOS X",
1616
"Programming Language :: Python",
17-
"Programming Language :: Python :: 3.6",
1817
"Programming Language :: Python :: 3.7",
1918
"Programming Language :: Python :: 3.8",
2019
"Programming Language :: Python :: 3.9",
@@ -30,7 +29,6 @@
3029
"click-config-file~=0.6.0",
3130
"click-spinner~=0.1.8",
3231
"click~=7.1",
33-
"dataclasses~=0.7; python_version < '3.7.0'",
3432
"django~=2.2",
3533
"ete3~=3.1",
3634
"graphviz~=0.13",

0 commit comments

Comments
 (0)