Skip to content

Commit c79ee1e

Browse files
committed
drop support for Python 3.6
Python 3.8 is now the minimum version
1 parent 00f4437 commit c79ee1e

File tree

12 files changed

+37
-68
lines changed

12 files changed

+37
-68
lines changed

.github/workflows/ci-tests.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,14 @@ jobs:
1515
tox:
1616
name: CI tests via Tox
1717

18-
runs-on: ubuntu-20.04 # 22.04 doesn't support Python 3.6
18+
runs-on: ubuntu-22.04
1919

2020
strategy:
2121
matrix:
2222
py-ver-major: [3]
23-
py-ver-minor: [6, 8, 9, 10, 11, 12]
23+
py-ver-minor: [8, 9, 10, 11, 12]
2424
step: [lint, bandit, unit, mypy, memleak]
2525
exclude:
26-
- py-ver-major: 3
27-
py-ver-minor: 6
28-
step: mypy
29-
- py-ver-major: 3
30-
py-ver-minor: 6
31-
step: memleak
32-
- py-ver-major: 3
33-
py-ver-minor: 6
34-
step: lint
3526
- py-ver-major: 3
3627
py-ver-minor: 12
3728
step: memleak

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.8+ 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: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,6 @@ mypy3: mypy
178178
mypy: $(filter-out setup.py,$(PYSOURCES))
179179
MYPYPATH=$$MYPYPATH:mypy-stubs mypy $^
180180

181-
mypy_3.6: $(filter-out setup.py,$(PYSOURCES))
182-
MYPYPATH=$$MYPYPATH:mypy-stubs mypy --python-version 3.6 $^
183-
184181
mypyc: $(PYSOURCES)
185182
MYPYPATH=mypy-stubs SCHEMA_SALAD_USE_MYPYC=1 pip install --verbose -e . \
186183
&& pytest "${PYTEST_EXTRA}"
@@ -206,7 +203,8 @@ shellcheck: FORCE
206203
shellcheck build-schema_salad-docker.sh release-test.sh
207204

208205
pyupgrade: $(filter-out schema_salad/metaschema.py,$(PYSOURCES))
209-
pyupgrade --exit-zero-even-if-changed --py36-plus $^
206+
pyupgrade --exit-zero-even-if-changed --py38-plus $^
207+
auto-walrus $^
210208

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

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ generation, and transformation to RDF_. Salad provides a bridge
2323
between document and record oriented data modeling and the Semantic
2424
Web.
2525

26-
The Schema Salad library is Python 3.6+ only.
26+
The Schema Salad library is Python 3.8+ only.
2727

2828
Installation
2929
------------

dev-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ isort < 5.13
99
build < 0.10.1
1010
autoflake < 2.3
1111
bandit < 1.7.6
12+
auto-walrus

pyproject.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
requires = [
33
"setuptools>=45",
44
"setuptools_scm[toml]>=6.2",
5-
'mypy==0.971; python_version == "3.6"', # last version for Python 3.6
6-
'mypy==1.4.1; python_version >= "3.7"', # update mypy-requirements as well
5+
'mypy==1.4.1', # update mypy-requirements as well
76
"black>=19.10b0",
87
"types-pkg_resources",
98
"types-requests",
@@ -22,11 +21,11 @@ before-build = "python -m pip install -r requirements.txt -r mypy-requirements.t
2221
test-command = "python -m pytest -n 2 --junitxml=/output/test-results/junit_$(python -V | awk '{print $2}')_${AUDITWHEEL_PLAT}.xml --pyargs schema_salad"
2322
test-requires = "-r test-requirements.txt"
2423
test-extras = "pycodegen"
25-
skip = "pp* cp36-*"
24+
skip = "pp* cp36-* cp37-* cp312-*"
2625
# ^ skip building wheels on PyPy (any version)
27-
# ^ skip building wheels on Python 3.6 (we now need mypy 0.990+ which doesn't support Python 3.6)
26+
# ^ skip building wheels on Python 3.6 / 3.7 (not supported) & 3.12 (not ready)
2827
build-verbosity = "1"
2928

3029
[tool.black]
3130
line-length = 100
32-
target-version = [ "py36" ]
31+
target-version = [ "py38" ]

requirements.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
requests >= 1.0
2-
ruamel.yaml >= 0.16.12, < 0.18
3-
ruamel.yaml >= 0.17.6;python_version>='3.7'
2+
ruamel.yaml >= 0.17.6, < 0.18
43
rdflib>= 4.2.2, < 7.0.0
5-
rdflib< 6.0.0;python_version<='3.6'
6-
rdflib-jsonld>=0.4.0, <= 0.6.1;python_version<='3.6'
74
mistune>=2.0.3,<2.1
85
CacheControl[filecache]>= 0.11.7, < 0.14
9-
CacheControl[filecache]< 0.13;python_version<='3.6'
10-
urllib3<2;python_version<='3.6'
116
black<23.8
127
mypy_extensions
13-
importlib_metadata;python_version<'3.8'
148
importlib_resources>=1.4
159
# ^^ equivalent to Python 3.9

schema_salad/codegen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def codegen(
5959
info = parser_info or pkg
6060
salad_version = schema_metadata.get("saladVersion", "v1.1")
6161

62-
if lang in set(["python", "cpp", "dlang"]):
62+
if lang in {"python", "cpp", "dlang"}:
6363
if target:
6464
dest: Union[TextIOWrapper, TextIO] = open(target, mode="w", encoding="utf-8")
6565
else:

schema_salad/main.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222
if int(rdflib_version.split(".", maxsplit=1)[0]) < 6:
2323
register("json-ld", Parser, "rdflib_jsonld.parser", "JsonLDParser")
2424

25-
if sys.version_info >= (3, 8):
26-
import importlib.metadata as importlib_metadata
27-
else:
28-
import importlib_metadata
25+
import importlib.metadata
26+
2927
_logger = logging.getLogger("salad")
3028

3129

@@ -225,8 +223,7 @@ def main(argsl: Optional[List[str]] = None) -> int:
225223
if args.debug:
226224
_logger.setLevel(logging.DEBUG)
227225

228-
pkg = importlib_metadata.version("schema_salad")
229-
if pkg:
226+
if pkg := importlib.metadata.version("schema_salad"):
230227
if args.version:
231228
print(f"{sys.argv[0]} Current version: {pkg}")
232229
return 0

schema_salad/sourceline.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ def indent(v: str, nolead: bool = False, shift: str = " ", bullet: str = " ")
8585
return v.splitlines()[0] + "\n".join([shift + line for line in v.splitlines()[1:]])
8686

8787
def lineno(i: int, line: str) -> str:
88-
r = lineno_re.match(line)
89-
if r is not None:
88+
if (r := lineno_re.match(line)) is not None:
9089
group1 = r.group(1)
9190
group2 = r.group(2)
9291
assert group1 is not None # nosec

0 commit comments

Comments
 (0)