From d17318682f1a5abe293f1789003b28c0ada3cf88 Mon Sep 17 00:00:00 2001 From: fabianegli Date: Fri, 5 Aug 2022 11:56:37 +0200 Subject: [PATCH 1/3] use packaging instead of deprecated distutils Version classes --- nf_core/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nf_core/utils.py b/nf_core/utils.py index e8a284a1d3..f9121f24bd 100644 --- a/nf_core/utils.py +++ b/nf_core/utils.py @@ -15,7 +15,6 @@ import subprocess import sys import time -from distutils.version import StrictVersion import git import prompt_toolkit @@ -24,6 +23,7 @@ import requests_cache import rich import yaml +from packaging.version import Version from rich.live import Live from rich.spinner import Spinner @@ -76,7 +76,7 @@ def check_if_outdated(current_version=None, remote_version=None, source_url="htt response = requests.get(source_url, timeout=3) remote_version = re.sub(r"[^0-9\.]", "", response.text) # Check if we have an available update - is_outdated = StrictVersion(remote_version) > StrictVersion(current_version) + is_outdated = Version(remote_version) > Version(current_version) return (is_outdated, current_version, remote_version) From 85d5fbb94bba08ec5632a7fc66d94a6d62af28c2 Mon Sep 17 00:00:00 2001 From: Fabian Egli Date: Sat, 6 Aug 2022 11:51:36 +0200 Subject: [PATCH 2/3] remove last distutils usage --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e94af1db4..2d80597c57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ - Add `no_git=True` when creating a new pipeline and initialising a git repository is not needed in `nf-core lint` and `nf-core bump-version` ([#1709](https://github.com/nf-core/tools/pull/1709)) - Move `strip_ansi_code` function in lint to `utils.py` - Simplify control flow and don't use equality comparison for `None` and booleans +- Replace use of the deprecated `distutils` Version object with that from `packaging` [#1735](https://github.com/nf-core/tools/pull/1735) ### Modules From b2b967e8f5f0b13f0d8999d118a192e3ae0e4a0d Mon Sep 17 00:00:00 2001 From: Fabian Egli Date: Sat, 6 Aug 2022 11:53:07 +0200 Subject: [PATCH 3/3] put link in parentheses --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d80597c57..3e64d90402 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,7 @@ - Add `no_git=True` when creating a new pipeline and initialising a git repository is not needed in `nf-core lint` and `nf-core bump-version` ([#1709](https://github.com/nf-core/tools/pull/1709)) - Move `strip_ansi_code` function in lint to `utils.py` - Simplify control flow and don't use equality comparison for `None` and booleans -- Replace use of the deprecated `distutils` Version object with that from `packaging` [#1735](https://github.com/nf-core/tools/pull/1735) +- Replace use of the deprecated `distutils` Version object with that from `packaging` ([#1735](https://github.com/nf-core/tools/pull/1735)) ### Modules