Skip to content

Commit

Permalink
Release v4.3.0 (#253)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
vpchung committed Nov 30, 2023
1 parent ecdf702 commit 12645f2
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 38 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sphinx-ghpages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
9 changes: 4 additions & 5 deletions challengeutils/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion challengeutils/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "4.2.1"
__version__ = "4.3.0"
34 changes: 16 additions & 18 deletions challengeutils/create_portal_challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}) ✔")
Expand All @@ -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
Expand Down Expand Up @@ -391,24 +389,24 @@ 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:
task_subwiki = synapseclient.Wiki(
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)

Expand Down
6 changes: 6 additions & 0 deletions docs/about/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 =
Expand Down
6 changes: 3 additions & 3 deletions tests/test_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 12645f2

Please sign in to comment.