Also read cpanfile when using dist-inkt.

This commit is contained in:
Jelmer Vernooij 2021-03-26 01:27:01 +00:00
parent 56f3e3f87c
commit fd6c9fdeec
No known key found for this signature in database
GPG key ID: 579C160D4C9E23E8

View file

@ -912,6 +912,8 @@ class DistZilla(BuildSystem):
out = session.check_output(["dzil", "authordeps"]) out = session.check_output(["dzil", "authordeps"])
for entry in out.splitlines(): for entry in out.splitlines():
yield "build", PerlModuleRequirement(entry.decode().strip()) yield "build", PerlModuleRequirement(entry.decode().strip())
if os.path.exists(os.path.join(os.path.dirname(self.path), "cpanfile")):
yield from _declared_deps_from_cpanfile(session)
class RunTests(BuildSystem): class RunTests(BuildSystem):
@ -942,6 +944,11 @@ def _read_cpanfile(session, args, kind):
yield kind, PerlModuleRequirement(line.decode().strip()) yield kind, PerlModuleRequirement(line.decode().strip())
def _declared_deps_from_cpanfile(session):
yield from _read_cpanfile(session, ['--configure', '--build'], 'build')
yield from _read_cpanfile(session, ['--test'], 'test')
class Make(BuildSystem): class Make(BuildSystem):
name = "make" name = "make"
@ -1083,8 +1090,7 @@ class Make(BuildSystem):
yield "build", PerlModuleRequirement(require) yield "build", PerlModuleRequirement(require)
something = True something = True
if os.path.exists(os.path.join(self.path, "cpanfile")): if os.path.exists(os.path.join(self.path, "cpanfile")):
yield from _read_cpanfile(session, ['--configure', '--build'], 'build') yield from _declared_deps_from_cpanfile(session)
yield from _read_cpanfile(session, ['--test'], 'test')
something = True something = True
if not something: if not something:
raise NotImplementedError raise NotImplementedError