Skip to content

Commit

Permalink
update isa template dependency (#1667)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed May 11, 2023
1 parent 78997eb commit 82f2748
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 12 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ Changelog for the SODAR project. Loosely follows the
Unreleased
==========

Changed
-------

- **Samplesheets**
- Update ISA-Tab template dependency to ``cubi-isa-templates`` (#1667)

Fixed
-----

- **General**
- Docker build crash from ``django-autocomplete-light==3.9.5`` and ``whitenoise`` (#1666)
- ``django-autocomplete-light`` Docker build crash with ``whitenoise`` (#1666)


v0.13.3 (2023-05-10)
Expand Down
5 changes: 3 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ django-webpack-loader==1.6.0
fastobo==0.12.2
pronto==2.5.0 # For OWL conversion

# CUBI-TK for sheet templates
-e git+https://github.com/bihealth/cubi-tk.git@0c0250cdfd546eaac1e0364df62213ad3c97ef7c#egg=cubi-tk
# CUBI ISA-Tab templates
cookiecutter==2.1.1
-e git+https://github.com/bihealth/cubi-isa-templates.git@f71cde73648d37734414b971db13821e4d6969ff#egg=cubi-isa-templates

# Taskflow requirements
tooz==3.0.0
Expand Down
1 change: 1 addition & 0 deletions samplesheets/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# Hide template fields listed here from the template UI (see issue #1443)
HIDDEN_SHEET_TEMPLATE_FIELDS = [
'__output_dir',
'a_measurement_types',
'a_technology_types',
'assay_technology_types',
Expand Down
4 changes: 2 additions & 2 deletions samplesheets/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,13 @@ def clean(self):

def save(self):
extra_context = {
k: v for k, v in self.cleaned_data.items() if k != 'i_dir_name'
k: v for k, v in self.cleaned_data.items() if k != '__output_dir'
}
for k in self.json_fields:
if not isinstance(extra_context[k], dict):
extra_context[k] = json.loads(extra_context[k])
tpl_dir_name = self.cleaned_data['i_dir_name']
extra_context['i_dir_name'] = tpl_dir_name
extra_context['__output_dir'] = tpl_dir_name
if 'is_triplet' in self.sheet_tpl.configuration:
extra_context['is_triplet'] = self.sheet_tpl.configuration[
'is_triplet'
Expand Down
4 changes: 2 additions & 2 deletions samplesheets/tests/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import json

from cubi_tk.isa_tpl import _TEMPLATES as TK_TEMPLATES
from cubi_isa_templates import _TEMPLATES as ISA_TEMPLATES

from django.urls import reverse
from django.utils.http import urlencode
Expand Down Expand Up @@ -264,7 +264,7 @@ class TestSheetTemplateCreateFormView(TestProjectSheetsVueAppBase):

def test_render_hidden_fields(self):
"""Test rendering hidden fields in the sheet template form"""
for t in TK_TEMPLATES:
for t in ISA_TEMPLATES:
url = (
reverse(
'samplesheets:template_create',
Expand Down
4 changes: 2 additions & 2 deletions samplesheets/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import json
import os

from cubi_tk.isa_tpl import _TEMPLATES as TK_TEMPLATES
from cubi_isa_templates import _TEMPLATES as ISA_TEMPLATES
from urllib.parse import urlencode
from zipfile import ZipFile

Expand Down Expand Up @@ -753,7 +753,7 @@ def test_post_batch(self):
"""Test POST request with supported templates and default values"""
templates = {
t.name: t
for t in TK_TEMPLATES
for t in ISA_TEMPLATES
if t.name in settings.SHEETS_ENABLED_TEMPLATES
}

Expand Down
6 changes: 3 additions & 3 deletions samplesheets/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import requests
import zipfile

from cubi_tk.isa_tpl import _TEMPLATES as TK_TEMPLATES
from cubi_isa_templates import _TEMPLATES as ISA_TEMPLATES
from irods.exception import CollectionDoesNotExist
from packaging import version

Expand Down Expand Up @@ -1155,7 +1155,7 @@ def get_context_data(self, **kwargs):
# HACK: Skip non-working templates in cubi-tk
for t in [
t
for t in TK_TEMPLATES
for t in ISA_TEMPLATES
if t.name in settings.SHEETS_ENABLED_TEMPLATES
]:
templates.append(
Expand Down Expand Up @@ -1204,7 +1204,7 @@ class SheetTemplateCreateView(

def _get_sheet_template(self):
t_name = self.request.GET.get('sheet_tpl')
return {t.name: t for t in TK_TEMPLATES}[t_name]
return {t.name: t for t in ISA_TEMPLATES}[t_name]

def get_context_data(self, *args, **kwargs):
context = super().get_context_data(*args, **kwargs)
Expand Down

0 comments on commit 82f2748

Please sign in to comment.