Skip to content

Commit 06b704a

Browse files
committed
drop Python2 support
1 parent 2073663 commit 06b704a

File tree

9 files changed

+93
-124
lines changed

9 files changed

+93
-124
lines changed

.travis.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
dist: trusty
2-
sudo: required
1+
dist: xenial
32
services:
43
- docker
54

@@ -15,13 +14,10 @@ install:
1514
- pip install tox-travis
1615
jobs:
1716
include:
18-
- python: "2.7"
1917
- python: "3.5"
2018
- python: "3.6"
2119
- python: "3.7"
22-
dist: xenial
23-
#- python: "3.8-dev"
24-
#dist: xenial
20+
- python: "3.8"
2521

2622
script: tox
2723
branches:

Makefile

Lines changed: 22 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#
1616
1717

18-
# make pycodestyle to check for basic Python code compliance
18+
# make format to fix most python formatting errors
1919
# make pylint to check Python code for enhanced compliance including naming
2020
# and documentation
2121
# make coverage-report to check coverage of the python scripts by the tests
@@ -25,15 +25,16 @@ MODULE=cwlupgrader
2525
# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
2626
# `[[` conditional expressions.
2727
PYSOURCES=$(wildcard cwlupgrader/**.py tests/*.py) setup.py
28-
DEVPKGS=pycodestyle diff_cover black pylint coverage pydocstyle \
29-
flake8-bugbear pytest isort mock flake8
30-
DEBDEVPKGS=pylint python-coverage pydocstyle sloccount \
31-
python-flake8 python-mock shellcheck
32-
VERSION=$(shell git describe --tags --dirty | sed s/v//)
28+
DEVPKGS=diff_cover black pylint coverage pep257 pytest-xdist \
29+
flake8-bugbear pytest isort flake8
30+
DEBDEVPKGS=pylint python3-coverage sloccount \
31+
python3-flake8 shellcheck
32+
VERSION=1.0.$(shell date +%Y%m%d%H%M%S --utc --date=`git log --first-parent \
33+
--max-count=1 --format=format:%cI`)
3334

3435
## all : default task
3536
all:
36-
./setup.py develop
37+
pip install -e .
3738

3839
## help : print this help message and exit
3940
help: Makefile
@@ -69,39 +70,29 @@ clean: FORCE
6970
sort_imports:
7071
isort ${MODULE}/*.py tests/*.py setup.py
7172

72-
## pycodestyle : check Python code style
73-
pycodestyle: $(PYSOURCES)
74-
pycodestyle --exclude=_version.py --show-source --show-pep8 $^ || true
75-
76-
pycodestyle_report.txt: $(PYSOURCES)
77-
pycodestyle --exclude=_version.py $^ > $@ || true
78-
79-
diff_pycodestyle_report: pycodestyle_report.txt
80-
diff-quality --violations=pycodestyle $^
81-
8273
pep257: pydocstyle
8374
## pydocstyle : check Python code style
8475
pydocstyle: $(PYSOURCES)
85-
pydocstyle --ignore=D100,D101,D102,D103 $^ || true
76+
pydocstyle --add-ignore=D100,D101,D102,D103 $^ || true
8677

8778
pydocstyle_report.txt: $(PYSOURCES)
88-
pydocstyle setup.py $^ > pydocstyle_report.txt 2>&1 || true
79+
pydocstyle setup.py $^ > $@ 2>&1 || true
8980

9081
diff_pydocstyle_report: pydocstyle_report.txt
91-
diff-quality --violations=pycodestyle $^
82+
diff-quality --violations=pycodestyle --fail-under=100 $^
9283

9384
## format : check/fix all code indentation and formatting (runs black)
9485
format:
95-
black --target-version py27 setup.py cwlupgrader
86+
black setup.py cwlupgrader
9687

9788
## pylint : run static code analysis on Python code
9889
pylint: $(PYSOURCES)
9990
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
100-
$^ || true
91+
$^ -j0|| true
10192

10293
pylint_report.txt: ${PYSOURCES}
10394
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
104-
$^ > $@ || true
95+
$^ -j0> $@ || true
10596

10697
diff_pylint_report: pylint_report.txt
10798
diff-quality --violations=pylint pylint_report.txt
@@ -148,19 +139,14 @@ list-author-emails:
148139
@echo 'name, E-Mail Address'
149140
@git log --format='%aN,%aE' | sort -u | grep -v 'root'
150141

151-
152-
mypy2: ${PYSOURCES}
153-
rm -Rf typeshed/2and3/ruamel/yaml
154-
ln -s $(shell python -c 'from __future__ import print_function; import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \
155-
typeshed/2and3/ruamel/yaml
156-
MYPYPATH=$$MYPYPATH:typeshed/2.7:typeshed/2and3 mypy --py2 --disallow-untyped-calls \
157-
--warn-redundant-casts \
158-
${MODULE}
159-
160-
mypy3: ${PYSOURCES}
161-
rm -Rf typeshed/2and3/ruamel/yaml
162-
ln -s $(shell python3 -c 'from __future__ import print_function; import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \
163-
typeshed/2and3/ruamel/yaml
142+
mypy3: mypy
143+
mypy: ${PYSOURCES}
144+
if ! test -f $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))')/py.typed ; \
145+
then \
146+
rm -Rf typeshed/2and3/ruamel/yaml ; \
147+
ln -s $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \
148+
typeshed/2and3/ruamel/ ; \
149+
fi # if minimally required ruamel.yaml version is 0.15.99 or greater, than the above can be removed
164150
MYPYPATH=$$MYPYPATH:typeshed/3:typeshed/2and3 mypy --disallow-untyped-calls \
165151
--warn-redundant-casts \
166152
${MODULE}

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version "draft-3" to "v1.0".
88
It does not check for correctness of the input document, for that one can use
99
the CWL reference implementation.
1010

11-
This is written and tested for Python 2.7, 3.4, and 3.5.
11+
This is written and tested for Python 3.5, 3.6, 3.7, and 3.8.
1212

1313
Install
1414
-------

0 commit comments

Comments
 (0)