Carmel
view release on metacpan or search on metacpan
"ExtUtils::InstallPaths" : "0",
"File::Copy::Recursive" : "0",
"File::pushd" : "1.009",
"JSON" : "0",
"Menlo::CLI::Compat" : "1.9018",
"Module::CPANfile" : "1.1000",
"Module::CoreList" : "0",
"Module::Metadata" : "1.000003",
"Module::Runtime" : "0.014",
"Path::Tiny" : "0.068",
"Try::Tiny" : "0.20",
"perl" : "5.014000"
}
},
"test" : {
"requires" : {
"Test::More" : "0.96"
}
}
},
"release_status" : "stable",
ExtUtils::InstallPaths: '0'
File::Copy::Recursive: '0'
File::pushd: '1.009'
JSON: '0'
Menlo::CLI::Compat: '1.9018'
Module::CPANfile: '1.1000'
Module::CoreList: '0'
Module::Metadata: '1.000003'
Module::Runtime: '0.014'
Path::Tiny: '0.068'
Try::Tiny: '0.20'
perl: '5.014000'
resources:
bugtracker: https://github.com/miyagawa/Carmel/issues
homepage: https://github.com/miyagawa/Carmel
repository: https://github.com/miyagawa/Carmel.git
version: v0.1.56
x_contributors:
- 'Jan Seidl <seidl@avast.com>'
- 'Jarrod Funnell <jfunnell@multiservice.com>'
- 'Scott Wiersdorf <scott@perlcode.org>'
Makefile.PL view on Meta::CPAN
"ExtUtils::InstallPaths" => 0,
"File::Copy::Recursive" => 0,
"File::pushd" => "1.009",
"JSON" => 0,
"Menlo::CLI::Compat" => "1.9018",
"Module::CPANfile" => "1.1000",
"Module::CoreList" => 0,
"Module::Metadata" => "1.000003",
"Module::Runtime" => "0.014",
"Path::Tiny" => "0.068",
"Try::Tiny" => "0.20"
},
"TEST_REQUIRES" => {
"Test::More" => "0.96"
},
"VERSION" => "v0.1.56",
"test" => {
"TESTS" => "t/*.t"
}
);
Makefile.PL view on Meta::CPAN
"File::Copy::Recursive" => 0,
"File::pushd" => "1.009",
"JSON" => 0,
"Menlo::CLI::Compat" => "1.9018",
"Module::CPANfile" => "1.1000",
"Module::CoreList" => 0,
"Module::Metadata" => "1.000003",
"Module::Runtime" => "0.014",
"Path::Tiny" => "0.068",
"Test::More" => "0.96",
"Try::Tiny" => "0.20"
);
unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
delete $WriteMakefileArgs{TEST_REQUIRES};
delete $WriteMakefileArgs{BUILD_REQUIRES};
$WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
> echo /.carmel >> .gitignore
> git add cpanfile cpanfile.snapshot .gitignore
> git commit -m "add Plack and Starman"
# On a new setup, or another developer's machine
> git pull
> carmel install
> carmel exec starman -p 8080 myapp.psgi
# Add a new dependency
> echo "requires 'Try::Tiny';" >> cpanfile
> carmel install
> git commit -am 'Add Try::Tiny'
# Update Plack to the latest
> carmel update Plack
Production Deployments
Carmel allows you to manage all the dependencies the same way across
development environments and production environments. However, there
might be cases where you want to avoid running your application with
carmel exec in production, to avoid the overhead with large number of
requires 'JSON';
requires 'Class::Tiny', '1.001';
requires 'CPAN::Meta::Requirements', '2.129';
requires 'CPAN::Meta::Prereqs', '2.132830';
requires 'Module::CoreList';
requires 'Module::CPANfile', '1.1000';
requires 'Module::Runtime', '0.014';
requires 'Module::Metadata', '1.000003';
requires 'Path::Tiny', '0.068';
requires 'Try::Tiny', '0.20';
requires 'File::Copy::Recursive';
requires 'CPAN::DistnameInfo';
requires 'File::pushd', '1.009';
requires 'ExtUtils::Install', '1.47';
requires 'ExtUtils::InstallPaths';
requires 'Carton', 'v1.0.35';
# vendor
lib/Carmel.pm view on Meta::CPAN
> echo /.carmel >> .gitignore
> git add cpanfile cpanfile.snapshot .gitignore
> git commit -m "add Plack and Starman"
# On a new setup, or another developer's machine
> git pull
> carmel install
> carmel exec starman -p 8080 myapp.psgi
# Add a new dependency
> echo "requires 'Try::Tiny';" >> cpanfile
> carmel install
> git commit -am 'Add Try::Tiny'
# Update Plack to the latest
> carmel update Plack
=head2 Production Deployments
Carmel allows you to manage all the dependencies the same way across development
environments and production environments. However, there might be cases where
you want to avoid running your application with C<carmel exec> in production, to
avoid the overhead with large number of include paths, or to avoid installing
lib/Carmel/App.pm view on Meta::CPAN
use Carmel::Repository;
use Carmel::Resolver;
use Carmel::ProgressBar qw(progress);
use Config qw(%Config);
use CPAN::Meta::Requirements;
use Getopt::Long ();
use Module::CPANfile;
use Module::Metadata;
use Path::Tiny ();
use Pod::Usage ();
use Try::Tiny;
# prefer Parse::CPAN::Meta in XS, PP order with JSON.pm
$ENV{PERL_JSON_BACKEND} = 1
unless defined $ENV{PERL_JSON_BACKEND};
use Class::Tiny {
verbose => sub { 0 },
perl_arch => sub { "$Config{version}-$Config{archname}" },
};
lib/Carmel/Resolver.pm view on Meta::CPAN
package Carmel::Resolver;
use strict;
use warnings;
use Class::Tiny qw( repo snapshot root seen found missing );
use Module::CoreList;
use Try::Tiny;
sub resolve {
my $self = shift;
my $clone = $self->root->clone;
my $seen = {};
my $depth = 0;
$self->resolve_recurse($clone, $seen, $depth);
}
xt/cli/devel.t view on Meta::CPAN
use strict;
use Test::More;
use lib ".";
use xt::CLI;
subtest 'carmel install' => sub {
my $app = cli();
$app->write_cpanfile(<<EOF);
requires 'Try::Tiny';
EOF
$app->run_ok("install");
$app->run_ok("exec", "perl", "-e", "use Moose; warn \$INC{'Moose.pm'}");
like $app->stderr, qr/Can't locate Moose.pm/;
};
done_testing;
xt/cli/dist.t view on Meta::CPAN
use strict;
use Test::More;
use lib ".";
use xt::CLI;
subtest 'dist support' => sub {
my $app = cli();
# TODO: needs == since newer version might have already satisfy the version
$app->write_cpanfile(<<EOF);
requires 'Try::Tiny', '== 0.29',
dist => 'ETHER/Try-Tiny-0.29.tar.gz';
EOF
$app->run_ok("install");
$app->run_ok("list");
like $app->stdout, qr/Try::Tiny \(0\.29\)/;
};
done_testing;
xt/cli/exact.t view on Meta::CPAN
use strict;
use Test::More;
use lib ".";
use xt::CLI;
subtest 'carmel install with exact' => sub {
my $app = cli();
$app->write_cpanfile(<<EOF);
requires 'Try::Tiny', '== 0.22';
EOF
$app->run_ok("install");
$app->run_ok("list");
like $app->stdout, qr/Try::Tiny \(0\.22\)/ or diag $app->stderr;
};
done_testing;
xt/cli/resolver.t view on Meta::CPAN
use strict;
use Test::More;
use lib ".";
use xt::CLI;
subtest 'carmel install' => sub {
my $app = cli(clean => 1);
$app->write_cpanfile(<<EOF);
requires 'Try::Tiny';
EOF
$app->run_fails("list");
like $app->stderr, qr/Can't find an artifact for Try::Tiny/;
$app->run_ok("install");
$app->run_ok("list");
like $app->stdout, qr/Try::Tiny \(/ or diag $app->stderr;
$app->write_cpanfile(<<EOF);
requires 'Try::Tiny', '< 0.22';
EOF
$app->run_fails("list");
like $app->stderr, qr/Can't find an artifact for Try::Tiny => < 0\.22/;
$app->run_ok("install");
$app->run_ok("show", "Try::Tiny");
like $app->stdout, qr/Try-Tiny-0\.21/ or diag $app->stderr;
$app->run_ok("find", "Try::Tiny");
my @lines = grep length, split /\n/, $app->stdout;
is @lines, 2;
$app->write_cpanfile(<<EOF);
requires 'Try::Tiny', '0.22';
EOF
$app->run_ok("install");
like $app->stdout, qr/Using Try::Tiny/ or diag $app->stderr;
$app->run_ok("show", "Try::Tiny");
like $app->stdout, qr/Try-Tiny-0/ or diag $app->stderr;
};
done_testing;
xt/cli/snapshot.t view on Meta::CPAN
$app->run_ok("install");
unlike $app->stderr, qr/Can't find an artifact for Parse::PMFile/;
};
subtest 'carmel install on the first run with empty build cache' => sub {
my $app = cli();
$app->write_cpanfile(<<EOF);
requires 'Try::Tiny', '== 0.06';
EOF
$app->run_ok("install");
like( ($app->snapshot->distributions)[0]->name, qr/Try-Tiny-0\.06/ );
for my $v (['Try::Tiny', '0.06'], ['Test::Fatal', '0.016']) {
my $artifact = $app->repo->find($v->[0], "== $v->[1]");
$artifact->path->remove_tree({ safe => 0 }) if $artifact;
}
# This used to be failing 50% of the time but carmel should auto retry install
$app->write_cpanfile(<<EOF);
requires 'Try::Tiny';
requires 'Test::Fatal', '== 0.016'; # requires Try::Tiny 0.07
EOF
$app->run("install");
unlike $app->stderr, qr/Can't merge requirement/;
like $app->stdout, qr/Successfully installed Try-Tiny-/;
like $app->stdout, qr/Successfully installed Test-Fatal-/ or diag $app->stderr;
my($dist) = grep { $_->name =~ /Try-Tiny/ } $app->snapshot->distributions;
if ($dist && $dist->name =~ /^Try-Tiny-(.*)/) {
cmp_ok $1, '>', '0.07';
xt/cli/update.t view on Meta::CPAN
$app->run_ok("list");
like $app->stdout, qr/Class::Tiny \(1\.00[6-9]\)/, "Bump the version";
};
subtest 'carmel update module' => sub {
my $app = cli();
$app->write_cpanfile(<<EOF);
requires 'Class::Tiny', '== 1.003';
requires 'Try::Tiny', '== 0.28';
EOF
$app->run_ok("install");
like( $app->snapshot->find("Class::Tiny")->name, qr/Class-Tiny-1\.003/ );
$app->write_cpanfile(<<EOF);
requires 'Class::Tiny', '1.003';
requires 'Try::Tiny', '0.28';
EOF
$app->run_ok("install");
like $app->stdout, qr/Using Class::Tiny \(1\.003\)/, "Use the version in snapshot";
like $app->stdout, qr/Using Try::Tiny \(0\.28\)/, "Use the version in snapshot";
$app->run_ok("update", "Class::Tiny");
like $app->stdout, qr/Using Try::Tiny \(0\.28\)/, "Try::Tiny is not affected";
like( $app->snapshot->find("Class::Tiny")->name, qr/Class-Tiny-1\.00[6-9]/ );
like( $app->snapshot->find("Try::Tiny")->name, qr/Try-Tiny-0\.28/ );
$app->run_ok("list");
like $app->stdout, qr/Class::Tiny \(1\.00[6-9]\)/, "Bump the version";
like $app->stdout, qr/Try::Tiny \(0\.28\)/, "Bump the version";
$app->run_ok("update", "Try::Tiny");
like( $app->snapshot->find("Class::Tiny")->name, qr/Class-Tiny-1\.00[6-9]/ );
like( $app->snapshot->find("Try::Tiny")->name, qr/Try-Tiny-/ );
unlike( $app->snapshot->find("Try::Tiny")->name, qr/Try-Tiny-0\.28/ );
$app->run_fails("update", "HTTP::Tiny");
like $app->stderr, qr/HTTP::Tiny is not found in/;
};
subtest 'carmel update with pinned cpanfile' => sub {
my $app = cli();
$app->write_cpanfile(<<EOF);
requires 'Class::Tiny', '== 1.003';
( run in 1.175 second using v1.01-cache-2.11-cpan-05444aca049 )