File Coverage

blib/lib/Alien/CPython3.pm
Criterion Covered Total %
statement 19 23 82.6
branch 1 4 25.0
condition 1 3 33.3
subroutine 7 7 100.0
pod 1 2 50.0
total 29 39 74.3


line stmt bran cond sub pod time code
1             package Alien::CPython3;
2             $Alien::CPython3::VERSION = '0.01';
3 1     1   285107 use strict;
  1         10  
  1         28  
4 1     1   43 use warnings;
  1         3  
  1         34  
5 1     1   5 use base qw( Alien::Base );
  1         121  
  1         1206  
6 1     1   5913 use 5.008004;
  1         3  
7              
8 1     1   6 use Path::Tiny qw(path);
  1         2  
  1         182  
9              
10             sub exe {
11 1     1 0 19891 my($class) = @_;
12 1         8 $class->runtime_prop->{command};
13             }
14              
15             sub bin_dir {
16 2     2 1 385218 my $class = shift;
17 2 50 33     18 if($class->install_type('share') && defined $class->runtime_prop->{share_bin_dir_rel}) {
18 0         0 my $prop = $class->runtime_prop;
19             return
20 0         0 map { path($_)->absolute($class->dist_dir)->stringify }
21 0 0       0 ref $prop->{share_bin_dir_rel} ? @{ $prop->{share_bin_dir_rel} } : ($prop->{share_bin_dir_rel});
  0         0  
22             } else {
23 2         93 return $class->SUPER::bin_dir(@_);
24             }
25             }
26              
27             1;
28              
29             =head1 NAME
30              
31             Alien::CPython3 - Find or build Python
32              
33             =head1 SYNOPSIS
34              
35             From L:
36              
37             use ExtUtils::MakeMaker;
38             use Alien::Base::Wrapper ();
39              
40             WriteMakefile(
41             Alien::Base::Wrapper->new('Alien::CPython3')->mm_args2(
42             NAME => 'FOO::XS',
43             ...
44             ),
45             );
46              
47             From L:
48              
49             use Module::Build;
50             use Alien::Base::Wrapper qw( Alien::CPython3 !export );
51             use Alien::CPython3;
52              
53             my $build = Module::Build->new(
54             ...
55             configure_requires => {
56             'Alien::Base::Wrapper' => '0',
57             'Alien::CPython3' => '0',
58             ...
59             },
60             Alien::Base::Wrapper->mb_args,
61             ...
62             );
63              
64             $build->create_build_script;
65              
66             From L / L script:
67              
68             use Inline 0.56 with => 'Alien::CPython3';
69              
70             From L
71              
72             [@Filter]
73             -bundle = @Basic
74             -remove = MakeMaker
75              
76             [Prereqs / ConfigureRequires]
77             Alien::CPython3 = 0
78              
79             [MakeMaker::Awesome]
80             header = use Alien::Base::Wrapper qw( Alien::CPython3 !export );
81             WriteMakefile_arg = Alien::Base::Wrapper->mm_args
82              
83             Command line tool:
84              
85             use Alien::CPython3;
86             use Env qw( @PATH );
87              
88             unshift @PATH, Alien::CPython3->bin_dir;
89              
90             =head1 DESCRIPTION
91              
92             This distribution provides Python so that it can be used by other
93             Perl distributions that are on CPAN. It does this by first trying to
94             detect an existing install of Python on your system. If found it
95             will use that. If it cannot be found, the source code will be downloaded
96             from the internet and it will be installed in a private share location
97             for the use of other modules.
98              
99             =head1 SEE ALSO
100              
101             =over 4
102              
103             =item L
104              
105             Documentation on the Alien concept itself.
106              
107             =item L
108              
109             The base class for this Alien.
110              
111             =item L
112              
113             Detailed manual for users of Alien classes.
114              
115             =back
116              
117             =cut