From 188b88f9f7e77ab4d3e0f8a11a4f5256f53894b7 Mon Sep 17 00:00:00 2001 From: Marina Lafarga Magro Date: Mon, 27 May 2024 21:19:47 +0100 Subject: [PATCH] Update noxfile --- noxfile.py | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/noxfile.py b/noxfile.py index fb228ca..429fc17 100644 --- a/noxfile.py +++ b/noxfile.py @@ -7,30 +7,30 @@ def tests(session): session.run("pytest", *session.posargs) -# Integrate with GitHub Actions -# source: https://stackoverflow.com/questions/66747359/how-to-generate-a-github-actions-build-matrix-that-dynamically-includes-a-list-o -import itertools -import json - -@nox.session(python=False) -def gha_list(session): - """(mandatory arg: ) Prints all sessions available for , for GithubActions.""" - - # get the desired base session to generate the list for - if len(session.posargs) != 1: - raise ValueError("This session has a mandatory argument: ") - session_func = globals()[session.posargs[0]] - - # list all sessions for this base session - try: - session_func.parametrize - except AttributeError: - sessions_list = ["%s-%s" % (session_func.__name__, py) for py in session_func.python] - else: - sessions_list = ["%s-%s(%s)" % (session_func.__name__, py, param) - for py, param in itertools.product(session_func.python, session_func.parametrize)] - - # print the list so that it can be caught by GHA. - # Note that json.dumps is optional since this is a list of string. - # However it is to remind us that GHA expects a well-formatted json list of strings. - print(json.dumps(sessions_list)) \ No newline at end of file +# # Integrate with GitHub Actions +# # source: https://stackoverflow.com/questions/66747359/how-to-generate-a-github-actions-build-matrix-that-dynamically-includes-a-list-o +# import itertools +# import json + +# @nox.session(python=False) +# def gha_list(session): +# """(mandatory arg: ) Prints all sessions available for , for GithubActions.""" + +# # get the desired base session to generate the list for +# if len(session.posargs) != 1: +# raise ValueError("This session has a mandatory argument: ") +# session_func = globals()[session.posargs[0]] + +# # list all sessions for this base session +# try: +# session_func.parametrize +# except AttributeError: +# sessions_list = ["%s-%s" % (session_func.__name__, py) for py in session_func.python] +# else: +# sessions_list = ["%s-%s(%s)" % (session_func.__name__, py, param) +# for py, param in itertools.product(session_func.python, session_func.parametrize)] + +# # print the list so that it can be caught by GHA. +# # Note that json.dumps is optional since this is a list of string. +# # However it is to remind us that GHA expects a well-formatted json list of strings. +# print(json.dumps(sessions_list)) \ No newline at end of file