Fix tooling (#1322)

* Update scripts/eachdist.py

Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
This commit is contained in:
Ofek Lev 2022-09-10 04:36:42 -04:00 committed by GitHub
parent 4c2382338d
commit f6c24698b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 7 deletions

View File

@ -518,18 +518,19 @@ def lint_args(args):
runsubprocess( runsubprocess(
args.dry_run, args.dry_run,
("black", ".") + (("--diff", "--check") if args.check_only else ()), ("black", "--config", f"{rootdir}/pyproject.toml", ".")
+ (("--diff", "--check") if args.check_only else ()),
cwd=rootdir, cwd=rootdir,
check=True, check=True,
) )
runsubprocess( runsubprocess(
args.dry_run, args.dry_run,
("isort", ".") ("isort", "--settings-path", f"{rootdir}/.isort.cfg", ".")
+ (("--diff", "--check-only") if args.check_only else ()), + (("--diff", "--check-only") if args.check_only else ()),
cwd=rootdir, cwd=rootdir,
check=True, check=True,
) )
runsubprocess(args.dry_run, ("flake8", rootdir), check=True) runsubprocess(args.dry_run, ("flake8", "--config", f"{rootdir}/.flake8", rootdir), check=True)
execute_args( execute_args(
parse_subargs( parse_subargs(
args, ("exec", "pylint {}", "--all", "--mode", "lintroots") args, ("exec", "pylint {}", "--all", "--mode", "lintroots")
@ -644,7 +645,7 @@ def update_dependencies(targets, version, packages):
update_files( update_files(
targets, targets,
"setup.cfg", "pyproject.toml",
fr"({package_name}.*)==(.*)", fr"({package_name}.*)==(.*)",
r"\1== " + version, r"\1== " + version,
) )
@ -717,13 +718,16 @@ def format_args(args):
format_dir = str(find_projectroot()) format_dir = str(find_projectroot())
if args.path: if args.path:
format_dir = os.path.join(format_dir, args.path) format_dir = os.path.join(format_dir, args.path)
root_dir = str(find_projectroot())
runsubprocess( runsubprocess(
args.dry_run, ("black", "."), cwd=format_dir, check=True, args.dry_run,
("black", "--config", f"{root_dir}/pyproject.toml", "."),
cwd=format_dir,
check=True,
) )
runsubprocess( runsubprocess(
args.dry_run, args.dry_run,
("isort", "--profile", "black", "."), ("isort", "--settings-path", f"{root_dir}/.isort.cfg", "--profile", "black", "."),
cwd=format_dir, cwd=format_dir,
check=True, check=True,
) )