Package list ctdconverter / 6e4aba7
Revert "adjust package structure, add test" This reverts commit 1b1018801cda527a2de20b7ab4bb366e6d60785f. Michael R. Crusoe 3 years ago
4 changed file(s) with 26 addition(s) and 113 deletion(s). Raw diff Collapse all Expand all
+0
-1
debian/clean less more
0 ctdconverter.egg-info/
00 From: Michael R. Crusoe <michael.crusoe@gmail.com>
11 Subject: Add setup.py
22 Forwarded: https://github.com/WorkflowConversion/CTDConverter/pull/40
3 --- ctdconverter.orig/common/utils.py
4 +++ ctdconverter/common/utils.py
5 @@ -7,7 +7,7 @@
6 from string import strip
7 from logger import info, error, warning
8
9 -from common.exceptions import ApplicationException
10 +from .exceptions import ApplicationException
11 from CTDopts.CTDopts import CTDModel, ParameterGroup
12
13
143 --- ctdconverter.orig/convert.py
154 +++ ctdconverter/convert.py
16 @@ -1,14 +1,14 @@
17 import os
18 import sys
19 import traceback
20 -import common.utils as utils
21 +import .common.utils as utils
22
23 from argparse import ArgumentParser
24 from argparse import RawDescriptionHelpFormatter
25 -from common.exceptions import ApplicationException, ModelError
26 +from . import common.exceptions as exceptions
5 @@ -8,7 +8,7 @@
6 from common.exceptions import ApplicationException, ModelError
277
288 __all__ = []
299 -__version__ = 2.0
3111 __date__ = '2014-09-17'
3212 __updated__ = '2017-08-09'
3313
34 @@ -222,13 +222,13 @@
35 print("Interrupted...")
36 return 0
37
38 - except ApplicationException, e:
39 + except exceptions.ApplicationException, e:
40 traceback.print_exc()
41 utils.error("CTDConverter could not complete the requested operation.", 0)
42 utils.error("Reason: " + e.msg, 0)
43 return 1
44
45 - except ModelError, e:
46 + except exceptions.ModelError, e:
47 traceback.print_exc()
48 utils.error("There seems to be a problem with one of your input CTDs.", 0)
49 utils.error("Reason: " + e.msg, 0)
50 @@ -250,13 +250,13 @@
51 # if input is a single file, we expect output to be a file (and not a dir that already exists)
52 if len(args.input_files) == 1:
53 if os.path.isdir(args.output_destination):
54 - raise ApplicationException("If a single input file is provided, output (%s) is expected to be a file "
55 + raise exceptions.ApplicationException("If a single input file is provided, output (%s) is expected to be a file "
56 "and not a folder.\n" % args.output_destination)
57
58 # if input is a list of files, we expect output to be a folder
59 if len(args.input_files) > 1:
60 if not os.path.isdir(args.output_destination):
61 - raise ApplicationException("If several input files are provided, output (%s) is expected to be an "
62 + raise exceptions.ApplicationException("If several input files are provided, output (%s) is expected to be an "
63 "existing directory.\n" % args.output_destination)
64
65 # check that the provided input files, if provided, contain a valid file path
6614 @@ -269,4 +269,4 @@
6715
6816
7018 - sys.exit(main())
7119 \ No newline at end of file
7220 + sys.exit(main())
73 --- ctdconverter.orig/cwl/converter.py
74 +++ ctdconverter/cwl/converter.py
75 @@ -12,7 +12,7 @@
76 import ruamel.yaml as yaml
77
78 from CTDopts.CTDopts import _InFile, _OutFile, ParameterGroup, _Choices, _NumericRange, _FileFormat, ModelError, _Null
79 -from common import utils, logger
80 +from ..common import utils, logger
81
82 # all cwl-related properties are defined here
83
84 --- ctdconverter.orig/galaxy/converter.py
85 +++ ctdconverter/galaxy/converter.py
86 @@ -8,8 +8,8 @@
87 from lxml import etree
88 from lxml.etree import SubElement, Element, ElementTree, ParseError, parse
89
90 -from common import utils, logger
91 -from common.exceptions import ApplicationException, InvalidModelException
92 +from ..common import utils, logger
93 +from ..common.exceptions import ApplicationException, InvalidModelException
94
95 from CTDopts.CTDopts import _InFile, _OutFile, ParameterGroup, _Choices, _NumericRange, _FileFormat, ModelError, _Null
96
97 --- /dev/null
98 +++ ctdconverter/__main__.py
99 @@ -0,0 +1,6 @@
100 +from __future__ import absolute_import
101 +import sys
102 +
103 +from . import convert
104 +
105 +sys.exit(convert.main())
10621 --- /dev/null
10722 +++ ctdconverter/setup.py
108 @@ -0,0 +1,167 @@
23 @@ -0,0 +1,170 @@
10924 +"""A setuptools based setup module.
11025 +
11126 +See:
16277 + # This is a one-line description or tagline of what your project does. This
16378 + # corresponds to the "Summary" metadata field:
16479 + # https://packaging.python.org/specifications/core-metadata/#summary
165 + description='Convert CTD files into Galaxy tool and CWL CommandLineTool '
166 + 'files', # Required
80 + description='Convert CTD files into Galaxy tool and CWL CommandLineTool files', # Required
16781 +
16882 + # This is an optional longer description of your project that represents
16983 + # the body of text which users will see when they visit PyPI.
17387 + #
17488 + # This field corresponds to the "Description" metadata field:
17589 + # https://packaging.python.org/specifications/core-metadata/#description-optional
176 + long_description=long_description,
90 + long_description=long_description, # Optional
17791 +
17892 + # This should be a valid link to your project's main homepage.
17993 + #
18094 + # This field corresponds to the "Home-Page" metadata field:
18195 + # https://packaging.python.org/specifications/core-metadata/#home-page-optional
182 + url='https://github.com/WorkflowConversion/CTDConverter',
96 + url='https://github.com/WorkflowConversion/CTDConverter', # Optional
18397 +
18498 + # This should be your name or the name of the organization which owns the
18599 + # project.
186 + author='The WorkflowConversion team',
100 + author='The WorkflowConversion team', # Optional
187101 +
188102 + # This should be a valid email address corresponding to the author listed
189103 + # above.
193107 + #
194108 + # For a list of valid classifiers, see
195109 + # https://pypi.python.org/pypi?%3Aaction=list_classifiers
196 + classifiers=[
110 + classifiers=[ # Optional
197111 + # How mature is this project? Common values are
198112 + # 3 - Alpha
199113 + # 4 - Beta
223137 + # Note that this is a string of words separated by whitespace, not a list.
224138 + keywords='CTD CWL CommonWL Galaxy Workflows WorkflowConversion', # Optional
225139 +
226 + packages=['ctdconverter', 'ctdconverter.common', 'ctdconverter.galaxy',
227 + 'ctdconverter.cwl'], # Required
228 + package_dir={ 'ctdconverter': '.',
229 + 'ctdconverter.common': 'common',
230 + 'ctdconverter.galaxy': 'galaxy',
231 + 'ctdconverter.cwl': 'cwl'},
140 + # You can just specify package directories manually here if your project is
141 + # simple. Or you can use find_packages().
142 + #
143 + # Alternatively, if you just want to distribute a single Python file, use
144 + # the `py_modules` argument instead as follows, which will expect a file
145 + # called `my_module.py` to exist:
146 + #
147 + py_modules=["convert"],
148 + #
149 + packages=find_packages(exclude=['contrib', 'docs', 'tests']), # Required
232150 +
233151 + # This field lists other packages that your project depends on to run.
234152 + # Any package you put here will be installed by pip when your project is
256174 + #
257175 + # If using Python 2.6 or earlier, then these have to be included in
258176 + # MANIFEST.in as well.
259 + package_data={
177 + package_data={ # Optional
260178 + 'ctdconverter': ['galaxy/macros.xml'],
261179 + },
262180 +
269187 + # executes the function `main` from this package when invoked:
270188 + entry_points={ # Optional
271189 + 'console_scripts': [
272 + 'CTDConverter=ctdconverter',
190 + 'CTDConverter=convert:main',
273191 + ],
274192 + },
275193 +)
11 Subject: Upgrade deprecated using of string.strip()
22 --- ctdconverter.orig/common/utils.py
33 +++ ctdconverter/common/utils.py
4 @@ -4,7 +4,6 @@
4 @@ -4,8 +4,7 @@
55 import os
66
77 from lxml import etree
88 -from string import strip
9 from logger import info, error, warning
9 -from logger import info, error, warning
10 +from logger import info, error, warning
1011
11 from .exceptions import ApplicationException
12 from common.exceptions import ApplicationException
13 from CTDopts.CTDopts import CTDModel, ParameterGroup
1214 @@ -73,9 +72,9 @@
1315 if member_value is not None:
1416 if isinstance(member_value, list):
2123
2224 for path_to_check in paths_to_check:
2325 validate_path_exists(path_to_check)
26
22 # DH_VERBOSE := 1
33 export LC_ALL=C.UTF-8
44 export PYBUILD_NAME = ctdconverter
5 export PYBUILD_SYSTEM = distutils
65
76 include /usr/share/dpkg/default.mk
87 # this provides:
3029
3130 override_dh_installman: debian/CTDConverter.1
3231 dh_installman
33
34 override_dh_auto_test:
35 dh_auto_install
36 PYBUILD_SYSTEM=custom PYBUILD_TEST_ARGS="export \
37 PYTHONPATH={build_dir} && {interpreter} -m \
38 ctdconverter.convert --help" dh_auto_test