Skip to content

Commit

Permalink
Revert "Drop Python 3.6" (#1620)
Browse files Browse the repository at this point in the history
* Revert "Drop Python 3.6"

Ubuntu 18.04 (LTS, supported until April 2023) and Centos 7 are still
on Python 3.6.

This reverts commit 780f64a.

* Review fixes and run 'make sort_imports'
  • Loading branch information
tetron authored Feb 17, 2022
1 parent ea1e434 commit 16f4b11
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
py-ver-major: [3]
py-ver-minor: [7, 8, 9, 10]
py-ver-minor: [6, 7, 8, 9, 10]
step: [lint, unit, bandit, mypy]

env:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ shellcheck: FORCE
cwltool-in-docker.sh

pyupgrade: $(PYSOURCES)
pyupgrade --exit-zero-even-if-changed --py37-plus $^
pyupgrade --exit-zero-even-if-changed --py36-plus $^

release-test: check-python3 FORCE
git diff-index --quiet HEAD -- || ( echo You have uncommited changes, please commit them and try again; false )
Expand Down
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Quay.io (Docker): |Quay.io Container|
.. |Total PyPI Downloads| image:: https://static.pepy.tech/personalized-badge/cwltool?period=total&units=international_system&left_color=black&right_color=orange&left_text=Total%20PyPI%20Downloads
:target: https://pepy.tech/project/cwltool

.. |Conda Version| image:: https://anaconda.org/conda-forge/cwltool/badges/version.svg
.. |Conda Version| image:: https://anaconda.org/conda-forge/cwltool/badges/version.svg
:target: https://anaconda.org/conda-forge/cwltool

.. |Conda Installs| image:: https://anaconda.org/conda-forge/cwltool/badges/downloads.svg
:target: https://anaconda.org/conda-forge/cwltool

Expand Down Expand Up @@ -84,7 +84,7 @@ If you encounter an error, first try to update package information by using
sudo apt-get update
If you are running macOS X or other UNIXes and you want to use packages prepared by the conda-forge project, then
please follow the install instructions for `conda-forge <https://conda-forge.org/#about>`_ (if you haven't already) and then
please follow the install instructions for `conda-forge <https://conda-forge.org/#about>`_ (if you haven't already) and then

.. code:: bash
Expand Down Expand Up @@ -142,11 +142,11 @@ system link or `another facility <https://wiki.debian.org/DebianAlternatives>`_.
Recommended Software
^^^^^^^^^^^^^^^^^^^^

You may also want to have the following installed:
You may also want to have the following installed:
- `node.js <https://nodejs.org/en/download/>`_
- Docker, udocker, or Singularity (optional)

Without these, some examples in the CWL tutorials at http://www.commonwl.org/user_guide/ may not work.
Without these, some examples in the CWL tutorials at http://www.commonwl.org/user_guide/ may not work.

Run on the command line
-----------------------
Expand Down
2 changes: 1 addition & 1 deletion cwltool/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import argparse
import os
import urllib
from typing import (
Any,
AnyStr,
Expand All @@ -16,7 +17,6 @@
Union,
cast,
)
import urllib

from schema_salad.ref_resolver import file_uri

Expand Down
15 changes: 3 additions & 12 deletions cwltool/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,14 @@
import shutil
import tempfile
import threading
from typing import (
IO,
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
List,
Optional,
TextIO,
Union,
)
from typing import IO, Any, Callable, Dict, Iterable, List, Optional, TextIO, Union

# move to a regular typing import when Python 3.3-3.6 is no longer supported
from ruamel.yaml.comments import CommentedMap
from schema_salad.avro.schema import Names
from schema_salad.ref_resolver import Loader
from schema_salad.utils import FetcherCallableType
from typing_extensions import TYPE_CHECKING

from .builder import Builder
from .mpi import MpiConfig
Expand Down
1 change: 1 addition & 0 deletions cwltool/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
Union,
cast,
)

import psutil
import shellescape
from prov.model import PROV
Expand Down
32 changes: 17 additions & 15 deletions cwltool/provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,22 +247,24 @@ def _valid_orcid(orcid: Optional[str]) -> str:
"oa:motivatedBy": Dict[str, str],
},
)


class Aggregate(TypedDict, total=False):
uri: Optional[str]
bundledAs: Optional[Dict[str, Any]]
mediatype: Optional[str]
conformsTo: Optional[Union[str, List[str]]]
createdOn: Optional[str]
createdBy: Optional[Dict[str, str]]


Aggregate = TypedDict(
"Aggregate",
{
"uri": Optional[str],
"bundledAs": Optional[Dict[str, Any]],
"mediatype": Optional[str],
"conformsTo": Optional[Union[str, List[str]]],
"createdOn": Optional[str],
"createdBy": Optional[Dict[str, str]],
},
total=False,
)
# Aggregate.bundledAs is actually type Aggregate, but cyclic definitions are not suported
class AuthoredBy(TypedDict, total=False):
orcid: Optional[str]
name: Optional[str]
uri: Optional[str]
AuthoredBy = TypedDict(
"AuthoredBy",
{"orcid": Optional[str], "name": Optional[str], "uri": Optional[str]},
total=False,
)


class ResearchObject:
Expand Down
15 changes: 8 additions & 7 deletions cwltool/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,14 @@
JSONType = Union[
Dict[str, JSONAtomType], List[JSONAtomType], str, int, float, bool, None
]


class WorkflowStateItem(NamedTuple):
parameter: CWLObjectType
value: Optional[CWLOutputType]
success: str

WorkflowStateItem = NamedTuple(
"WorkflowStateItem",
[
("parameter", CWLObjectType),
("value", Optional[CWLOutputType]),
("success", str),
],
)

ParametersType = List[CWLObjectType]
StepType = CWLObjectType # WorkflowStep
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ coloredlogs
pydot>=1.4.1
argcomplete>=1.12.0
pyparsing != 3.0.2 # breaks --print-dot (pydot) https://github.com/pyparsing/pyparsing/issues/319
pyparsing < 3;python_version<='3.6' # breaks --print-dot
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@
"coloredlogs",
"pydot >= 1.4.1",
"pyparsing != 3.0.2", # breaks --print-dot (pydot) https://github.com/pyparsing/pyparsing/issues/319
"pyparsing < 3 ;python_version<='3.6'", # breaks --print-dot (pydot)
"argcomplete",
],
extras_require={
"deps": ["galaxy-tool-util >= 21.1.0"],
},
python_requires=">=3.7, <4",
python_requires=">=3.6, <4",
setup_requires=PYTEST_RUNNER,
test_suite="tests",
tests_require=[
Expand All @@ -150,6 +151,7 @@
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_stdout_stderr_log_dir.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
import json
import os
from pathlib import Path

from cwltool.main import main
Expand Down
3 changes: 2 additions & 1 deletion tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def env_accepts_null() -> bool:
if _env_accepts_null is None:
result = subprocess.run(
["env", "-0"],
capture_output=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
encoding="utf-8",
)
_env_accepts_null = result.returncode == 0
Expand Down
47 changes: 24 additions & 23 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tox]
envlist =
py3{7,8,9,10}-lint
py3{7,8,9,10}-unit
py3{7,8,9,10}-bandit
py3{7,8,9,10}-mypy
py3{6,7,8,9,10}-lint
py3{6,7,8,9,10}-unit
py3{6,7,8,9,10}-bandit
py3{6,7,8,9,10}-mypy
py39-lintreadme
py39-shellcheck
py39-pydocstyle
Expand All @@ -16,20 +16,21 @@ testpaths = tests

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310

[testenv]
skipsdist =
py3{7,8,9,10}-!{unit,mypy,lintreadme} = True
py3{6,7,8,9,10}-!{unit,mypy,lintreadme} = True

description =
py3{7,8,9,10}-unit: Run the unit tests
py3{7,8,9,10}-lint: Lint the Python code
py3{7,8,9,10}-bandit: Search for common security issues
py3{7,8,9,10}-mypy: Check for type safety
py3{6,7,8,9,10}-unit: Run the unit tests
py3{6,7,8,9,10}-lint: Lint the Python code
py3{6,7,8,9,10}-bandit: Search for common security issues
py3{6,7,8,9,10}-mypy: Check for type safety
py39-pydocstyle: docstring style checker
py39-shellcheck: syntax check for shell scripts
py39-lintreadme: Lint the README.rst→.md conversion
Expand All @@ -40,39 +41,39 @@ passenv =
PROOT_NO_SECCOMP

extras =
py3{7,8,9,10}-unit: deps
py3{6,7,8,9,10}-unit: deps

deps =
py3{7,8,9,10}-{unit,lint,bandit,mypy}: -rrequirements.txt
py3{7,8,9,10}-{unit,mypy}: -rtest-requirements.txt
py3{7,8,9,10}-lint: -rlint-requirements.txt
py3{7,8,9,10}-bandit: bandit
py3{7,8,9,10}-bandit: importlib_metadata != 4.8.0
py3{7,8,9,10}-mypy: -rmypy-requirements.txt
py3{6,7,8,9,10}-{unit,lint,bandit,mypy}: -rrequirements.txt
py3{6,7,8,9,10}-{unit,mypy}: -rtest-requirements.txt
py3{6,7,8,9,10}-lint: -rlint-requirements.txt
py3{6,7,8,9,10}-bandit: bandit
py3{6,7,8,9,10}-bandit: importlib_metadata != 4.8.0
py3{6,7,8,9,10}-mypy: -rmypy-requirements.txt
py39-pydocstyle: pydocstyle
py39-pydocstyle: diff-cover
py39-lintreadme: twine
py39-lintreadme: wheel
py39-lintreadme: readme_renderer[md]

setenv =
py3{7,8,9,10}-unit: LC_ALL = C.UTF-8
py3{6,7,8,9,10}-unit: LC_ALL = C.UTF-8

commands_pre =
py3{7,8,9,10}-unit: python -m pip install -U pip setuptools wheel
py3{6,7,8,9,10}-unit: python -m pip install -U pip setuptools wheel
py39-lintreadme: python setup.py sdist --dist-dir {distdir}
py39-lintreadme: python setup.py bdist_wheel --dist-dir {distdir}

commands =
py3{7,8,9,10}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs}
py3{7,8,9,10}-bandit: bandit -r cwltool
py3{7,8,9,10}-lint: make flake8 format-check
py3{7,8,9,10}-mypy: make mypy mypyc PYTEST_EXTRA={posargs}
py3{6,7,8,9,10}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs}
py3{6,7,8,9,10}-bandit: bandit -r cwltool
py3{6,7,8,9,10}-lint: make flake8 format-check
py3{6,7,8,9,10}-mypy: make mypy mypyc PYTEST_EXTRA={posargs}
py39-shellcheck: make shellcheck
py39-pydocstyle: make diff_pydocstyle_report
py39-lintreadme: twine check {distdir}/*

skip_install =
py3{7,8,9,10}-{bandit,lint,mypy,shellcheck,pydocstyle,lintreadme}: true
py3{6,7,8,9,10}-{bandit,lint,mypy,shellcheck,pydocstyle,lintreadme}: true

allowlist_externals = make

0 comments on commit 16f4b11

Please sign in to comment.