From d672ca2cb07656ff3e6e418188a33cc9cc4d5408 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Wed, 10 Jun 2020 16:14:33 -0700 Subject: [PATCH] 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. --- scripts/eachdist.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/eachdist.py b/scripts/eachdist.py index f1c5e18b6..15b9b8edc 100755 --- a/scripts/eachdist.py +++ b/scripts/eachdist.py @@ -205,6 +205,7 @@ def parse_args(args=None): setup_instparser(instparser) 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("--eager-upgrades", action="store_true") @@ -214,7 +215,10 @@ def parse_args(args=None): ) setup_instparser(devparser) 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( @@ -424,7 +428,16 @@ def install_args(args): 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( parse_subargs( args,