Skip to content

Commit 8338ce4

Browse files
authored
Merge pull request #19 from common-workflow-language/fix_workflow_output_source
Fix workflow output source
2 parents efce522 + 28c2578 commit 8338ce4

File tree

22 files changed

+355
-236
lines changed

22 files changed

+355
-236
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ python:
44
- 2.7
55
- 3.4
66
- 3.5
7+
- 3.6
78
os:
89
- linux
910

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include MANIFEST.in
2+
include tests/*.cwl

Makefile

Lines changed: 73 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -15,47 +15,47 @@
1515
#
1616
1717

18-
# make pep8 to check for basic Python code compliance
18+
# make pycodestyle to check for basic Python code compliance
1919
# make autopep8 to fix most pep8 errors
2020
# make pylint to check Python code for enhanced compliance including naming
2121
# and documentation
2222
# make coverage-report to check coverage of the python scripts by the tests
2323

24-
MODULE=cwl-upgrader
24+
MODULE=cwlupgrader
2525

26-
# `SHELL=bash` Will break Titus's laptop, so don't use BASH-isms like
26+
# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
2727
# `[[` conditional expressions.
28-
PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py
29-
DEVPKGS=pep8 diff_cover autopep8 pylint coverage pep257 flake8
30-
MYPYPATH=typeshed/2or3
31-
MYPYFLAGS=--disallow-untyped-calls --disallow-untyped-defs \
32-
--warn-incomplete-stub --warn-redundant-casts
33-
28+
PYSOURCES=$(wildcard cwlupgrader/**.py tests/*.py) setup.py
29+
DEVPKGS=pycodestyle diff_cover autopep8 pylint coverage pydocstyle flake8 pytest isort mock
30+
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
31+
python-flake8 python-mock shellcheck
3432
VERSION=$(shell git describe --tags --dirty | sed s/v//)
3533

3634
## all : default task
37-
all: ./setup.py develop
35+
all:
36+
./setup.py develop
3837

3938
## help : print this help message and exit
4039
help: Makefile
4140
@sed -n 's/^##//p' $<
4241

4342
## install-dep : install most of the development dependencies via pip
44-
install-dep: install-dependencies
45-
46-
install-dependencies:
43+
install-dep:
4744
pip install --upgrade $(DEVPKGS)
48-
#pip install -r requirements.txt
45+
46+
## install-deb-dep: install most of the dev dependencies via apt-get
47+
install-deb-dep:
48+
sudo apt-get install $(DEBDEVPKGS)
4949

5050
## install : install the ${MODULE} module and schema-salad-tool
5151
install: FORCE
52-
./setup.py build install
52+
pip install .
5353

5454
## dist : create a module package for distribution
5555
dist: dist/${MODULE}-$(VERSION).tar.gz
5656

5757
dist/${MODULE}-$(VERSION).tar.gz: $(SOURCES)
58-
./setup.py sdist
58+
./setup.py sdist bdist_wheel
5959

6060
## clean : clean up all temporary / machine-generated files
6161
clean: FORCE
@@ -64,25 +64,32 @@ clean: FORCE
6464
rm -Rf .coverage
6565
rm -f diff-cover.html
6666

67-
## pep8 : check Python code style
68-
pep8: $(PYSOURCES)
69-
pep8 --exclude=_version.py --show-source --show-pep8 $^ || true
67+
# Linting and code style related targets
68+
## sorting imports using isort: https://github.com/timothycrosley/isort
69+
sort_imports:
70+
isort ${MODULE}/*.py tests/*.py setup.py
71+
72+
pep8: pycodestyle
73+
## pycodestyle : check Python code style
74+
pycodestyle: $(PYSOURCES)
75+
pycodestyle --exclude=_version.py --show-source --show-pep8 $^ || true
7076

71-
pep8_report.txt: $(PYSOURCES)
72-
pep8 --exclude=_version.py $^ > $@ || true
77+
pycodestyle_report.txt: $(PYSOURCES)
78+
pycodestyle --exclude=_version.py $^ > $@ || true
7379

74-
diff_pep8_report: pep8_report.txt
75-
diff-quality --violations=pep8 pep8_report.txt
80+
diff_pycodestyle_report: pycodestyle_report.txt
81+
diff-quality --violations=pycodestyle $^
7682

77-
## pep257 : check Python code style
78-
pep257: $(PYSOURCES)
79-
pep257 --ignore=D100,D101,D102,D103 $^ || true
83+
pep257: pydocstyle
84+
## pydocstyle : check Python code style
85+
pydocstyle: $(PYSOURCES)
86+
pydocstyle --ignore=D100,D101,D102,D103 $^ || true
8087

81-
pep257_report.txt: $(PYSOURCES)
82-
pep257 setup.py $^ > $@ 2>&1 || true
88+
pydocstyle_report.txt: $(PYSOURCES)
89+
pydocstyle setup.py $^ > pydocstyle_report.txt 2>&1 || true
8390

84-
diff_pep257_report: pep257_report.txt
85-
diff-quality --violations=pep8 pep257_report.txt
91+
diff_pydocstyle_report: pydocstyle_report.txt
92+
diff-quality --violations=pycodestyle $^
8693

8794
## autopep8 : fix most Python code indentation and formatting
8895
autopep8: $(PYSOURCES)
@@ -105,8 +112,10 @@ pylint_report.txt: ${PYSOURCES}
105112
diff_pylint_report: pylint_report.txt
106113
diff-quality --violations=pylint pylint_report.txt
107114

108-
.coverage: $(PYSOURCES)
109-
coverage run --branch --source=${MODULE} setup.py test
115+
.coverage: testcov
116+
117+
coverage: .coverage
118+
coverage report
110119

111120
coverage.xml: .coverage
112121
coverage xml
@@ -130,6 +139,10 @@ diff-cover.html: coverage.xml
130139
test: FORCE
131140
python setup.py test
132141

142+
## testcov : run the ${MODULE} test suite and collect coverage
143+
testcov: $(pysources)
144+
python setup.py test --addopts "--cov ${MODULE}"
145+
133146
sloccount.sc: ${PYSOURCES} Makefile
134147
sloccount --duplicates --wide --details $^ > $@
135148

@@ -141,18 +154,34 @@ list-author-emails:
141154
@echo 'name, E-Mail Address'
142155
@git log --format='%aN,%aE' | sort -u | grep -v 'root'
143156

144-
mypy: ${PYSOURCES}
145-
MYPYPATH=${MYPYPATH} mypy ${MYPYFLAGS} cwlupgrader/
146-
MYPYPATH=${MYPYPATH} mypy --py2 ${MYPYFLAGS} cwlupgrader/
147157

148-
jenkins:
149-
rm -Rf env && virtualenv env
150-
. env/bin/activate ; \
151-
pip install -U setuptools pip wheel ; \
152-
${MAKE} install-dep coverage.html coverage.xml pep257_report.txt \
153-
sloccount.sc pep8_report.txt pylint_report.txt
154-
if ! test -d env3 ; then virtualenv -p python3 env3 ; fi
155-
. env3/bin/activate ; \
156-
pip install -U mypy-lang; ${MAKE} mypy
158+
mypy2: ${PYSOURCES}
159+
rm -Rf typeshed/2and3/ruamel/yaml
160+
ln -s $(shell python -c 'from __future__ import print_function; import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \
161+
typeshed/2and3/ruamel/yaml
162+
MYPYPATH=$$MYPYPATH:typeshed/2.7:typeshed/2and3 mypy --py2 --disallow-untyped-calls \
163+
--warn-redundant-casts \
164+
${MODULE}
165+
166+
mypy3: ${PYSOURCES}
167+
rm -Rf typeshed/2and3/ruamel/yaml
168+
ln -s $(shell python3 -c 'from __future__ import print_function; import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \
169+
typeshed/2and3/ruamel/yaml
170+
MYPYPATH=$$MYPYPATH:typeshed/3:typeshed/2and3 mypy --disallow-untyped-calls \
171+
--warn-redundant-casts \
172+
${MODULE}
173+
174+
release: FORCE
175+
./release-test.sh
176+
. testenv2/bin/activate && \
177+
testenv2/src/${MODULE}/setup.py sdist bdist_wheel && \
178+
pip install twine && \
179+
twine upload testenv2/src/${MODULE}/dist/* && \
180+
git tag ${VERSION} && git push --tags
157181

158182
FORCE:
183+
184+
# Use this to print the value of a Makefile variable
185+
# Example `make print-VERSION`
186+
# From https://www.cmcrossroads.com/article/printing-value-makefile-variable
187+
print-% : ; @echo $* = $($*)

cwlupgrader/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Transforms draft-3 CWL documents into v1.0 as idiomatically as possible."""

0 commit comments

Comments
 (0)