From 12645f24bb7bbbaa3baaef4d3fede2c212ca0342 Mon Sep 17 00:00:00 2001 From: Verena Chung <9377970+vpchung@users.noreply.github.com> Date: Thu, 30 Nov 2023 13:36:28 -0800 Subject: [PATCH] Release v4.3.0 (#253) * remove support for 3.7, add support for 3.11+ * update version, add changelog for v4.3 * update ci * lint * update action versions to latest * fix test for 3.12 --- .github/workflows/pythonapp.yml | 8 +++--- .github/workflows/pythonpublish.yml | 4 +-- .github/workflows/sphinx-ghpages.yaml | 4 +-- challengeutils/__main__.py | 9 +++--- challengeutils/__version__.py | 2 +- challengeutils/create_portal_challenge.py | 34 +++++++++++------------ docs/about/changelog.rst | 6 ++++ docs/conf.py | 2 +- setup.cfg | 5 ++-- tests/test_processor.py | 6 ++-- 10 files changed, 42 insertions(+), 38 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 5dceaec7..73a2d759 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -15,11 +15,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9, '3.10'] + python-version: [3.8, 3.9, '3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4.7.1 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -59,7 +59,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: psf/black@stable finish-coveralls: diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index d5f3859d..344bcf1c 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -13,9 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v4.7.1 with: python-version: '3.x' - name: Install dependencies diff --git a/.github/workflows/sphinx-ghpages.yaml b/.github/workflows/sphinx-ghpages.yaml index e0a9468a..6e3403d0 100644 --- a/.github/workflows/sphinx-ghpages.yaml +++ b/.github/workflows/sphinx-ghpages.yaml @@ -7,14 +7,14 @@ jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # Standard drop-in approach that should work for most people. - uses: ammaraskar/sphinx-action@master with: docs-folder: "docs/" # Great extra actions to compose with: # Create an artifact of the html output. - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v3.1.3 with: name: DocumentationHTML path: docs/_build/html/ diff --git a/challengeutils/__main__.py b/challengeutils/__main__.py index 4572c5e9..11d4cfcb 100644 --- a/challengeutils/__main__.py +++ b/challengeutils/__main__.py @@ -469,16 +469,15 @@ def build_parser(): parser_create_portal_challenge = subparsers.add_parser( "create-portal-challenge", - help="Create a Sage Challenge Portal challenge from template" + help="Create a Sage Challenge Portal challenge from template", ) parser_create_portal_challenge.add_argument("challenge_name", help="Challenge name") parser_create_portal_challenge.add_argument( "-t", "--tasks_count", - type=int, default=1, - help=( - "Number of challenge tasks (default: 1)" - ), + type=int, + default=1, + help=("Number of challenge tasks (default: 1)"), ) parser_create_portal_challenge.add_argument( "--livesiteid", diff --git a/challengeutils/__version__.py b/challengeutils/__version__.py index aef46acb..111dc917 100644 --- a/challengeutils/__version__.py +++ b/challengeutils/__version__.py @@ -1 +1 @@ -__version__ = "4.2.1" +__version__ = "4.3.0" diff --git a/challengeutils/create_portal_challenge.py b/challengeutils/create_portal_challenge.py index b14f762d..f91be7a7 100644 --- a/challengeutils/create_portal_challenge.py +++ b/challengeutils/create_portal_challenge.py @@ -27,7 +27,7 @@ PORTAL_TABLE = "syn51476218" CHALLENGE_TEMPLATE_SYNID = "syn52941681" TABLE_TEMPLATE_SYNID = "syn52955244" -CHALLENGE_ROLES = ['organizer', 'contributor', 'sponsor'] +CHALLENGE_ROLES = ["organizer", "contributor", "sponsor"] TASK_WIKI_ID = "624554" @@ -228,9 +228,10 @@ def create_organizer_tables(syn, project_id): logger.info(" Creating tables...") view_ids = {} schema = synapseclient.Schema( - name='Organizing Team', + name="Organizing Team", columns=syn.getColumns(TABLE_TEMPLATE_SYNID), - parent=project_id) + parent=project_id, + ) table = synapseclient.Table(schema, [[]]) # FIXME: for some reason, storing the table will then call on the @@ -241,11 +242,11 @@ def create_organizer_tables(syn, project_id): # FIXME: due to the issue above, we are not able to create the # MaterializedViews for role in CHALLENGE_ROLES: - role_title = role.title() + 's' + role_title = role.title() + "s" view = synapseclient.MaterializedViewSchema( name=role_title, parent=project_id, - definingSQL=f"SELECT * FROM {table.id} WHERE challengeRole HAS ('{role}')" + definingSQL=f"SELECT * FROM {table.id} WHERE challengeRole HAS ('{role}')", ) view = syn.store(view) view_ids[role_title] = view.id @@ -265,10 +266,7 @@ def create_data_folders(syn, project_id, tasks_count): folder_ids = {} for i in range(0, tasks_count): folder_name = f"Task {i + 1}" - folder = synapseclient.Folder( - name=folder_name, - parent=project_id - ) + folder = synapseclient.Folder(name=folder_name, parent=project_id) folder = syn.store(folder) folder_ids[i] = folder.id logger.info(f" Folder created: {folder.name} ({folder.id}) ✔") @@ -286,16 +284,16 @@ def create_annotations(syn, project_id, table_ids, folder_ids): # For annotations we do currently know, add their values. main_wiki_id = [ - wiki.get('id') + wiki.get("id") for wiki in syn.getWikiHeaders(project_id) - if not wiki.get('parentId') + if not wiki.get("parentId") ][0] - project['Overview'] = f"{project_id}/wiki/{main_wiki_id}" - project['Abstract'] = "More challenge information coming soon!" + project["Overview"] = f"{project_id}/wiki/{main_wiki_id}" + project["Abstract"] = "More challenge information coming soon!" # # for role, synid in table_ids.items(): # # annots[role] = synid for i, synid in folder_ids.items(): - project[f'Task_{i + 1}.DataFolder'] = synid + project[f"Task_{i + 1}.DataFolder"] = synid project = syn.store(project) logger.info(" Annotations creation complete ✔") return project @@ -391,16 +389,16 @@ def main(syn, challenge_name, tasks_count, live_site=None): # Create another Task tab per task. task_wikis = [ - wiki.get('title') + wiki.get("title") for wiki in syn.getWikiHeaders(CHALLENGE_TEMPLATE_SYNID) - if wiki.get('parentId') == TASK_WIKI_ID + if wiki.get("parentId") == TASK_WIKI_ID ] for i in range(1, tasks_count): new_task_tab = synapseclient.Wiki( title=f"Task {i + 1} (tab)", owner=project_staging.id, markdown="This page can be left empty - it will not appear on the portal.", - parentWikiId=syn.getWiki(project_staging.id).id + parentWikiId=syn.getWiki(project_staging.id).id, ) new_task_tab = syn.store(new_task_tab) for wiki_title in task_wikis: @@ -408,7 +406,7 @@ def main(syn, challenge_name, tasks_count, live_site=None): title=wiki_title, owner=project_staging.id, markdown="Refer to the Task 1 tab for examples", - parentWikiId=new_task_tab.id + parentWikiId=new_task_tab.id, ) syn.store(task_subwiki) diff --git a/docs/about/changelog.rst b/docs/about/changelog.rst index d557297b..20de8b3d 100644 --- a/docs/about/changelog.rst +++ b/docs/about/changelog.rst @@ -8,6 +8,12 @@ For older releases, visit the `GitHub releases`_. .. _Github releases: https://github.com/Sage-Bionetworks/challengeutils/releases +v4.3.0 +------ +- Remove support for Python 3.7 +- Add support for Python 3.11 and 3.12 +- New feature added: `create-portal-challenge` - which will create a challenge on the new [Sage Challenge Portal (staging)](https://staging.challenges.synapse.org/) + v4.2.1 ------ - Bug fix for `validate-project` diff --git a/docs/conf.py b/docs/conf.py index b4c69786..e92110fa 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,7 +25,7 @@ author = "Thomas Yu, Verena Chung, Tim Bergquist" # The short X.Y version -version = "4.2.1" +version = "4.3.0" # The full version, including alpha/beta/rc tags release = version diff --git a/setup.cfg b/setup.cfg index 922ebb95..4b8590b6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,10 +13,11 @@ platforms = any classifiers = Development Status :: 5 - Production/Stable Programming Language :: Python - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Operating System :: MacOS Operating System :: Microsoft :: Windows Operating System :: Unix @@ -41,7 +42,7 @@ install_requires = tabulate>=0.9.0 jellyfish>=0.9.0 scipy>=1.7.0 -python_requires = >3.6, <3.11 +python_requires = >3.7, <=3.12 include_package_data = True zip_safe = False scripts = diff --git a/tests/test_processor.py b/tests/test_processor.py index 5187397a..a92dc03f 100644 --- a/tests/test_processor.py +++ b/tests/test_processor.py @@ -80,9 +80,9 @@ def test_abc_class(): with pytest.raises( TypeError, match="Can't instantiate abstract class " - "EvaluationQueueProcessor with " - "abstract methods interaction_func, " - "notify", + r"EvaluationQueueProcessor with.* " + r"abstract methods '?interaction_func'?, " + r"'?notify'?", ): EvaluationQueueProcessor(SYN, EVALUATION)