Skip to content

Commit

Permalink
Merge pull request #1222 from metacpan/haarg/less-prereqs
Browse files Browse the repository at this point in the history
drop some unneeded prereqs
  • Loading branch information
haarg authored May 19, 2024
2 parents ba2b68e + 6a2c163 commit 75671c5
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 37 deletions.
15 changes: 2 additions & 13 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ requires 'CatalystX::Fastly::Role::Response', '0.06';
requires 'CatalystX::InjectComponent';
requires 'CatalystX::RoleApplicator';
requires 'CHI', '0.61';
requires 'Config::Any', '0.32';
requires 'Config::General', '2.63';
requires 'Config::ZOMG', '1.000000';
requires 'Const::Fast';
Expand All @@ -35,18 +34,14 @@ requires 'CPAN::Meta::YAML', '0.018';
requires 'CPAN::Repository::Perms';
requires 'Cwd';
requires 'Data::DPath';
requires 'Data::Dump';
requires 'Data::Dumper';
requires 'Data::Printer', '1.000004';
requires 'DateTime', '1.54';
requires 'DateTime::Format::ISO8601';
requires 'DBD::SQLite', '1.66';
requires 'DBI', '1.643';
requires 'Devel::ArgNames';
requires 'Digest::MD5';
requires 'Digest::SHA';
requires 'ElasticSearchX::Model', '2.0.1';
requires 'Email::Address';
requires 'Email::Sender::Simple';
requires 'Email::Simple';
requires 'Email::Valid', '1.203';
Expand All @@ -73,17 +68,13 @@ requires 'Git::Helpers', '1.000001';
requires 'Gravatar::URL';
requires 'Hash::Merge::Simple';
requires 'HTML::Entities';
requires 'HTML::TokeParser::Simple';
requires 'HTTP::Request::Common', '6.36';
requires 'IO::All';
requires 'IO::Interactive';
requires 'IO::Prompt';
requires 'IO::String';
requires 'IO::Uncompress::Bunzip2', '2.106';
requires 'IO::Zlib';
requires 'IPC::Run3', '0.048';
requires 'JSON::MaybeXS', '1.004004'; # indirect dep
requires 'List::AllUtils', '0.09';
requires 'List::Util', '1.62';
requires 'Log::Any::Adapter';
requires 'Log::Any::Adapter::Log4perl';
Expand Down Expand Up @@ -126,10 +117,7 @@ requires 'MooseX::Types::Moose';
requires 'Mozilla::CA', '20211001';
requires 'namespace::autoclean';
requires 'Net::Fastly', '1.12';
requires 'Net::HTTP', '6.22'; # LWP::UserAgent
requires 'OrePAN2', '0.48';
requires 'Parse::CPAN::Packages::Fast', '0.09';
requires 'Parse::CSV', '2.04';
requires 'Parse::PMFile', '0.43';
requires 'Path::Iterator::Rule', '>=1.011';
requires 'PAUSE::Permissions', '0.17';
Expand All @@ -153,9 +141,9 @@ requires 'Regexp::Common::time';
requires 'Safe', '2.35'; # bug fixes (used by Parse::PMFile)
requires 'Scalar::Util', '1.62'; # Moose
requires 'Search::Elasticsearch', '== 2.03';
requires 'strictures', '1';
requires 'Term::Choose', '1.754'; # Git::Helpers
requires 'Throwable::Error';
requires 'Text::CSV_XS';
requires 'Time::Local';
requires 'Try::Tiny', '0.30';
requires 'Type::Tiny', '2.000001';
Expand All @@ -178,6 +166,7 @@ requires 'MetaCPAN::Client', '2.029000';
requires 'Module::Extract::Namespaces', '1.023';
requires 'Module::Faker', '== 0.017';
requires 'Module::Faker::Dist', '== 0.017';
requires 'OrePAN2', '0.48';
requires 'Parallel::ForkManager' => '2.02';
requires 'Perl::Critic', '0.140';
requires 'Perl::Tidy' => '== 20230309';
Expand Down
12 changes: 6 additions & 6 deletions improve-search-results/app.pl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use Mojolicious::Lite;

use Mojo::Pg;
use List::AllUtils 'first_index';
use List::Util qw(first);

my $user = getpwuid($<); # for vagrant user on dev box

Expand Down Expand Up @@ -82,8 +82,8 @@ sub _perform_sco {
my $url = Mojo::URL->new('http://search.cpan.org/search?mode=all&n=100');
$url->query([query => $search]);
my $tx = $c->app->ua->get($url);
my $res = $tx->res->dom->find('.sr')->map('all_text');
my $idx = first_index { $_ eq $expect } @{$res->to_array};
my $res = $tx->res->dom->find('.sr')->map('all_text')->to_array;
my $idx = first { $res->[$_] eq $expect } @{$res->to_array};
return $idx < 0 ? undef : $idx + 1;
}

Expand All @@ -92,8 +92,8 @@ sub _perform_mweb {
my $url = Mojo::URL->new('https://metacpan.org/search?size=100');
$url->query([q => $search]);
my $tx = $c->app->ua->get($url);
my $res = $tx->res->dom->find('.module-result big strong a')->map('all_text');
my $idx = first_index { $_ eq $expect } @{$res->to_array};
my $res = $tx->res->dom->find('.module-result big strong a')->map('all_text')->to_array;
my $idx = first { $res->[$_] eq $expect } 0 .. $#{$res};
return $idx < 0 ? undef : $idx + 1;
}

Expand Down Expand Up @@ -210,4 +210,4 @@ sub _perform_mweb {
drop table if exists searches cascade;
drop table if exists sources cascade;
drop table if exists results cascade;
drop table if exists results cascade;
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Document/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use utf8;
use Moose;
use ElasticSearchX::Model::Document;

use List::AllUtils qw( any );
use List::Util qw( any );
use MetaCPAN::Document::Module ();
use MetaCPAN::Types qw( Module );
use MetaCPAN::Types::TypeTiny qw(
Expand Down
3 changes: 1 addition & 2 deletions lib/MetaCPAN/Script/Backup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use strict;
use warnings;
use feature qw( state );

use Data::Printer;
use DateTime;
use IO::Zlib ();
use Cpanel::JSON::XS qw( decode_json encode_json );
Expand Down Expand Up @@ -112,7 +111,7 @@ sub run_restore {

try { $raw = decode_json($line) }
catch {
log_warn {"cannot decode JSON: $line --- $_"};
log_warn {"cannot decode JSON: $line --- $&"};
};

# Create our bulk_helper if we need,
Expand Down
17 changes: 9 additions & 8 deletions lib/MetaCPAN/Script/Tickets.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ use namespace::autoclean;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;

use HTTP::Request::Common qw( GET );
use IO::String ();
use Log::Contextual qw( :log :dlog );
use MetaCPAN::Types::TypeTiny ();
use Parse::CSV ();
use Text::CSV_XS ();
use Pithub ();
use Ref::Util qw( is_hashref is_ref );
use URI::Escape qw( uri_escape );
Expand Down Expand Up @@ -197,18 +196,20 @@ sub index_rt_bugs {

sub parse_tsv {
my ( $self, $tsv ) = @_;
$tsv =~ s/^#\s*(dist\s.+)/$1/m; # uncomment the field spec for Parse::CSV
$tsv
=~ s/^#\s*(dist\s.+)/$1/m; # uncomment the field spec for Text::CSV_XS
$tsv =~ s/^#.*\n//mg;

open my $fh, '<', \$tsv;

# NOTE: This is byte-oriented.
my $tsv_parser = Parse::CSV->new(
handle => IO::String->new($tsv),
my $tsv_parser = Text::CSV_XS->new( {
sep_char => "\t",
names => 1,
);
} );
$tsv_parser->header($fh);

my %summary;
while ( my $row = $tsv_parser->fetch ) {
while ( my $row = $tsv_parser->getline_hr($fh) ) {
$summary{ $row->{dist} }{'bugs'}{'rt'} = {
source => $self->rt_dist_url( $row->{dist} ),
active => $row->{active},
Expand Down
1 change: 0 additions & 1 deletion lib/MetaCPAN/Server/Controller.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use Moose;
use namespace::autoclean;

use Cpanel::JSON::XS ();
use List::AllUtils ();
use Moose::Util ();
use MetaCPAN::Types::TypeTiny qw( HashRef );
use MetaCPAN::Util qw( single_valued_arrayref_to_scalar );
Expand Down
3 changes: 1 addition & 2 deletions t/lib/MetaCPAN/Tests/Controller/Search/DownloadURL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ sub run {
"GET $module" );
my $json = decode_json_ok($res);

use Data::Dump qw(pp);
print STDERR ( pp( scalar $json ), "\n" );
diag explain $json;

# my $got
# = [ map { $_->{_source}{documentation} }
Expand Down
8 changes: 4 additions & 4 deletions t/release/packages-unclaimable.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use warnings;
use lib 't/lib';

use Cpanel::JSON::XS ();
use IO::String ();
use List::AllUtils qw( uniq );
use List::Util qw( uniq );
use MetaCPAN::Server::Test;
use MetaCPAN::TestHelpers qw( test_release );
use Module::Metadata ();
Expand Down Expand Up @@ -42,9 +41,10 @@ test_release(

my $content = $self->file_content('lib/Packages/Unclaimable.pm');

open my $fh, '<', \$content;

my $mm
= Module::Metadata->new_from_handle(
IO::String->new($content),
= Module::Metadata->new_from_handle( $fh,
'lib/Packages/Unclaimable.pm' );

is_deeply [ uniq sort $mm->packages_inside ],
Expand Down

0 comments on commit 75671c5

Please sign in to comment.