Replace imp
with importlib
#3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint Code | |
on: [pull_request] | |
jobs: | |
lint-workflows: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
# BEGIN Dependencies | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.7' | |
architecture: 'x64' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install -U setuptools | |
pip install -U planemo | |
pip install -U flake8 | |
pip install -U xmldiff | |
# END Dependencies | |
- name: Lint 🔍👁👁 | |
run: | | |
python setup.py install | |
flake8 argparse2tool --ignore=E2,E3,E4,E5,W3,W505 | |
PYTHONPATH=$(argparse2tool) python examples/example.py --generate_galaxy_xml > tmp.xml | |
xmldiff tmp.xml examples/example.xml | |
planemo lint --report_level all --fail_level error --xsd tmp.xml | |
# Galaxy tool generation for example with subparsers -- generating one large (invalid) tool | |
echo '<root>' > tmp-sub.xml # wrap in extra level | |
PYTHONPATH=$(argparse2tool) python examples/example-sub.py --generate_galaxy_xml >> tmp-sub.xml | |
echo '</root>' >> tmp-sub.xml | |
xmldiff tmp-sub.xml <(echo "<root>"; cat examples/example-sub.xml; echo "</root>") | |
# Galaxy tool generation for example with subparsers -- generating separate tools | |
PYTHONPATH=$(argparse2tool) python examples/example-sub.py --generate_galaxy_xml --command foo > tmp-sub-foo.xml | |
PYTHONPATH=$(argparse2tool) python examples/example-sub.py --generate_galaxy_xml --command bar > tmp-sub-bar.xml | |
xmldiff tmp-sub-foo.xml examples/example-sub-foo.xml | |
planemo lint --report_level all --fail_level error --xsd tmp-sub-foo.xml | |
xmldiff tmp-sub-bar.xml examples/example-sub-bar.xml | |
planemo lint --report_level all --fail_level error --xsd tmp-sub-bar.xml | |
PYTHONPATH=$(argparse2tool) python examples/example.py --generate_cwl_tool > tmp.cwl | |
PYTHONPATH=$(argparse2tool) python examples/example-sub.py --generate_cwl_tool > tmp-sub.cwl | |
sed -i 's/argparse2tool .*/argparse2tool/g' tmp.cwl tmp-sub.cwl | |
diff tmp.cwl examples/example.cwl | |
diff tmp-sub.cwl examples/example-sub.cwl | |
PYTHONPATH=$(argparse2tool) python examples/example-click.py --generate_cwl_tool > tmp-click.cwl | |
diff tmp-click.cwl examples/example-click.cwl |