Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ignore = E203,W503
max-line-length = 100
select = B,C,E,F,W,T4
exclude = cwltool/schemas
exclude = cwltool/schemas,cwltool/fast_parser.py
extend-ignore = E501,B905
# when Python 3.10 is the minimum version, re-enable check B905 for zip + strict
extend-select = B9
34 changes: 22 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ clean: FORCE

# Linting and code style related targets
## sort_import : sorting imports using isort: https://github.com/timothycrosley/isort
sort_imports: $(PYSOURCES) mypy-stubs
sort_imports: $(filter-out cwltool/fast_parser.py,$(PYSOURCES)) mypy-stubs
isort $^

remove_unused_imports: $(PYSOURCES)
remove_unused_imports: $(filter-out cwltool/fast_parser.py,$(PYSOURCES))
autoflake --in-place --remove-all-unused-imports $^

pep257: pydocstyle
## pydocstyle : check Python docstring style
pydocstyle: $(PYSOURCES)
pydocstyle:$(filter-out cwltool/fast_parser.py,$(PYSOURCES))
pydocstyle --add-ignore=D100,D101,D102,D103 $^ || true

pydocstyle_report.txt: $(PYSOURCES)
pydocstyle_report.txt: $(filter-out cwltool/fast_parser.py,$(PYSOURCES))
pydocstyle setup.py $^ > $@ 2>&1 || true

## diff_pydocstyle_report : check Python docstring style for changed files only
Expand All @@ -118,10 +118,10 @@ codespell-fix:

## format : check/fix all code indentation and formatting (runs black)
format:
black --exclude cwltool/schemas setup.py cwltool.py cwltool tests mypy-stubs
black --exclude cwltool/fast_parser.py cwltool/schemas setup.py cwltool.py cwltool tests mypy-stubs

format-check:
black --diff --check --exclude cwltool/schemas setup.py cwltool.py cwltool tests mypy-stubs
black --diff --check --exclude cwltool/fast_parser.py cwltool/schemas setup.py cwltool.py cwltool tests mypy-stubs

## pylint : run static code analysis on Python code
pylint: $(PYSOURCES)
Expand Down Expand Up @@ -159,11 +159,11 @@ diff-cover.html: coverage.xml
diff-cover --compare-branch=main $^ --html-report $@

## test : run the cwltool test suite
test: $(PYSOURCES)
test: $(filter-out cwltool/fast_parser.py,$(PYSOURCES))
python3 -m pytest ${PYTEST_EXTRA}

## testcov : run the cwltool test suite and collect coverage
testcov: $(PYSOURCES)
testcov: $(filter-out cwltool/fast_parser.py,$(PYSOURCES))
python3 -m pytest --cov --cov-config=.coveragerc --cov-report= ${PYTEST_EXTRA}

sloccount.sc: $(PYSOURCES) Makefile
Expand All @@ -178,21 +178,31 @@ list-author-emails:
@git log --format='%aN,%aE' | sort -u | grep -v 'root'

mypy3: mypy
mypy: $(PYSOURCES)
mypy: $(filter-out cwltool/fast_parser.py,$(PYSOURCES))
MYPYPATH=$$MYPYPATH:mypy-stubs mypy $^

mypyc: $(PYSOURCES)
mypyc: $(filter-out cwltool/fast_parser.py,$(PYSOURCES))
MYPYPATH=mypy-stubs CWLTOOL_USE_MYPYC=1 pip install --verbose -e . \
&& pytest -vv ${PYTEST_EXTRA}

shellcheck: FORCE
shellcheck build-cwltool-docker.sh cwl-docker.sh release-test.sh conformance-test.sh \
cwltool-in-docker.sh

pyupgrade: $(PYSOURCES)
pyupgrade: $(filter-out cwltool/fast_parser.py,$(PYSOURCES))
pyupgrade --exit-zero-even-if-changed --py310-plus $^
auto-walrus $^

cwltool/fast_parser.py: FORCE
schema-salad-tool --codegen python \
--codegen-parser-info "org.w3id.cwl.v1_2" \
--codegen-parent "https://w3id.org/cwl/salad=schema_salad.metaschema" \
--codegen-parent "https://w3id.org/cwl/cwl=cwl_utils.parser.cwl_v1_2" \
https://github.com/common-workflow-language/cwl-v1.2/raw/codegen/extensions.yml \
> $@

regen_fast_parser: cwltool/fast_parser.py

release-test: FORCE
git diff-index --quiet HEAD -- || ( echo You have uncommitted changes, please commit them and try again; false )
./release-test.sh
Expand All @@ -207,7 +217,7 @@ release:
twine upload testenv2/src/${MODULE}/dist/* && \
git tag ${VERSION} && git push --tags

flake8: $(PYSOURCES)
flake8: $(filter-out cwltool/fast_parser.py,$(PYSOURCES))
flake8 $^

FORCE:
Expand Down
2 changes: 1 addition & 1 deletion cwltool/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

if TYPE_CHECKING:
from _typeshed import SupportsWrite
from cwl_utils.parser.cwl_v1_2 import LoadingOptions
from schema_salad.runtime import LoadingOptions

from .builder import Builder
from .cwlprov.provenance_profile import ProvenanceProfile
Expand Down
Loading
Loading