Skip to content

Commit

Permalink
Add support for Python 3.10 (aiidateam#5188)
Browse files Browse the repository at this point in the history
* Add Python 3.10 to the test-install step.
* Add Python 3.10 to trove classifiers.
* Define all version numbers as part of the GH actions workflows as strings.
  Since version "numbers" are not actually numbers, which can lead to
  bugs, e.g., when a version number like "3.10" is interpreted as a
  decimal or float and is thus equal to 3.1.
* Run CI tests against lowest and highest supported Python version.
  • Loading branch information
csadorf authored Dec 1, 2021
1 parent 0acfb2d commit ced1033
Show file tree
Hide file tree
Showing 13 changed files with 471 additions and 285 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-18.04]
postgres: [12.3]
rabbitmq: [3.8.3]
postgres: ['12.3']
rabbitmq: ['3.8.3']
backend: ['django', 'sqlalchemy']

runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.8'
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.8'

- 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.7, 3.8]
python-version: ['3.7', '3.10']
backend: ['django', 'sqlalchemy']

services:
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]
python-version: ['3.7', '3.10']

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.8'

- name: Install system dependencies
# note libkrb5-dev is required as a dependency for the gssapi pip install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.8'
- name: Install python dependencies
run: |
pip install -e .[docs,tests]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: '3.7'

- name: Install python dependencies
run: |
Expand Down
4 changes: 2 additions & 2 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.5, 3.6, 3.7, 3.8]
rabbitmq: ['3.5', '3.6', '3.7', '3.8']

services:
postgres:
Expand All @@ -44,7 +44,7 @@ jobs:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.8'

- name: Install system dependencies
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.8'
- run: python .github/workflows/check_release_tag.py $GITHUB_REF setup.json

pre-commit:
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.8'
- name: Install system dependencies
# note libkrb5-dev is required as a dependency for the gssapi pip install
run: |
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.8'
- name: Install system dependencies
run: |
sudo apt update
Expand All @@ -104,7 +104,7 @@ jobs:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.8'
- name: Build package
run: |
pip install wheel
Expand Down
53 changes: 32 additions & 21 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: '3.9'

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

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -87,13 +87,9 @@ jobs:
- name: Setup Conda
uses: s-weigand/setup-conda@v1
with:
python-version: 3.9
update-conda: false
conda-channels: conda-forge

- run: conda --version
- run: python --version
- run: which python

- name: Test conda environment
run: |
Expand All @@ -118,7 +114,7 @@ jobs:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.8'

- name: Pip install
id: pip_install
Expand All @@ -136,43 +132,58 @@ jobs:
# Verify that we can install AiiDA with conda.

if: github.repository == 'aiidateam/aiida-core'
# Currently the installation for Python 3.7 fails in combination with
# ubuntu-20.04 due to an incompatibility with glibc.
runs-on: ubuntu-18.04
timeout-minutes: 10
runs-on: ubuntu-latest
timeout-minutes: 5

strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]

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

# 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.
optional: [true]

include:
# Installing with conda without specyfing the Python version should
# not fail since this is advocated as part of the user documentation.
- python-version: ''
optional: false

steps:
- uses: actions/checkout@v2

- name: Setup Conda
uses: s-weigand/setup-conda@v1
with:
python-version: ${{ matrix.python-version }}
update-conda: false
conda-channels: conda-forge

- run: conda --version
- run: python --version
- run: which python

- name: Test direct installation
run: |
conda create --dry-run -n test-install aiida-core python=${{ matrix.python-version }}
- name: Test installation
id: test_installation
continue-on-error: ${{ matrix.optional }}
run: >
conda create --dry-run -n test-install aiida-core
${{ matrix.python-version && format('python={0}', matrix.python-version) }}
- name: Warn about failure
if: steps.test_installation.outcome == 'Failure'
run: >
echo "::warning ::Failed conda installation for
Python ${{ matrix.python-version }}."
tests:

needs: [install-with-pip]
runs-on: ubuntu-latest
timeout-minutes: 35
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ['3.7', '3.8', '3.9', '3.10']
backend: ['django', 'sqlalchemy']

services:
Expand Down
Loading

0 comments on commit ced1033

Please sign in to comment.