diff --git a/debian/clean b/debian/clean deleted file mode 100644 index 574116c..0000000 --- a/debian/clean +++ /dev/null @@ -1 +0,0 @@ -ctdconverter.egg-info/ diff --git a/debian/patches/add_setup.py.patch b/debian/patches/add_setup.py.patch index 9a575b5..7d1636c 100644 --- a/debian/patches/add_setup.py.patch +++ b/debian/patches/add_setup.py.patch @@ -1,30 +1,10 @@ From: Michael R. Crusoe Subject: Add setup.py Forwarded: https://github.com/WorkflowConversion/CTDConverter/pull/40 ---- ctdconverter.orig/common/utils.py -+++ ctdconverter/common/utils.py -@@ -7,7 +7,7 @@ - from string import strip - from logger import info, error, warning - --from common.exceptions import ApplicationException -+from .exceptions import ApplicationException - from CTDopts.CTDopts import CTDModel, ParameterGroup - - --- ctdconverter.orig/convert.py +++ ctdconverter/convert.py -@@ -1,14 +1,14 @@ - import os - import sys - import traceback --import common.utils as utils -+import .common.utils as utils - - from argparse import ArgumentParser - from argparse import RawDescriptionHelpFormatter --from common.exceptions import ApplicationException, ModelError -+from . import common.exceptions as exceptions +@@ -8,7 +8,7 @@ + from common.exceptions import ApplicationException, ModelError __all__ = [] -__version__ = 2.0 @@ -32,38 +12,6 @@ __date__ = '2014-09-17' __updated__ = '2017-08-09' -@@ -222,13 +222,13 @@ - print("Interrupted...") - return 0 - -- except ApplicationException, e: -+ except exceptions.ApplicationException, e: - traceback.print_exc() - utils.error("CTDConverter could not complete the requested operation.", 0) - utils.error("Reason: " + e.msg, 0) - return 1 - -- except ModelError, e: -+ except exceptions.ModelError, e: - traceback.print_exc() - utils.error("There seems to be a problem with one of your input CTDs.", 0) - utils.error("Reason: " + e.msg, 0) -@@ -250,13 +250,13 @@ - # if input is a single file, we expect output to be a file (and not a dir that already exists) - if len(args.input_files) == 1: - if os.path.isdir(args.output_destination): -- raise ApplicationException("If a single input file is provided, output (%s) is expected to be a file " -+ raise exceptions.ApplicationException("If a single input file is provided, output (%s) is expected to be a file " - "and not a folder.\n" % args.output_destination) - - # if input is a list of files, we expect output to be a folder - if len(args.input_files) > 1: - if not os.path.isdir(args.output_destination): -- raise ApplicationException("If several input files are provided, output (%s) is expected to be an " -+ raise exceptions.ApplicationException("If several input files are provided, output (%s) is expected to be an " - "existing directory.\n" % args.output_destination) - - # check that the provided input files, if provided, contain a valid file path @@ -269,4 +269,4 @@ @@ -71,42 +19,9 @@ - sys.exit(main()) \ No newline at end of file + sys.exit(main()) ---- ctdconverter.orig/cwl/converter.py -+++ ctdconverter/cwl/converter.py -@@ -12,7 +12,7 @@ - import ruamel.yaml as yaml - - from CTDopts.CTDopts import _InFile, _OutFile, ParameterGroup, _Choices, _NumericRange, _FileFormat, ModelError, _Null --from common import utils, logger -+from ..common import utils, logger - - # all cwl-related properties are defined here - ---- ctdconverter.orig/galaxy/converter.py -+++ ctdconverter/galaxy/converter.py -@@ -8,8 +8,8 @@ - from lxml import etree - from lxml.etree import SubElement, Element, ElementTree, ParseError, parse - --from common import utils, logger --from common.exceptions import ApplicationException, InvalidModelException -+from ..common import utils, logger -+from ..common.exceptions import ApplicationException, InvalidModelException - - from CTDopts.CTDopts import _InFile, _OutFile, ParameterGroup, _Choices, _NumericRange, _FileFormat, ModelError, _Null - ---- /dev/null -+++ ctdconverter/__main__.py -@@ -0,0 +1,6 @@ -+from __future__ import absolute_import -+import sys -+ -+from . import convert -+ -+sys.exit(convert.main()) --- /dev/null +++ ctdconverter/setup.py -@@ -0,0 +1,167 @@ +@@ -0,0 +1,170 @@ +"""A setuptools based setup module. + +See: @@ -163,8 +78,7 @@ + # This is a one-line description or tagline of what your project does. This + # corresponds to the "Summary" metadata field: + # https://packaging.python.org/specifications/core-metadata/#summary -+ description='Convert CTD files into Galaxy tool and CWL CommandLineTool ' -+ 'files', # Required ++ description='Convert CTD files into Galaxy tool and CWL CommandLineTool files', # Required + + # This is an optional longer description of your project that represents + # the body of text which users will see when they visit PyPI. @@ -174,17 +88,17 @@ + # + # This field corresponds to the "Description" metadata field: + # https://packaging.python.org/specifications/core-metadata/#description-optional -+ long_description=long_description, ++ long_description=long_description, # Optional + + # This should be a valid link to your project's main homepage. + # + # This field corresponds to the "Home-Page" metadata field: + # https://packaging.python.org/specifications/core-metadata/#home-page-optional -+ url='https://github.com/WorkflowConversion/CTDConverter', ++ url='https://github.com/WorkflowConversion/CTDConverter', # Optional + + # This should be your name or the name of the organization which owns the + # project. -+ author='The WorkflowConversion team', ++ author='The WorkflowConversion team', # Optional + + # This should be a valid email address corresponding to the author listed + # above. @@ -194,7 +108,7 @@ + # + # For a list of valid classifiers, see + # https://pypi.python.org/pypi?%3Aaction=list_classifiers -+ classifiers=[ ++ classifiers=[ # Optional + # How mature is this project? Common values are + # 3 - Alpha + # 4 - Beta @@ -224,12 +138,16 @@ + # Note that this is a string of words separated by whitespace, not a list. + keywords='CTD CWL CommonWL Galaxy Workflows WorkflowConversion', # Optional + -+ packages=['ctdconverter', 'ctdconverter.common', 'ctdconverter.galaxy', -+ 'ctdconverter.cwl'], # Required -+ package_dir={ 'ctdconverter': '.', -+ 'ctdconverter.common': 'common', -+ 'ctdconverter.galaxy': 'galaxy', -+ 'ctdconverter.cwl': 'cwl'}, ++ # You can just specify package directories manually here if your project is ++ # simple. Or you can use find_packages(). ++ # ++ # Alternatively, if you just want to distribute a single Python file, use ++ # the `py_modules` argument instead as follows, which will expect a file ++ # called `my_module.py` to exist: ++ # ++ py_modules=["convert"], ++ # ++ packages=find_packages(exclude=['contrib', 'docs', 'tests']), # Required + + # This field lists other packages that your project depends on to run. + # Any package you put here will be installed by pip when your project is @@ -257,7 +175,7 @@ + # + # If using Python 2.6 or earlier, then these have to be included in + # MANIFEST.in as well. -+ package_data={ ++ package_data={ # Optional + 'ctdconverter': ['galaxy/macros.xml'], + }, + @@ -270,7 +188,7 @@ + # executes the function `main` from this package when invoked: + entry_points={ # Optional + 'console_scripts': [ -+ 'CTDConverter=ctdconverter', ++ 'CTDConverter=convert:main', + ], + }, +) diff --git a/debian/patches/upgrade_deprecated_strip b/debian/patches/upgrade_deprecated_strip index 4caf8dd..d39b370 100644 --- a/debian/patches/upgrade_deprecated_strip +++ b/debian/patches/upgrade_deprecated_strip @@ -2,14 +2,16 @@ Subject: Upgrade deprecated using of string.strip() --- ctdconverter.orig/common/utils.py +++ ctdconverter/common/utils.py -@@ -4,7 +4,6 @@ +@@ -4,8 +4,7 @@ import os from lxml import etree -from string import strip - from logger import info, error, warning +-from logger import info, error, warning ++from logger import info, error, warning - from .exceptions import ApplicationException + from common.exceptions import ApplicationException + from CTDopts.CTDopts import CTDModel, ParameterGroup @@ -73,9 +72,9 @@ if member_value is not None: if isinstance(member_value, list): @@ -22,3 +24,4 @@ for path_to_check in paths_to_check: validate_path_exists(path_to_check) + diff --git a/debian/rules b/debian/rules index 993d904..1d00b1a 100755 --- a/debian/rules +++ b/debian/rules @@ -3,7 +3,6 @@ # DH_VERBOSE := 1 export LC_ALL=C.UTF-8 export PYBUILD_NAME = ctdconverter -export PYBUILD_SYSTEM = distutils include /usr/share/dpkg/default.mk # this provides: @@ -31,9 +30,3 @@ override_dh_installman: debian/CTDConverter.1 dh_installman - -override_dh_auto_test: - dh_auto_install - PYBUILD_SYSTEM=custom PYBUILD_TEST_ARGS="export \ - PYTHONPATH={build_dir} && {interpreter} -m \ - ctdconverter.convert --help" dh_auto_test