-
- Downloads
Fix incorrect installation of CWL files
Many CWL files were being installed in the wrong directory. This has been fixed. This commit fixes RAP-249.
parent
ad901939
No related branches found
No related tags found
from setuptools import setup | from setuptools import setup | ||
import os | import os | ||
import pathlib | |||
def read(rel_path): | def read(rel_path): | ||
... | @@ -12,6 +11,13 @@ def read(rel_path): | ... | @@ -12,6 +11,13 @@ def read(rel_path): |
return fp.read() | return fp.read() | ||
data_files = [] | |||
for top in ('lofar-cwl/steps', 'steps', 'subworkflow', 'workflows'): | |||
for root, _, files in os.walk(top): | |||
cwl_files = [os.path.join(root, f) for f in files if f.endswith('.cwl')] | |||
if cwl_files: | |||
data_files.append((os.path.join('share/prefactor', root), cwl_files)) | |||
|
|||
setup( | setup( | ||
name='prefactor3-cwl', | name='prefactor3-cwl', | ||
version='0.3.0', | version='0.3.0', | ||
... | @@ -28,7 +34,5 @@ setup( | ... | @@ -28,7 +34,5 @@ setup( |
install_requires=[ | install_requires=[ | ||
'prefactor@git+https://github.com/lofar-astron/prefactor.git' | 'prefactor@git+https://github.com/lofar-astron/prefactor.git' | ||
], | ], | ||
data_files=[(os.path.join('share', 'prefactor', dir), | data_files=data_files | ||
[str(p) for p in pathlib.Path(dir).glob('**/*.cwl')]) for dir in | |||
('lofar-cwl', 'steps', 'subworkflow', 'workflows')] | |||
) | ) |
-
BTW: I do have a different implementation for lines 14-19 that doesn't use
os.walk
, butglob.glob
instead. It's a bit slower, but maybe you consider it more readable:cwl_files = collections.defaultdict(list) for dir in ('lofar-cwl', 'steps', 'subworkflow', 'workflows'): for file in glob.glob(os.path.join(dir, '**/*.cwl'), recursive=True): cwl_files[os.path.join('share', 'prefactor', os.path.dirname(file))].append(file) data_files = cwl_files.items()
-
mentioned in commit 529e3eee
-
mentioned in commit 1ecd06c9
-
mentioned in commit 99899e96
-
mentioned in commit b95945e1