[med-svn] [Git][med-team/ctdopts][master] 5 commits: New upstream version 1.4
Andreas Tille
gitlab at salsa.debian.org
Thu Oct 1 12:47:09 BST 2020
Andreas Tille pushed to branch master at Debian Med / ctdopts
Commits:
c2c11f89 by Andreas Tille at 2020-10-01T13:44:57+02:00
New upstream version 1.4
- - - - -
ac79c9bf by Andreas Tille at 2020-10-01T13:44:57+02:00
routine-update: New upstream version
- - - - -
a6133424 by Andreas Tille at 2020-10-01T13:44:58+02:00
Update upstream source from tag 'upstream/1.4'
Update to upstream version '1.4'
with Debian dir 57a68166da6a3b0da40c4a0a33e6640df1ebbe94
- - - - -
76dbbafe by Andreas Tille at 2020-10-01T13:44:58+02:00
routine-update: debhelper-compat 13
- - - - -
384ec397 by Andreas Tille at 2020-10-01T13:45:59+02:00
routine-update: Ready to upload to unstable
- - - - -
6 changed files:
- CTDopts/CTDopts.py
- debian/changelog
- debian/control
- dist/conda/meta.yaml
- example.py
- setup.py
Changes:
=====================================
CTDopts/CTDopts.py
=====================================
@@ -1,6 +1,7 @@
import argparse
-from collections import OrderedDict, Mapping
from itertools import chain
+import collections
+import collections.abc
from xml.etree.ElementTree import Element, SubElement, tostring, parse
from xml.dom.minidom import parseString
import warnings
@@ -46,12 +47,27 @@ class _OutFile(str):
pass
+class _OutPrefix(str):
+ """Same thing, a dummy class for output-prefix CTD type."""
+ pass
+
+
+class _InPrefix(str):
+ """Same thing, a dummy class for output-prefix CTD type."""
+ pass
+
+
# module globals for some common operations (python types to CTD-types back and forth)
TYPE_TO_CTDTYPE = {int: 'int', float: 'double', str: 'string', bool: 'bool',
- _InFile: 'input-file', _OutFile: 'output-file'}
-CTDTYPE_TO_TYPE = {'int': int, 'float': float, 'double': float, 'string': str, 'boolean': bool, 'bool': bool,
- 'input-file': _InFile, 'output-file': _OutFile, int: int, float: float, str: str,
- bool: bool, _InFile: _InFile, _OutFile: _OutFile}
+ _InFile: 'input-file', _OutFile: 'output-file',
+ _OutPrefix: 'output-prefix', _InPrefix: 'input-prefix'}
+CTDTYPE_TO_TYPE = {'int': int, 'float': float, 'double': float, 'string': str,
+ 'boolean': bool, 'bool': bool,
+ 'input-file': _InFile, 'output-file': _OutFile,
+ 'output-prefix': _OutPrefix, 'input-prefix': _InPrefix,
+ int: int, float: float, str: str,
+ bool: bool, _InFile: _InFile, _OutFile: _OutFile,
+ _OutPrefix: _OutPrefix, _InPrefix: _InPrefix}
PARAM_DEFAULTS = {'advanced': False, 'required': False, 'restrictions': None, 'description': None,
'supported_formats': None, 'tags': None, 'position': None} # unused. TODO.
@@ -115,7 +131,7 @@ def flatten_dict(arg_dict, as_string=False):
# recursive closure that accesses and modifies result dict and registers nested elements
# as it encounters them
for key, value in subgroup.items():
- if isinstance(value, Mapping): # collections.Mapping instead of dict for generality
+ if isinstance(value, collections.abc.Mapping): # collections.Mapping instead of dict for generality
flattener(value, level + [key])
else:
result[tuple(level + [key])] = value
@@ -550,7 +566,7 @@ class Parameter(object):
# XML attributes to be created (depending on whether they are needed or not):
# name, value, type, description, tags, restrictions, supported_formats
- attribs = OrderedDict() # LXML keeps the order, ElemenTree doesn't. We use ElementTree though.
+ attribs = collections.OrderedDict() # LXML keeps the order, ElemenTree doesn't. We use ElementTree though.
attribs['name'] = self.name
if not self.is_list: # we'll deal with list parameters later, now only normal:
# TODO: once Param_1_6_3.xsd gets fixed, we won't have to set an empty value='' attrib.
@@ -597,7 +613,7 @@ class Parameter(object):
class ParameterGroup(object):
def __init__(self, name=None, parent=None, node=None, description=None):
- self.parameters = OrderedDict()
+ self.parameters = collections.OrderedDict()
self.name = name
self.parent = parent
self.description = description
@@ -1091,7 +1107,7 @@ class CTDModel(object):
'error': standard error or whatever error log the user wants to store
`cli`: boolean whether or not cli elements should be generated (needed for GenericKNIMENode for example)
"""
- tool_attribs = OrderedDict()
+ tool_attribs = collections.OrderedDict()
tool_attribs['version'] = self.version
tool_attribs['name'] = self.name
tool_attribs['xmlns:xsi'] = "http://www.w3.org/2001/XMLSchema-instance"
=====================================
debian/changelog
=====================================
@@ -1,4 +1,11 @@
-ctdopts (1.3-1) unstable; urgency=medium
+ctdopts (1.4-1.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * debhelper-compat 13 (routine-update)
+
+ -- Andreas Tille <tille at debian.org> Thu, 01 Oct 2020 13:45:03 +0200
+
+ctdopts (1.4-1) unstable; urgency=medium
[ Jelmer Vernooij ]
* Remove unnecessary X-Python{,3}-Version field in debian/control.
=====================================
debian/control
=====================================
@@ -3,7 +3,7 @@ Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.
Uploaders: Michael R. Crusoe <crusoe at debian.org>
Section: python
Priority: optional
-Build-Depends: debhelper-compat (= 12),
+Build-Depends: debhelper-compat (= 13),
dh-python,
python3,
python3-setuptools,
=====================================
dist/conda/meta.yaml
=====================================
@@ -1,13 +1,13 @@
package:
name: ctdopts
- version: "1.2"
+ version: "1.4"
source:
- git_rev: v1.2
+ git_rev: v1.4
git_url: https://github.com/WorkflowConversion/CTDopts.git
build:
- noarch_python: True
+ noarch: python
requirements:
build:
=====================================
example.py
=====================================
@@ -45,6 +45,15 @@ model.add(
description='A list of filenames to feed this dummy tool with'
)
+model.add(
+ 'output',
+ required=True,
+ type='output-prefix', # or 'input-prefix'
+ is_list=False,
+ file_formats=['fastq', 'fastq.gz'], # filename restrictions
+ description='Output directory'
+)
+
model.add(
'this_that',
type=str,
@@ -194,7 +203,7 @@ print("So how to deal with command line arguments? If we have a model, we can lo
"Call CTDModel.parse_cl_args() with either a string of the command line call or a list with the split words. "
"By default, it will assume a '--' prefix before parameter names, but it can be overridden with prefix='-'."
"Grouped parameters are expected in --group:subgroup:param_x format.")
-cl_args = model.parse_cl_args('--positive_int 44 --subparams:param_2 5.0 5.5 6.0 --input_files a.fastq b.fastq')
+cl_args = model.parse_cl_args('--positive_int 44 --subparams:param_2 5.0 5.5 6.0 --input_files a.fastq b.fastq --output out_dir/')
pretty_print(cl_args)
print()
# # you can get unmatchable command line arguments with get_remaining=True like:
=====================================
setup.py
=====================================
@@ -2,7 +2,7 @@ from distutils.core import setup
setup(
name='CTDopts',
- version='1.3',
+ version='1.4',
packages=['CTDopts'],
url='https://github.com/genericworkflownodes/CTDopts',
license='',
View it on GitLab: https://salsa.debian.org/med-team/ctdopts/-/compare/337aa459173fa0450d67a45eb38615e59987b026...384ec397edb2ee611b1b7ac4b4bbaedcd609a475
--
View it on GitLab: https://salsa.debian.org/med-team/ctdopts/-/compare/337aa459173fa0450d67a45eb38615e59987b026...384ec397edb2ee611b1b7ac4b4bbaedcd609a475
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20201001/9af4302f/attachment-0001.html>
More information about the debian-med-commit
mailing list