Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(docker): upgrade to ubuntu 24.04 and Python 3.12 (#810) #810

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on: [push, pull_request]

jobs:
lint-commitlint:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -33,10 +33,10 @@ jobs:
- name: Check commit message compliance of the pull request
if: github.event_name == 'pull_request'
run: |
./run-tests.sh --check-commitlint ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.number }}
./run-tests.sh --check-commitlint ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.number }}

lint-shellcheck:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -47,31 +47,31 @@ jobs:
./run-tests.sh --check-shellcheck

lint-black:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"

- name: Check Python code formatting
run: |
pip install black
./run-tests.sh --check-black

lint-flake8:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"

- name: Check compliance with pep8, pyflakes and circular complexity
run: |
Expand All @@ -80,47 +80,47 @@ jobs:
./run-tests.sh --check-flake8

lint-pydocstyle:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"

- name: Check compliance with Python docstring conventions
run: |
pip install pydocstyle
./run-tests.sh --check-pydocstyle

lint-check-manifest:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"

- name: Check Python manifest completeness
run: |
pip install check-manifest
./run-tests.sh --check-manifest

docs-sphinx:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"

- name: Install system dependencies
run: |
Expand All @@ -137,15 +137,15 @@ jobs:
run: ./run-tests.sh --check-sphinx

python-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python 3.8
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"

- name: Install Python dependencies
run: |
Expand All @@ -163,7 +163,7 @@ jobs:
files: coverage.xml

lint-helm:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
version: 2

build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.8"
python: "3.12"

sphinx:
configuration: docs/conf.py
Expand Down
4 changes: 2 additions & 2 deletions reana/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@
CODECOV_REANAHUB_URL = "https://codecov.io/gh/reanahub"
"""REANA Hub organisation Codecov URL."""

PYTHON_EXECUTABLE_NAME = "python3.8"
PYTHON_EXECUTABLE_NAME = "python3.12"
"""Python executable name with the same version as cluster components."""

PYTHON_DOCKER_IMAGE = "docker.io/library/python:3.8"
PYTHON_DOCKER_IMAGE = "docker.io/library/python:3.12"
"""Python docker image with the same version as cluster components."""

RELEASE_COMMIT_REGEX = re.compile("^(release:|chore.*: release)")
Expand Down
6 changes: 3 additions & 3 deletions reana/reana_dev/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,11 +802,11 @@
f"{version.major}.{version.minor}.{version.micro}{dev_post_pre_part}"
)
elif (part and part == "micro") or (isinstance(version.micro, int) and not part):
next_version = Version(f"{version.major}.{version.minor}.{version.micro+1}")
next_version = Version(f"{version.major}.{version.minor}.{version.micro + 1}")

Check warning on line 805 in reana/reana_dev/utils.py

View check run for this annotation

Codecov / codecov/patch

reana/reana_dev/utils.py#L805

Added line #L805 was not covered by tests
elif (part and part == "minor") or (isinstance(version.minor, int) and not part):
next_version = Version(f"{version.major}.{version.minor+1}.0")
next_version = Version(f"{version.major}.{version.minor + 1}.0")

Check warning on line 807 in reana/reana_dev/utils.py

View check run for this annotation

Codecov / codecov/patch

reana/reana_dev/utils.py#L807

Added line #L807 was not covered by tests
elif (part and part == "major") or (isinstance(version.major, int) and not part):
next_version = Version(f"{version.major+1}.0.0")
next_version = Version(f"{version.major + 1}.0.0")

Check warning on line 809 in reana/reana_dev/utils.py

View check run for this annotation

Codecov / codecov/patch

reana/reana_dev/utils.py#L809

Added line #L809 was not covered by tests

return str(next_version)

Expand Down
19 changes: 11 additions & 8 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,23 @@ check_commitlint () {
commit_hash=$(echo "$line" | cut -d ' ' -f 1)
commit_title=$(echo "$line" | cut -d ' ' -f 2-)
commit_number_of_parents=$(git rev-list --parents "$commit_hash" -n1 | awk '{print NF-1}')
# (i) skip checking release commits generated by Release Please
if [ "$commit_number_of_parents" -le 1 ] && echo "$commit_title" | grep -qP "^chore\(.*\): release"; then
continue
fi
# (ii) check presence of PR number
if ! echo "$commit_title" | grep -qP "\(\#$pr\)$"; then
echo "✖ Headline does not end by '(#$pr)' PR number: $commit_title"
found=1
fi
# (iii) check absence of merge commits in feature branches
if [ "$commit_number_of_parents" -gt 1 ]; then
if echo "$commit_title" | grep -qP "^chore\(.*\): merge "; then
break
break # skip checking maint-to-master merge commits
else
echo "✖ Merge commits are not allowed in feature branches: $commit_title"
found=1
fi
elif echo "$commit_title" | grep -qP "^chore\(.*\): release"; then
true
elif echo "$commit_title" | grep -qP "\(\#$pr\)$"; then
true
else
echo "✖ Headline does not end by '(#$pr)' PR number: $commit_title"
found=1
fi
done < <(git log "$from..$to" --format="%H %s")
if [ $found -gt 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
Expand Down
Loading