Skip to content

Commit 3e92a05

Browse files
committed
drop support for Python 3.6
1 parent 6698f1e commit 3e92a05

File tree

8 files changed

+47
-74
lines changed

8 files changed

+47
-74
lines changed

.github/workflows/ci-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
matrix:
2222
py-ver-major: [3]
23-
py-ver-minor: [6, 7, 8, 9, 10]
23+
py-ver-minor: [7, 8, 9, 10]
2424
step: [lint, unit, mypy]
2525

2626
env:

.github/workflows/wheels.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
- name: Build manylinux2010 Python wheels
1313
uses: RalfG/[email protected]_x86_64
1414
with:
15-
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
15+
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
1616
pre-build-command: source .github/workflows/wheel-prep.sh
1717
build-requirements: -rrequirements.txt -rmypy-requirements.txt
1818
- name: Build manylinux2014 Python wheels
1919
uses: RalfG/[email protected]_x86_64
2020
with:
21-
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
21+
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
2222
pre-build-command: source .github/workflows/wheel-prep.sh
2323
build-requirements: -rrequirements.txt -rmypy-requirements.txt
2424
- name: Move audited wheels to new directory
@@ -39,7 +39,7 @@ jobs:
3939
- name: Build manylinux2014 Python wheels
4040
uses: RalfG/[email protected]_aarch64
4141
with:
42-
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
42+
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
4343
pre-build-command: source .github/workflows/wheel-prep.sh
4444
build-requirements: -rrequirements.txt -rmypy-requirements.txt
4545
- name: Move audited wheels to new directory

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Style guide:
2-
- Python 3.6+ compatible code
2+
- Python 3.7+ compatible code
33
- PEP-484 type hints
44
- Prefer new style format strings https://pyformat.info/
55
- Use ``make format`` to format your code

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ mypyc: $(PYSOURCES)
181181
MYPYPATH=typeshed SCHEMA_SALAD_USE_MYPYC=1 python setup.py test
182182

183183
pyupgrade: $(filter-out schema_salad/metaschema.py,$(PYSOURCES))
184-
pyupgrade --exit-zero-even-if-changed --py36-plus $^
184+
pyupgrade --exit-zero-even-if-changed --py37-plus $^
185185

186186
release-test: FORCE
187187
git diff-index --quiet HEAD -- || ( echo You have uncommited changes, please commit them and try again; false )

schema_salad/codegen_base.py

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,19 @@
11
"""Base class for the generation of loaders from schema-salad definitions."""
22
from collections import OrderedDict
3-
from typing import Any, Dict, List, MutableSequence, Optional, Set, Union
3+
from typing import Any, Dict, List, MutableSequence, NamedTuple, Optional, Set, Union
44

55

6-
class TypeDef: # pylint: disable=too-few-public-methods
6+
class TypeDef(NamedTuple):
77
"""Schema Salad type description."""
88

9-
__slots__ = [
10-
"name",
11-
"init",
12-
"is_uri",
13-
"scoped_id",
14-
"ref_scope",
15-
"loader_type",
16-
"instance_type",
17-
"abstract",
18-
]
19-
20-
# switch to class-style typing.NamedTuple once support for Python < 3.6
21-
# is dropped
22-
def __init__(
23-
self, # pylint: disable=too-many-arguments
24-
name: str,
25-
init: str,
26-
is_uri: bool = False,
27-
scoped_id: bool = False,
28-
ref_scope: Optional[int] = 0,
29-
loader_type: Optional[str] = None,
30-
instance_type: Optional[str] = None,
31-
abstract: bool = False,
32-
) -> None:
33-
self.name = name
34-
self.init = init
35-
self.is_uri = is_uri
36-
self.scoped_id = scoped_id
37-
self.ref_scope = ref_scope
38-
self.abstract = abstract
39-
# Follow attributes used by Java but not Python.
40-
self.loader_type = loader_type
41-
self.instance_type = instance_type
9+
name: str
10+
init: str
11+
is_uri: bool = False
12+
scoped_id: bool = False
13+
ref_scope: Optional[int] = 0
14+
loader_type: Optional[str] = None
15+
instance_type: Optional[str] = None
16+
abstract: bool = False
4217

4318

4419
class CodeGenBase:

schema_salad/typescript_codegen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def type_loader_enum(self, type_declaration: Dict[str, Any]) -> TypeDef:
451451
for sym in type_declaration["symbols"]:
452452
val = self.safe_name(sym)
453453
const = self.safe_name(sym).replace("-", "_").replace(".", "_").upper()
454-
f.write(""" {const}='{val}',\n""".format(const=const, val=val))
454+
f.write(f""" {const}='{val}',\n""")
455455
f.write(
456456
"""}
457457
"""
@@ -768,7 +768,7 @@ def expand_resource_template_to(resource: str, path: Path) -> None:
768768
)
769769

770770
internal_module_exports = "\n".join(
771-
"export * from '../{}'".format(f) for f in self.modules
771+
f"export * from '../{f}'" for f in self.modules
772772
)
773773

774774
example_tests = ""

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
download_url="https://github.com/common-workflow-language/schema_salad/releases",
103103
ext_modules=ext_modules,
104104
license="Apache 2.0",
105-
python_requires=">=3.6",
105+
python_requires=">=3.7",
106106
setup_requires=pytest_runner,
107107
packages=["schema_salad", "schema_salad.tests"],
108108
package_data={"schema_salad": ["metaschema/*", "py.typed"]},
@@ -126,7 +126,6 @@
126126
"Operating System :: POSIX",
127127
"Operating System :: MacOS :: MacOS X",
128128
"Development Status :: 5 - Production/Stable",
129-
"Programming Language :: Python :: 3.6",
130129
"Programming Language :: Python :: 3.7",
131130
"Programming Language :: Python :: 3.8",
132131
"Programming Language :: Python :: 3.9",

tox.ini

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[tox]
22
envlist =
3-
py{36,37,38,39,310}-lint,
4-
py{36,37,38,39,310}-unit,
5-
py{36,37,38,39,310}-bandit,
6-
py{36,37,38,39,310}-mypy,
3+
py{37,38,39,310}-lint,
4+
py{37,38,39,310}-unit,
5+
py{37,38,39,310}-bandit,
6+
py{37,38,39,310}-mypy,
77
py39-lintreadme,
88
py39-pydocstyle
99

@@ -15,55 +15,54 @@ testpaths=schema_salad/tests
1515

1616
[gh-actions]
1717
python =
18-
3.6: py36
1918
3.7: py37
2019
3.8: py38
2120
3.9: py39
2221
3.10: py310
2322

2423
[testenv]
2524
description =
26-
py{36,37,38,39,310}-unit: Run the unit tests
27-
py{36,37,38,39,310}-lint: Lint the Python code
28-
py{36,37,38,39,310}-bandit: Search for common security issues
29-
py{36,37,38,39,310}-mypy: Check for type safety
25+
py{37,38,39,310}-unit: Run the unit tests
26+
py{37,38,39,310}-lint: Lint the Python code
27+
py{37,38,39,310}-bandit: Search for common security issues
28+
py{37,38,39,310}-mypy: Check for type safety
3029
py39-pydocstyle: docstring style checker
3130
py39-lintreadme: Lint the README.rst->.md conversion
3231

3332
passenv =
3433
CI
3534
GITHUB_*
3635
deps =
37-
py{36,37,38,39,310}-{unit,mypy}: -rrequirements.txt
38-
py{36,37,38,39,310}-{unit,mypy}: -rtest-requirements.txt
39-
py{36,37,38,39,310}-lint: flake8-bugbear
40-
py{36,37,38,39,310}-lint: black
41-
py{36,37,38,39,310}-bandit: bandit
42-
py{36,37,38,39,310}-mypy: -rmypy-requirements.txt
36+
py{37,38,39,310}-{unit,mypy}: -rrequirements.txt
37+
py{37,38,39,310}-{unit,mypy}: -rtest-requirements.txt
38+
py{37,38,39,310}-lint: flake8-bugbear
39+
py{37,38,39,310}-lint: black
40+
py{37,38,39,310}-bandit: bandit
41+
py{37,38,39,310}-mypy: -rmypy-requirements.txt
4342

4443
setenv =
45-
py{36,37,38,39,310}-unit: LC_ALL = C.UTF-8
44+
py{37,38,39,310}-unit: LC_ALL = C.UTF-8
4645

4746
commands =
48-
py{36,37,38,39,310}-unit: python -m pip install -U pip setuptools wheel
49-
py{36,37,38,39,310}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs}
50-
py{36,37,38,39,310}-bandit: bandit --recursive --exclude schema_salad/tests/ schema_salad
51-
py{36,37,38,39,310}-lint: make flake8
52-
py{36,37,38,39,310}-lint: make format-check
53-
py{36,37,38,39,310}-mypy: make mypy
54-
py{36,37,38,39,310}-mypy: make mypyc
47+
py{37,38,39,310}-unit: python -m pip install -U pip setuptools wheel
48+
py{37,38,39,310}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs}
49+
py{37,38,39,310}-bandit: bandit --recursive --exclude schema_salad/tests/ schema_salad
50+
py{37,38,39,310}-lint: make flake8
51+
py{37,38,39,310}-lint: make format-check
52+
py{37,38,39,310}-mypy: make mypy
53+
py{37,38,39,310}-mypy: make mypyc
5554

5655
whitelist_externals =
57-
py{36,37,38,39,310}-lint: flake8
58-
py{36,37,38,39,310}-lint: black
59-
py{36,37,38,39,310}-{mypy,shellcheck,lint,unit}: make
56+
py{37,38,39,310}-lint: flake8
57+
py{37,38,39,310}-lint: black
58+
py{37,38,39,310}-{mypy,shellcheck,lint,unit}: make
6059

6160
skip_install =
62-
py{36,37,38,39,310}-lint: true
63-
py{36,37,38,39,310}-bandit: true
61+
py{37,38,39,310}-lint: true
62+
py{37,38,39,310}-bandit: true
6463

6564
extras =
66-
py{36,37,38,39,310}-unit: pycodegen
65+
py{37,38,39,310}-unit: pycodegen
6766

6867
[testenv:py39-pydocstyle]
6968
whitelist_externals = make

0 commit comments

Comments
 (0)