From 1bec90b608990376767648b53b08785de0d6995f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branislav=20Zahradn=C3=ADk?= Date: Sat, 3 May 2025 17:49:58 +0200 Subject: [PATCH 1/7] Dist::Zilla::PluginBundle::RJBS 5.028 changed their Perl version to v5.36 --- cpanfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpanfile b/cpanfile index f2b31fa..b321fbb 100644 --- a/cpanfile +++ b/cpanfile @@ -91,8 +91,12 @@ if ( "$]" >= 5.020 ) { if ( "$]" < 5.026 ) { requires 'Dist::Zilla::PluginBundle::RJBS', '==5.023'; } + elsif ( "$]" < 5.034 ) { + requires 'Dist::Zilla::PluginBundle::RJBS', '==5.025'; + } else { - requires 'Dist::Zilla::PluginBundle::RJBS'; + # 5.028 requires v5.36 whereas newer versions only v5.34 + requires 'Dist::Zilla::PluginBundle::RJBS', '>5.028'; } requires 'Dist::Zilla::PluginBundle::Starter::Git'; From b29ca71d7230014fb1a255a08448f3de5114ab81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branislav=20Zahradn=C3=ADk?= Date: Sat, 3 May 2025 17:14:13 +0200 Subject: [PATCH 2/7] Introduce helper function `requires_by_perl` Function allows to specify multiple required version based on Perl version. Usable when module changes their Perl requirements. --- cpanfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/cpanfile b/cpanfile index b321fbb..064c435 100644 --- a/cpanfile +++ b/cpanfile @@ -1,6 +1,38 @@ use strict; # satisfy linter use warnings; # satisfy linter +=pod + +Semantic sugar to simplify management of modules which changed their required Perl version +(directly or via dependencies) + + requires_by_perl Module, + prior 5.010 => 'use version X', + prior 5.012 => 'use version Y', + otherwise do_not_install + ; + +=cut + +sub requires_by_perl { + my @requires = (shift); + + while (@_) { + shift, next + unless @_ == 1 || $] < shift + ; + + push @requires, shift // return; + last; + } + + requires @requires; +} + +sub prior { @_ } +sub otherwise { @_ } +sub do_not_install { undef } + # Last versions which install on < 5.12 if ( "$]" < 5.012 ) { requires 'Data::Section', '==0.200007'; From b5af863968ac950aa274173528c95aa0aa05b435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branislav=20Zahradn=C3=ADk?= Date: Tue, 6 May 2025 15:24:33 +0200 Subject: [PATCH 3/7] Example, how to use requires_by_perl on D::Z::PluginBundle::RJBS --- cpanfile | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/cpanfile b/cpanfile index 064c435..3f539e6 100644 --- a/cpanfile +++ b/cpanfile @@ -120,16 +120,12 @@ if ( "$]" >= 5.020 ) { requires 'Dist::Zilla::PluginBundle::DROLSKY'; requires 'Dist::Zilla::PluginBundle::Milla'; - if ( "$]" < 5.026 ) { - requires 'Dist::Zilla::PluginBundle::RJBS', '==5.023'; - } - elsif ( "$]" < 5.034 ) { - requires 'Dist::Zilla::PluginBundle::RJBS', '==5.025'; - } - else { - # 5.028 requires v5.36 whereas newer versions only v5.34 - requires 'Dist::Zilla::PluginBundle::RJBS', '>5.028'; - } + requires_by_perl 'Dist::Zilla::PluginBundle::RJBS', + prior 5.020 => do_not_install, + prior 5.026 => '==5.023', + prior 5.034 => '==5.025', + otherwise '>5.028' # 5.028 requires v5.36 whereas following versions only v5.34, so omit it + ; requires 'Dist::Zilla::PluginBundle::Starter::Git'; requires 'Dist::Zilla::Plugin::CheckChangeLog'; From 06bab19b73c77a557fb3d340a99fe2cb982c690f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branislav=20Zahradn=C3=ADk?= Date: Tue, 6 May 2025 17:03:11 +0200 Subject: [PATCH 4/7] Test2::Harness 2.000005 changed their Perl version to 5.14 --- cpanfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cpanfile b/cpanfile index 3f539e6..953098a 100644 --- a/cpanfile +++ b/cpanfile @@ -90,19 +90,24 @@ requires 'Test::Synopsis'; requires 'Test::Version'; requires 'Test::Warnings'; +requires_by_perl 'Test2::Harness', + prior 5.010 => do_not_install, + prior 5.014 => '==1.000156', + ; + +requires_by_perl 'Test2::Harness::Renderer::JUnit', + prior 5.010001 => do_not_install, + prior 5.014 => '==1.000005', + ; + if ( "$]" >= 5.010 ) { requires 'Devel::Cover'; requires 'Devel::Cover::Report::Codecov'; requires 'Devel::Cover::Report::Coveralls'; requires 'Minilla'; - requires 'Test2::Harness'; requires 'Test::Vars'; } -if ( "$]" >= 5.010001 ) { - requires 'Test2::Harness::Renderer::JUnit'; -} - if ( "$]" >= 5.012 ) { requires 'Code::TidyAll::Plugin::SortLines::Naturally'; requires 'Code::TidyAll::Plugin::Test::Vars'; From b0bbea8d39569cec2a99739c82519923be74ba78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branislav=20Zahradn=C3=ADk?= Date: Wed, 7 May 2025 06:46:56 +0200 Subject: [PATCH 5/7] podlators v6.0.0 changed their Perl version to v5.12 --- cpanfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cpanfile b/cpanfile index 953098a..834f769 100644 --- a/cpanfile +++ b/cpanfile @@ -33,6 +33,11 @@ sub prior { @_ } sub otherwise { @_ } sub do_not_install { undef } +requires_by_perl 'Pod::Man', + prior 5.010 => '==4.14', + prior 5.012 => '==5.01', + ; + # Last versions which install on < 5.12 if ( "$]" < 5.012 ) { requires 'Data::Section', '==0.200007'; @@ -48,11 +53,9 @@ else { } if ( "$]" >= 5.010 ) { - requires 'Pod::Man', '>= 5.00'; requires 'Perl::Critic', '>= 1.144'; } else { - requires 'Pod::Man', '==4.14'; requires 'Perl::Critic', '==1.142'; } From 2d6a301437a0f792acb9950e7cb6cdd7fba94ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branislav=20Zahradn=C3=ADk?= Date: Tue, 6 May 2025 17:31:18 +0200 Subject: [PATCH 6/7] Devel::Cover 1.43 change their Perl version to v5.12 --- cpanfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpanfile b/cpanfile index 834f769..e83c79c 100644 --- a/cpanfile +++ b/cpanfile @@ -93,6 +93,11 @@ requires 'Test::Synopsis'; requires 'Test::Version'; requires 'Test::Warnings'; +requires_by_perl 'Devel::Cover', + prior 5.010 => do_not_install, + prior 5.012 => '==1.42', + ; + requires_by_perl 'Test2::Harness', prior 5.010 => do_not_install, prior 5.014 => '==1.000156', @@ -104,7 +109,6 @@ requires_by_perl 'Test2::Harness::Renderer::JUnit', ; if ( "$]" >= 5.010 ) { - requires 'Devel::Cover'; requires 'Devel::Cover::Report::Codecov'; requires 'Devel::Cover::Report::Coveralls'; requires 'Minilla'; From c5a718765b15adc5ced0736929f62c2e9fd0a2c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branislav=20Zahradn=C3=ADk?= Date: Tue, 6 May 2025 17:37:44 +0200 Subject: [PATCH 7/7] Test::MockModule 0.179 added incompatible requirement Software::License - 0.104006 --- cpanfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpanfile b/cpanfile index e83c79c..84fd5a4 100644 --- a/cpanfile +++ b/cpanfile @@ -77,7 +77,6 @@ requires 'Test::Differences'; requires 'Test::EOL'; requires 'Test::Fatal'; requires 'Test::MinimumVersion'; -requires 'Test::MockModule'; requires 'Test::Mojibake'; requires 'Test::More'; requires 'Test::Needs'; @@ -98,6 +97,10 @@ requires_by_perl 'Devel::Cover', prior 5.012 => '==1.42', ; +requires_by_perl 'Test::MockModule', + prior 5.012 => '==0.178', + ; + requires_by_perl 'Test2::Harness', prior 5.010 => do_not_install, prior 5.014 => '==1.000156',