mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
Use cpanminus if available for perl pre-commit dependencies
cpanminus is broadly compatible with our syntax use of cpan, but can offer additional benefits such as Pkg::Name@Version definitions, as well as built-in modules to reduce the environment requirements on the system when resolving dependencies. Tests have been updated to ensure functionality works with either utility.
This commit is contained in:
parent
8189370615
commit
51248d1727
2 changed files with 19 additions and 4 deletions
|
|
@ -45,6 +45,13 @@ def install_environment(
|
|||
lang_base.assert_version_default('perl', version)
|
||||
|
||||
with in_env(prefix, version):
|
||||
lang_base.setup_cmd(
|
||||
prefix, ('cpan', '-T', '.', *additional_dependencies),
|
||||
)
|
||||
if lang_base.exe_exists('cpanm'):
|
||||
lang_base.setup_cmd(
|
||||
prefix,
|
||||
('cpanm', '.', *additional_dependencies),
|
||||
)
|
||||
else:
|
||||
lang_base.setup_cmd(
|
||||
prefix,
|
||||
('cpan', '-T', '.', *additional_dependencies),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue