Skip to content

Commit

Permalink
Dependencies: Drop support for Python 3.8
Browse files Browse the repository at this point in the history
According to AEP 003, the support for Python versions follows the
same timeline as that of numpy, defined in NEP 029. According to that
schema, Python 3.8 is no longer support as of April 14 2023 and so
official support is also dropped in `aiida-core`.
  • Loading branch information
sphuber committed Jun 19, 2023
1 parent ac755af commit 3defb8b
Show file tree
Hide file tree
Showing 18 changed files with 53 additions and 256 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'

- name: Install utils/ dependencies
run: pip install -r utils/requirements.txt
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.11']
python-version: ['3.9', '3.11']

services:
postgres:
Expand Down Expand Up @@ -111,10 +111,10 @@ jobs:
.github/workflows/tests.sh

- name: Upload coverage report
if: matrix.python-version == 3.8 && github.repository == 'aiidateam/aiida-core'
if: matrix.python-version == 3.9 && github.repository == 'aiidateam/aiida-core'
uses: codecov/codecov-action@v1
with:
name: aiida-pytests-py3.8
name: aiida-pytests-py3.9
file: ./coverage.xml
fail_ci_if_error: false # don't fail job, if coverage upload fails

Expand All @@ -126,7 +126,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.11']
python-version: ['3.9', '3.11']

steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'

- name: Install system dependencies
# note libkrb5-dev is required as a dependency for the gssapi pip install
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -r requirements/requirements-py-3.8.txt
pip install -r requirements/requirements-py-3.9.txt
pip install -e .[pre-commit]
pip freeze
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'
- name: Install python dependencies
run: |
pip install --upgrade pip
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/rabbitmq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rabbitmq: ['3.6', '3.7', '3.8']
rabbitmq-version: ['3.6', '3.7', '3.8']

services:
postgres:
Expand All @@ -34,18 +34,18 @@ jobs:
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:${{ matrix.rabbitmq }}-management
image: rabbitmq:${{ matrix.rabbitmq-version }}-management
ports:
- 5672:5672
- 15672:15672

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'

- name: Install system dependencies
run: sudo apt update && sudo apt install postgresql
Expand All @@ -57,7 +57,7 @@ jobs:
- name: Install aiida-core
run: |
pip install -r requirements/requirements-py-3.8.txt
pip install -r requirements/requirements-py-3.9.txt
pip install --no-deps -e .
pip freeze
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'
- run: python .github/workflows/check_release_tag.py $GITHUB_REF

pre-commit:
Expand All @@ -33,10 +33,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'
- name: Install system dependencies
# note libkrb5-dev is required as a dependency for the gssapi pip install
run: |
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -r requirements/requirements-py-3.8.txt
pip install -r requirements/requirements-py-3.9.txt
pip install -e .[pre-commit]
pip freeze
- name: Run pre-commit
Expand Down Expand Up @@ -79,10 +79,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'
- name: Install system dependencies
run: |
sudo apt update
Expand All @@ -95,7 +95,7 @@ jobs:
- name: Install aiida-core
run: |
pip install -r requirements/requirements-py-3.8.txt
pip install -r requirements/requirements-py-3.9.txt
pip install --no-deps -e .
- name: Run sub-set of test suite
run: pytest -sv -k 'requires_rmq'
Expand All @@ -111,10 +111,10 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'
- name: install flit
run: |
pip install flit~=3.4
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -110,12 +110,10 @@ jobs:
steps:
- uses: actions/checkout@v2

# Set to Python version 3.8, as the installation with 3.9 still takes
# significantly longer to install.
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'

- name: Pip install
id: pip_install
Expand All @@ -140,7 +138,7 @@ jobs:
fail-fast: false
matrix:

python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11']

# Not being able to install with conda on a specific Python version is
# not sufficient to fail the run, but something we want to be aware of.
Expand Down Expand Up @@ -191,7 +189,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11']

services:
postgres:
Expand Down
2 changes: 1 addition & 1 deletion .molecule/default/setup_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
pip:
chdir: "{{ aiida_core_dir }}"
# TODO dynamically change for python version
requirements: requirements/requirements-py-3.8.txt
requirements: requirements/requirements-py-3.9.txt
executable: "{{ venv_bin }}/pip"
extra_args: --cache-dir {{ aiida_pip_cache }}
register: pip_install_deps
Expand Down
4 changes: 1 addition & 3 deletions aiida/engine/transports.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ def do_open():
# passed around to many places, including outside aiida-core (e.g. paramiko). Anyone keeping a reference
# to this handle would otherwise keep the Process context (and thus the process itself) in memory.
# See https://github.com/aiidateam/aiida-core/issues/4698
open_callback_handle = self._loop.call_later(
safe_open_interval, do_open, context=contextvars.Context()
) # type: ignore[call-arg]
open_callback_handle = self._loop.call_later(safe_open_interval, do_open, context=contextvars.Context())

try:
transport_request.count += 1
Expand Down
8 changes: 1 addition & 7 deletions aiida/manage/configuration/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@
"""Module that defines the configuration file of an AiiDA instance and functions to create and load it."""
import codecs
from functools import lru_cache

try:
# Python <= 3.8
from importlib_resources import files
except ImportError:
from importlib.resources import files

from importlib.resources import files
import json
import os
import shutil
Expand Down
4 changes: 2 additions & 2 deletions aiida/storage/sqlite_zip/migrations/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def copy_zip_to_zip(
progress.update()
if overwrite and outpath.exists() and outpath.is_file():
outpath.unlink()
shutil.move(temp_archive, outpath) # type: ignore[arg-type]
shutil.move(temp_archive, outpath)


def copy_tar_to_zip(
Expand Down Expand Up @@ -169,4 +169,4 @@ def copy_tar_to_zip(

if overwrite and outpath.exists() and outpath.is_file():
outpath.unlink()
shutil.move(temp_archive, outpath) # type: ignore[arg-type]
shutil.move(temp_archive, outpath)
2 changes: 1 addition & 1 deletion aiida/tools/archive/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def transform(row):

if filename.exists():
filename.unlink()
shutil.move(tmp_filename, filename) # type: ignore[arg-type]
shutil.move(tmp_filename, filename)

EXPORT_LOGGER.report('Archive created successfully')

Expand Down
2 changes: 1 addition & 1 deletion aiida/tools/archive/implementations/sqlite_zip/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def __exit__(self, *args, **kwargs):
self._deleted_paths = set()
# now move it to the original location
self._path.unlink()
shutil.move(self._work_dir / 'archive.zip', self._path) # type: ignore[arg-type]
shutil.move(self._work_dir / 'archive.zip', self._path)
if self._init_work_dir is None:
shutil.rmtree(self._work_dir, ignore_errors=True)
self._zip_path = self._work_dir = self._conn = None
Expand Down
7 changes: 3 additions & 4 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python~=3.8
- python~=3.9
- alembic~=1.2
- archive-path~=0.4.2
- aio-pika~=6.6
Expand All @@ -16,13 +16,12 @@ dependencies:
- docstring_parser
- get-annotations~=0.1
- python-graphviz~=0.19
- ipython<8.13,>=7
- ipython>=7
- jinja2~=3.0
- jsonschema~=3.0
- kiwipy[rmq]~=0.7.7
- importlib-metadata~=4.13
- importlib-resources~=5.0
- numpy~=1.19
- numpy~=1.21
- paramiko>=2.7.2,~=2.7
- plumpy~=0.21.6
- pgsu~=0.2.1
Expand Down
Loading

0 comments on commit 3defb8b

Please sign in to comment.