chore: installation of test packages in eachdist (#794)

eachdist.py did not support the installation of test packages,
(as defined by the extra_requires:test package group). As a
result, test packages were being added to dev-requirements.txt

By having eachdist.py develop install test packages, and moving
develop/test package definitions to the individual instrumentations,
it is easier to determine which packages require which dependencies
for testing purposes, and enables support for existing dependencies
that follow the extra_requires:test pattern.
This commit is contained in:
Yusuke Tsutsumi
2020-06-10 16:14:33 -07:00
committed by GitHub
parent 1536a863da
commit d672ca2cb0

View File

@ -205,6 +205,7 @@ def parse_args(args=None):
setup_instparser(instparser) setup_instparser(instparser)
instparser.add_argument("--editable", "-e", action="store_true") instparser.add_argument("--editable", "-e", action="store_true")
instparser.add_argument("--with-test-deps", action="store_true")
instparser.add_argument("--with-dev-deps", action="store_true") instparser.add_argument("--with-dev-deps", action="store_true")
instparser.add_argument("--eager-upgrades", action="store_true") instparser.add_argument("--eager-upgrades", action="store_true")
@ -214,7 +215,10 @@ def parse_args(args=None):
) )
setup_instparser(devparser) setup_instparser(devparser)
devparser.set_defaults( devparser.set_defaults(
editable=True, with_dev_deps=True, eager_upgrades=True editable=True,
with_dev_deps=True,
eager_upgrades=True,
with_test_deps=True,
) )
lintparser = subparsers.add_parser( lintparser = subparsers.add_parser(
@ -424,7 +428,16 @@ def install_args(args):
check=True, check=True,
) )
allfmt = "-e 'file://{}'" if args.editable else "'file://{}'" allfmt = "-e 'file://{}" if args.editable else "'file://{}"
# packages should provide an extra_requires that is named
# 'test', to denote test dependencies.
extras = []
if args.with_test_deps:
extras.append("test")
if extras:
allfmt += "[{}]".format(",".join(extras))
# note the trailing single quote, to close the quote opened above.
allfmt += "'"
execute_args( execute_args(
parse_subargs( parse_subargs(
args, args,