Skip to content

Commit

Permalink
upgrade dependencies, reformat with black v24.3 (#1930)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Apr 8, 2024
1 parent 20e26d9 commit 999c35e
Show file tree
Hide file tree
Showing 27 changed files with 308 additions and 229 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/release_cleanup.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ TBA
- [ ] Review code style and cleanup
- [ ] Review and update docs entries
- [ ] Update `SODAR_API_DEFAULT_VERSION` and `SODAR_API_ALLOWED_VERSIONS`
- [ ] Run `npx update-browserslist-db@latest` for Vue app
- [ ] Update Vue app version with `npm version`
- [ ] Update version in CHANGELOG and SODAR Release Notes doc
- [ ] Update version in docs conf.py
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ Changelog for the SODAR project. Loosely follows the
`Keep a Changelog <http://keepachangelog.com/en/1.0.0/>`_ guidelines.


Unreleased
==========

Changed
-------

- **General**
- Upgrade critical Vue app dependencies (#1930)
- Upgrade to black v24.3.0 (#1930)
- Reformat with black (#1930)


v0.14.2 (2024-03-15)
====================

Expand Down
12 changes: 6 additions & 6 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,9 @@
AUTH_LDAP_CA_CERT_FILE = env.str('AUTH_LDAP_CA_CERT_FILE', None)
AUTH_LDAP_CONNECTION_OPTIONS = {**LDAP_DEFAULT_CONN_OPTIONS}
if AUTH_LDAP_CA_CERT_FILE:
AUTH_LDAP_CONNECTION_OPTIONS[
ldap.OPT_X_TLS_CACERTFILE
] = AUTH_LDAP_CA_CERT_FILE
AUTH_LDAP_CONNECTION_OPTIONS[ldap.OPT_X_TLS_CACERTFILE] = (
AUTH_LDAP_CA_CERT_FILE
)
AUTH_LDAP_CONNECTION_OPTIONS[ldap.OPT_X_TLS_NEWCTX] = 0
AUTH_LDAP_USER_FILTER = env.str(
'AUTH_LDAP_USER_FILTER', '(sAMAccountName=%(user)s)'
Expand Down Expand Up @@ -408,9 +408,9 @@
AUTH_LDAP2_CA_CERT_FILE = env.str('AUTH_LDAP2_CA_CERT_FILE', None)
AUTH_LDAP2_CONNECTION_OPTIONS = {**LDAP_DEFAULT_CONN_OPTIONS}
if AUTH_LDAP2_CA_CERT_FILE:
AUTH_LDAP2_CONNECTION_OPTIONS[
ldap.OPT_X_TLS_CACERTFILE
] = AUTH_LDAP2_CA_CERT_FILE
AUTH_LDAP2_CONNECTION_OPTIONS[ldap.OPT_X_TLS_CACERTFILE] = (
AUTH_LDAP2_CA_CERT_FILE
)
AUTH_LDAP2_CONNECTION_OPTIONS[ldap.OPT_X_TLS_NEWCTX] = 0
AUTH_LDAP2_USER_FILTER = env.str(
'AUTH_LDAP2_USER_FILTER', '(sAMAccountName=%(user)s)'
Expand Down
1 change: 1 addition & 0 deletions config/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
framework.
"""

import os
import sys

Expand Down
2 changes: 1 addition & 1 deletion docs_manual/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
author = 'BIH Core Unit Bioinformatics'

# The full version, including alpha/beta/rc tags
release = '0.14.2'
release = '0.14.3-WIP'


# -- General configuration ---------------------------------------------------
Expand Down
10 changes: 10 additions & 0 deletions docs_manual/source/sodar_release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ list of changes in current and previous releases, see the
:ref:`full changelog<sodar_changelog>`.


v0.14.3 (WIP)
=============

Release for minor updates, maintenance and bug fixes.

- Add Cyberduck documentation
- Upgrade critical dependencies
- Minor updates and bug fixes


v0.14.2 (2024-03-15)
====================

Expand Down
12 changes: 6 additions & 6 deletions irodsbackend/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def _init_irods(self):
# Set up additional iRODS environment variables
irods_env = dict(settings.IRODS_ENV_DEFAULT)
if settings.IRODS_CERT_PATH:
irods_env[
'irods_ssl_ca_certificate_file'
] = settings.IRODS_CERT_PATH
irods_env['irods_ssl_ca_certificate_file'] = (
settings.IRODS_CERT_PATH
)
irods_env.update(dict(settings.IRODS_ENV_BACKEND))
# HACK: Clean up environment to avoid python-irodsclient crash
irods_env = self.format_env(irods_env)
Expand Down Expand Up @@ -304,9 +304,9 @@ def get_path(cls, obj):
user=obj.user.username,
study_assay=cls.get_sub_path(obj.assay, landing_zone=True),
zone_title=obj.title,
zone_config='_' + obj.configuration
if obj.configuration
else '',
zone_config=(
'_' + obj.configuration if obj.configuration else ''
),
)
)
return path
Expand Down
6 changes: 3 additions & 3 deletions landingzones/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def __init__(
self.fields['assay'].to_field_name = 'sodar_uuid'
# Set suffix
self.fields['title_suffix'].label = 'Title suffix'
self.fields[
'title_suffix'
].help_text = 'Zone title suffix (optional, maximum 64 characters)'
self.fields['title_suffix'].help_text = (
'Zone title suffix (optional, maximum 64 characters)'
)
self.fields['description'].widget.attrs['rows'] = 4

# Get options for configuration
Expand Down
6 changes: 3 additions & 3 deletions ontologyaccess/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ def import_obo(cls, obo_doc, name, file, title=None, term_url=None):
isinstance(h, fh.PropertyValueClause)
and str(h.property_value.relation) in OBO_PROPERTY_MAP
):
o_kwargs[
OBO_PROPERTY_MAP[str(h.property_value.relation)]
] = h.property_value.value
o_kwargs[OBO_PROPERTY_MAP[str(h.property_value.relation)]] = (
h.property_value.value
)

if title: # If manually enforcing a title, set here
o_kwargs['title'] = title
Expand Down
3 changes: 1 addition & 2 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ selenium==4.8.2
beautifulsoup4==4.11.2

# Black for formatting
black==23.1.0
black==24.3.0

# Coveralls for coverage reporting
coveralls==3.3.1

6 changes: 3 additions & 3 deletions samplesheets/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ def __init__(
field_kwargs = {'label': label}
# Set field and initial value
if k == TPL_DIR_FIELD:
field_kwargs[
'help_text'
] = 'Investigation directory and assay prefix'
field_kwargs['help_text'] = (
'Investigation directory and assay prefix'
)
self.fields[k] = forms.CharField(**field_kwargs)
self.initial[k] = clean_sheet_dir_name(project.title)
elif isinstance(v, str):
Expand Down
86 changes: 53 additions & 33 deletions samplesheets/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,11 @@ def _import_ontology_vals(cls, vals):
ret = {}
for v in vals:
ret[v.name] = {
'unit': cls._import_multi_val(v.unit)
if hasattr(v, 'unit')
else None,
'unit': (
cls._import_multi_val(v.unit)
if hasattr(v, 'unit')
else None
),
'value': cls._import_multi_val(v.value),
}
return ret
Expand Down Expand Up @@ -465,12 +467,16 @@ def _import_processes(
'performer': p.performer,
'perform_date': p.date if p.date else None,
'array_design_ref': p.array_design_ref,
'first_dimension': cls._import_multi_val(p.first_dimension)
if p.first_dimension
else {},
'second_dimension': cls._import_multi_val(p.second_dimension)
if p.second_dimension
else {},
'first_dimension': (
cls._import_multi_val(p.first_dimension)
if p.first_dimension
else {}
),
'second_dimension': (
cls._import_multi_val(p.second_dimension)
if p.second_dimension
else {}
),
'headers': p.headers,
'comments': cls._import_comments(p.comments),
}
Expand Down Expand Up @@ -827,9 +833,11 @@ def import_isa(
tags.append('REPLACE')
self.save_isa(
project=project,
inv_uuid=replace_uuid
if replace and replace_uuid
else db_investigation.sodar_uuid,
inv_uuid=(
replace_uuid
if replace and replace_uuid
else db_investigation.sodar_uuid
),
isa_data=isa_data,
tags=tags,
user=user,
Expand Down Expand Up @@ -1021,9 +1029,11 @@ def _export_characteristics(cls, characteristics):
return tuple(
isa_models.Characteristics(
name=k,
value=[cls._export_val(v['value'])]
if not isinstance(v['value'], list)
else cls._export_val(v['value']),
value=(
[cls._export_val(v['value'])]
if not isinstance(v['value'], list)
else cls._export_val(v['value'])
),
unit=cls._export_val(v['unit']),
)
for k, v in characteristics.items()
Expand Down Expand Up @@ -1088,9 +1098,11 @@ def _export_param_values(cls, param_values):
return tuple(
isa_models.ParameterValue(
name=k,
value=[cls._export_val(v['value'])]
if not isinstance(v['value'], list)
else cls._export_val(v['value']),
value=(
[cls._export_val(v['value'])]
if not isinstance(v['value'], list)
else cls._export_val(v['value'])
),
unit=cls._export_val(v['unit']),
)
for k, v in param_values.items()
Expand Down Expand Up @@ -1133,21 +1145,29 @@ def _export_materials(cls, materials, study_data=True):
else:
extract_label = cls._export_val(m.extract_label)
ret[m.unique_name] = isa_models.Material(
type=m.material_type
if m.material_type
else MATERIAL_TYPE_EXPORT_MAP[m.item_type],
type=(
m.material_type
if m.material_type
else MATERIAL_TYPE_EXPORT_MAP[m.item_type]
),
unique_name=m.unique_name,
name=m.name,
extract_label=extract_label,
characteristics=cls._export_characteristics(m.characteristics)
if not sample_in_assay
else (),
comments=cls._export_comments(m.comments)
if not sample_in_assay
else (),
factor_values=cls._export_factor_vals(m.factor_values)
if study_data
else tuple(),
characteristics=(
cls._export_characteristics(m.characteristics)
if not sample_in_assay
else ()
),
comments=(
cls._export_comments(m.comments)
if not sample_in_assay
else ()
),
factor_values=(
cls._export_factor_vals(m.factor_values)
if study_data
else tuple()
),
material_type=cls._export_val(m.extra_material_type),
headers=headers,
)
Expand All @@ -1169,9 +1189,9 @@ def _export_processes(cls, processes):
else:
perform_date = p.perform_date
ret[p.unique_name] = isa_models.Process(
protocol_ref=p.protocol.name
if p.protocol
else PROTOCOL_UNKNOWN_NAME,
protocol_ref=(
p.protocol.name if p.protocol else PROTOCOL_UNKNOWN_NAME
),
unique_name=p.unique_name,
name=p.name,
name_type=p.name_type,
Expand Down
52 changes: 28 additions & 24 deletions samplesheets/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,11 @@ def get_object_link(self, model_str, uuid):
if obj.__class__ in [Investigation, Study, Assay]:
return {
'url': obj.get_url(),
'label': obj.title
if obj.__class__ == Investigation
else obj.get_display_name(),
'label': (
obj.title
if obj.__class__ == Investigation
else obj.get_display_name()
),
}
url_kwargs = {'project': obj.project.sodar_uuid}
if obj.__class__ == ISATab:
Expand Down Expand Up @@ -564,9 +566,9 @@ def validate_form_app_settings(self, app_settings, project=None, user=None):
if 'sheet_sync_url' not in ret and not re.findall(
SYNC_URL_RE, app_settings['sheet_sync_url']
):
ret[
'sheet_sync_url'
] = 'URL does not point to a sheet sync endpoint'
ret['sheet_sync_url'] = (
'URL does not point to a sheet sync endpoint'
)
return ret

# Project Modify API Implementation ----------------------------------------
Expand Down Expand Up @@ -770,9 +772,9 @@ def update_cache(self, name=None, project=None, user=None):
if assay_plugin:
plugin_shortcuts = assay_plugin.get_shortcuts(assay) or []
for sc in plugin_shortcuts:
cache_data['shortcuts'][
sc['id']
] = irods.collections.exists(sc['path'])
cache_data['shortcuts'][sc['id']] = (
irods.collections.exists(sc['path'])
)
cache_data['shortcuts']['track_hubs'] = [
c.path
for c in irods_backend.get_child_colls(
Expand Down Expand Up @@ -1037,9 +1039,9 @@ def _update_cache_rows(self, app_name, name=None, project=None, user=None):
with irods_backend.get_session() as irods:
for path in row_paths:
try:
cache_data['paths'][
path
] = irods_backend.get_object_stats(irods, path)
cache_data['paths'][path] = (
irods_backend.get_object_stats(irods, path)
)
except FileNotFoundError:
cache_data['paths'][path] = None
cache_backend.set_cache_item(
Expand Down Expand Up @@ -1183,18 +1185,20 @@ def get_irods_content(inv, study, irods_backend, ret_data):
'title': 'Track Hub',
'assay_plugin': False,
'path': track_hub,
'extra_links': [
{
'url': ticket.get_webdav_link(),
'icon': 'mdi:ticket',
'id': 'ticket_access_%d' % i,
'class': 'sodar-irods-ticket-access-%d-btn' % i,
'title': ' iRODS Access Ticket',
'enabled': ticket.is_active(),
}
]
if ticket
else [],
'extra_links': (
[
{
'url': ticket.get_webdav_link(),
'icon': 'mdi:ticket',
'id': 'ticket_access_%d' % i,
'class': 'sodar-irods-ticket-access-%d-btn' % i,
'title': ' iRODS Access Ticket',
'enabled': ticket.is_active(),
}
]
if ticket
else []
),
}
)
for i in range(len(a_data['shortcuts'])):
Expand Down

0 comments on commit 999c35e

Please sign in to comment.